Skip to content
Snippets Groups Projects
Commit a9ccbf1b authored by Fedepa's avatar Fedepa
Browse files

pantalla add completa

parent d5e5d97c
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.Badd1 = new System.Windows.Forms.Button(); this.Badd1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.empNom = new System.Windows.Forms.TextBox(); this.empNom = new System.Windows.Forms.TextBox();
...@@ -35,16 +36,19 @@ ...@@ -35,16 +36,19 @@
this.compT = new System.Windows.Forms.RadioButton(); this.compT = new System.Windows.Forms.RadioButton();
this.empDate = new System.Windows.Forms.DateTimePicker(); this.empDate = new System.Windows.Forms.DateTimePicker();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.tipoemptitle = new System.Windows.Forms.Label();
this.empSal = new System.Windows.Forms.NumericUpDown(); this.empSal = new System.Windows.Forms.NumericUpDown();
this.LabelSal = new System.Windows.Forms.Label(); this.LabelSal = new System.Windows.Forms.Label();
this.Bback = new System.Windows.Forms.Button(); this.Bback = new System.Windows.Forms.Button();
this.errorProviderAdd = new System.Windows.Forms.ErrorProvider(this.components);
this.addemptitle = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.empSal)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.empSal)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.errorProviderAdd)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// Badd1 // Badd1
// //
this.Badd1.Location = new System.Drawing.Point(158, 216); this.Badd1.Location = new System.Drawing.Point(158, 227);
this.Badd1.Name = "Badd1"; this.Badd1.Name = "Badd1";
this.Badd1.Size = new System.Drawing.Size(75, 23); this.Badd1.Size = new System.Drawing.Size(75, 23);
this.Badd1.TabIndex = 0; this.Badd1.TabIndex = 0;
...@@ -55,7 +59,7 @@ ...@@ -55,7 +59,7 @@
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(30, 25); this.label1.Location = new System.Drawing.Point(28, 46);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 13); this.label1.Size = new System.Drawing.Size(44, 13);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
...@@ -63,7 +67,7 @@ ...@@ -63,7 +67,7 @@
// //
// empNom // empNom
// //
this.empNom.Location = new System.Drawing.Point(33, 41); this.empNom.Location = new System.Drawing.Point(33, 62);
this.empNom.Name = "empNom"; this.empNom.Name = "empNom";
this.empNom.Size = new System.Drawing.Size(200, 20); this.empNom.Size = new System.Drawing.Size(200, 20);
this.empNom.TabIndex = 2; this.empNom.TabIndex = 2;
...@@ -71,28 +75,30 @@ ...@@ -71,28 +75,30 @@
// medioT // medioT
// //
this.medioT.AutoSize = true; this.medioT.AutoSize = true;
this.medioT.Location = new System.Drawing.Point(33, 128); this.medioT.Location = new System.Drawing.Point(33, 140);
this.medioT.Name = "medioT"; this.medioT.Name = "medioT";
this.medioT.Size = new System.Drawing.Size(85, 17); this.medioT.Size = new System.Drawing.Size(85, 17);
this.medioT.TabIndex = 4; this.medioT.TabIndex = 4;
this.medioT.TabStop = true; this.medioT.TabStop = true;
this.medioT.Text = "Medio Turno"; this.medioT.Text = "Medio Turno";
this.medioT.UseVisualStyleBackColor = true; this.medioT.UseVisualStyleBackColor = true;
this.medioT.CheckedChanged += new System.EventHandler(this.medioT_CheckedChanged);
// //
// compT // compT
// //
this.compT.AutoSize = true; this.compT.AutoSize = true;
this.compT.Location = new System.Drawing.Point(124, 128); this.compT.Location = new System.Drawing.Point(124, 140);
this.compT.Name = "compT"; this.compT.Name = "compT";
this.compT.Size = new System.Drawing.Size(100, 17); this.compT.Size = new System.Drawing.Size(100, 17);
this.compT.TabIndex = 5; this.compT.TabIndex = 5;
this.compT.TabStop = true; this.compT.TabStop = true;
this.compT.Text = "Turno Completo"; this.compT.Text = "Turno Completo";
this.compT.UseVisualStyleBackColor = true; this.compT.UseVisualStyleBackColor = true;
this.compT.CheckedChanged += new System.EventHandler(this.compT_CheckedChanged);
// //
// empDate // empDate
// //
this.empDate.Location = new System.Drawing.Point(33, 84); this.empDate.Location = new System.Drawing.Point(33, 101);
this.empDate.Name = "empDate"; this.empDate.Name = "empDate";
this.empDate.Size = new System.Drawing.Size(200, 20); this.empDate.Size = new System.Drawing.Size(200, 20);
this.empDate.TabIndex = 6; this.empDate.TabIndex = 6;
...@@ -100,24 +106,24 @@ ...@@ -100,24 +106,24 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(33, 68); this.label2.Location = new System.Drawing.Point(28, 85);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(90, 13); this.label2.Size = new System.Drawing.Size(90, 13);
this.label2.TabIndex = 7; this.label2.TabIndex = 7;
this.label2.Text = "Fecha de Ingreso"; this.label2.Text = "Fecha de Ingreso";
// //
// label3 // tipoemptitle
// //
this.label3.AutoSize = true; this.tipoemptitle.AutoSize = true;
this.label3.Location = new System.Drawing.Point(33, 111); this.tipoemptitle.Location = new System.Drawing.Point(26, 124);
this.label3.Name = "label3"; this.tipoemptitle.Name = "tipoemptitle";
this.label3.Size = new System.Drawing.Size(92, 13); this.tipoemptitle.Size = new System.Drawing.Size(92, 13);
this.label3.TabIndex = 8; this.tipoemptitle.TabIndex = 8;
this.label3.Text = "Tipo de empleado"; this.tipoemptitle.Text = "Tipo de empleado";
// //
// empSal // empSal
// //
this.empSal.Location = new System.Drawing.Point(33, 177); this.empSal.Location = new System.Drawing.Point(33, 189);
this.empSal.Name = "empSal"; this.empSal.Name = "empSal";
this.empSal.Size = new System.Drawing.Size(120, 20); this.empSal.Size = new System.Drawing.Size(120, 20);
this.empSal.TabIndex = 9; this.empSal.TabIndex = 9;
...@@ -125,7 +131,7 @@ ...@@ -125,7 +131,7 @@
// LabelSal // LabelSal
// //
this.LabelSal.AutoSize = true; this.LabelSal.AutoSize = true;
this.LabelSal.Location = new System.Drawing.Point(30, 161); this.LabelSal.Location = new System.Drawing.Point(30, 173);
this.LabelSal.Name = "LabelSal"; this.LabelSal.Name = "LabelSal";
this.LabelSal.Size = new System.Drawing.Size(39, 13); this.LabelSal.Size = new System.Drawing.Size(39, 13);
this.LabelSal.TabIndex = 10; this.LabelSal.TabIndex = 10;
...@@ -133,7 +139,7 @@ ...@@ -133,7 +139,7 @@
// //
// Bback // Bback
// //
this.Bback.Location = new System.Drawing.Point(36, 215); this.Bback.Location = new System.Drawing.Point(36, 227);
this.Bback.Name = "Bback"; this.Bback.Name = "Bback";
this.Bback.Size = new System.Drawing.Size(75, 23); this.Bback.Size = new System.Drawing.Size(75, 23);
this.Bback.TabIndex = 11; this.Bback.TabIndex = 11;
...@@ -141,15 +147,30 @@ ...@@ -141,15 +147,30 @@
this.Bback.UseVisualStyleBackColor = true; this.Bback.UseVisualStyleBackColor = true;
this.Bback.Click += new System.EventHandler(this.Bback_Click); this.Bback.Click += new System.EventHandler(this.Bback_Click);
// //
// errorProviderAdd
//
this.errorProviderAdd.ContainerControl = this;
//
// addemptitle
//
this.addemptitle.AutoSize = true;
this.addemptitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.addemptitle.Location = new System.Drawing.Point(16, 19);
this.addemptitle.Name = "addemptitle";
this.addemptitle.Size = new System.Drawing.Size(184, 17);
this.addemptitle.TabIndex = 12;
this.addemptitle.Text = "Ingrese los siguientes datos";
//
// EmployeeAddEdit // EmployeeAddEdit
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262); this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.addemptitle);
this.Controls.Add(this.Bback); this.Controls.Add(this.Bback);
this.Controls.Add(this.LabelSal); this.Controls.Add(this.LabelSal);
this.Controls.Add(this.empSal); this.Controls.Add(this.empSal);
this.Controls.Add(this.label3); this.Controls.Add(this.tipoemptitle);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.empDate); this.Controls.Add(this.empDate);
this.Controls.Add(this.compT); this.Controls.Add(this.compT);
...@@ -161,6 +182,7 @@ ...@@ -161,6 +182,7 @@
this.Text = "EmployeeAddEdit"; this.Text = "EmployeeAddEdit";
this.Load += new System.EventHandler(this.EmployeeAddEdit_Load); this.Load += new System.EventHandler(this.EmployeeAddEdit_Load);
((System.ComponentModel.ISupportInitialize)(this.empSal)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.empSal)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProviderAdd)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -174,10 +196,12 @@ ...@@ -174,10 +196,12 @@
private System.Windows.Forms.RadioButton compT; private System.Windows.Forms.RadioButton compT;
private System.Windows.Forms.DateTimePicker empDate; private System.Windows.Forms.DateTimePicker empDate;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label tipoemptitle;
private System.Windows.Forms.NumericUpDown empSal; private System.Windows.Forms.NumericUpDown empSal;
private System.Windows.Forms.Label LabelSal; private System.Windows.Forms.Label LabelSal;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button Bback; private System.Windows.Forms.Button Bback;
private System.Windows.Forms.ErrorProvider errorProviderAdd;
private System.Windows.Forms.Label addemptitle;
} }
} }
\ No newline at end of file
...@@ -31,6 +31,7 @@ namespace PresentationLayerWinform ...@@ -31,6 +31,7 @@ namespace PresentationLayerWinform
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
Employee newemp = null; Employee newemp = null;
errorProviderAdd.Clear();
try { try {
if (medioT.Checked) { if (medioT.Checked) {
newemp = new PartTimeEmployee(); newemp = new PartTimeEmployee();
...@@ -40,6 +41,10 @@ namespace PresentationLayerWinform ...@@ -40,6 +41,10 @@ namespace PresentationLayerWinform
newemp = new FullTimeEmployee(); newemp = new FullTimeEmployee();
((FullTimeEmployee)newemp).Salary = (int)empSal.Value; ((FullTimeEmployee)newemp).Salary = (int)empSal.Value;
} }
else
{
errorProviderAdd.SetError(tipoemptitle, "Debe seleccionar un tipo de empleado para continuar");
}
if (newemp != null) if (newemp != null)
{ {
newemp.Name = empNom.Text; newemp.Name = empNom.Text;
...@@ -53,7 +58,14 @@ namespace PresentationLayerWinform ...@@ -53,7 +58,14 @@ namespace PresentationLayerWinform
} }
catch(Exception ex) catch(Exception ex)
{ {
if(ex is ArgumentNullException)
{
errorProviderAdd.SetError(empNom, ex.Message);
}
else
{
errorProviderAdd.SetError(addemptitle, "Un error inesperado ha ocurrido, por favor intente nuevamente");
}
} }
} }
...@@ -61,5 +73,21 @@ namespace PresentationLayerWinform ...@@ -61,5 +73,21 @@ namespace PresentationLayerWinform
{ {
this.Close(); this.Close();
} }
private void medioT_CheckedChanged(object sender, EventArgs e)
{
if (medioT.Checked)
{
LabelSal.Text = "Horas promedio de trabajo";
}
}
private void compT_CheckedChanged(object sender, EventArgs e)
{
if (compT.Checked)
{
LabelSal.Text = "Salario";
}
}
} }
} }
...@@ -117,4 +117,7 @@ ...@@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="errorProviderAdd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment