Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
G10TSI1
Practico1
Commits
a9ccbf1b
Commit
a9ccbf1b
authored
Apr 02, 2016
by
Fedepa
Browse files
pantalla add completa
parent
d5e5d97c
Pipeline
#186
skipped
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
PresentationLayerWinform/EmployeeAddEdit.Designer.cs
View file @
a9ccbf1b
...
...
@@ -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
,
2
16
);
this
.
Badd1
.
Location
=
new
System
.
Drawing
.
Point
(
158
,
2
27
);
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
,
1
28
);
this
.
medioT
.
Location
=
new
System
.
Drawing
.
Point
(
33
,
1
40
);
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
,
1
28
);
this
.
compT
.
Location
=
new
System
.
Drawing
.
Point
(
124
,
1
40
);
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
,
1
11
);
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
,
1
24
);
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
,
1
77
);
this
.
empSal
.
Location
=
new
System
.
Drawing
.
Point
(
33
,
1
89
);
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
,
1
61
);
this
.
LabelSal
.
Location
=
new
System
.
Drawing
.
Point
(
30
,
1
73
);
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
,
2
15
);
this
.
Bback
.
Location
=
new
System
.
Drawing
.
Point
(
36
,
2
27
);
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
PresentationLayerWinform/EmployeeAddEdit.cs
View file @
a9ccbf1b
...
...
@@ -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"
;
}
}
}
}
PresentationLayerWinform/EmployeeAddEdit.resx
View file @
a9ccbf1b
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment