Commit a9ccbf1b authored by Fedepa's avatar Fedepa
Browse files

pantalla add completa

parent d5e5d97c
Pipeline #186 skipped
......@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.Badd1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.empNom = new System.Windows.Forms.TextBox();
......@@ -35,16 +36,19 @@
this.compT = new System.Windows.Forms.RadioButton();
this.empDate = new System.Windows.Forms.DateTimePicker();
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.LabelSal = new System.Windows.Forms.Label();
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.errorProviderAdd)).BeginInit();
this.SuspendLayout();
//
// 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.Size = new System.Drawing.Size(75, 23);
this.Badd1.TabIndex = 0;
......@@ -55,7 +59,7 @@
// label1
//
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.Size = new System.Drawing.Size(44, 13);
this.label1.TabIndex = 1;
......@@ -63,7 +67,7 @@
//
// 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.Size = new System.Drawing.Size(200, 20);
this.empNom.TabIndex = 2;
......@@ -71,28 +75,30 @@
// medioT
//
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.Size = new System.Drawing.Size(85, 17);
this.medioT.TabIndex = 4;
this.medioT.TabStop = true;
this.medioT.Text = "Medio Turno";
this.medioT.UseVisualStyleBackColor = true;
this.medioT.CheckedChanged += new System.EventHandler(this.medioT_CheckedChanged);
//
// compT
//
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.Size = new System.Drawing.Size(100, 17);
this.compT.TabIndex = 5;
this.compT.TabStop = true;
this.compT.Text = "Turno Completo";
this.compT.UseVisualStyleBackColor = true;
this.compT.CheckedChanged += new System.EventHandler(this.compT_CheckedChanged);
//
// 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.Size = new System.Drawing.Size(200, 20);
this.empDate.TabIndex = 6;
......@@ -100,24 +106,24 @@
// label2
//
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.Size = new System.Drawing.Size(90, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Fecha de Ingreso";
//
// label3
// tipoemptitle
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(33, 111);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(92, 13);
this.label3.TabIndex = 8;
this.label3.Text = "Tipo de empleado";
this.tipoemptitle.AutoSize = true;
this.tipoemptitle.Location = new System.Drawing.Point(26, 124);
this.tipoemptitle.Name = "tipoemptitle";
this.tipoemptitle.Size = new System.Drawing.Size(92, 13);
this.tipoemptitle.TabIndex = 8;
this.tipoemptitle.Text = "Tipo de empleado";
//
// 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.Size = new System.Drawing.Size(120, 20);
this.empSal.TabIndex = 9;
......@@ -125,7 +131,7 @@
// LabelSal
//
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.Size = new System.Drawing.Size(39, 13);
this.LabelSal.TabIndex = 10;
......@@ -133,7 +139,7 @@
//
// 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.Size = new System.Drawing.Size(75, 23);
this.Bback.TabIndex = 11;
......@@ -141,15 +147,30 @@
this.Bback.UseVisualStyleBackColor = true;
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.addemptitle);
this.Controls.Add(this.Bback);
this.Controls.Add(this.LabelSal);
this.Controls.Add(this.empSal);
this.Controls.Add(this.label3);
this.Controls.Add(this.tipoemptitle);
this.Controls.Add(this.label2);
this.Controls.Add(this.empDate);
this.Controls.Add(this.compT);
......@@ -161,6 +182,7 @@
this.Text = "EmployeeAddEdit";
this.Load += new System.EventHandler(this.EmployeeAddEdit_Load);
((System.ComponentModel.ISupportInitialize)(this.empSal)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProviderAdd)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -174,10 +196,12 @@
private System.Windows.Forms.RadioButton compT;
private System.Windows.Forms.DateTimePicker empDate;
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.Label LabelSal;
private System.Windows.Forms.Label label1;
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
private void button1_Click(object sender, EventArgs e)
{
Employee newemp = null;
errorProviderAdd.Clear();
try {
if (medioT.Checked) {
newemp = new PartTimeEmployee();
......@@ -40,6 +41,10 @@ namespace PresentationLayerWinform
newemp = new FullTimeEmployee();
((FullTimeEmployee)newemp).Salary = (int)empSal.Value;
}
else
{
errorProviderAdd.SetError(tipoemptitle, "Debe seleccionar un tipo de empleado para continuar");
}
if (newemp != null)
{
newemp.Name = empNom.Text;
......@@ -53,7 +58,14 @@ namespace PresentationLayerWinform
}
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
{
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 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</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>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment