Work on Chel
This commit is contained in:
266
SupportForms/WorkChelForm.Designer.cs
generated
266
SupportForms/WorkChelForm.Designer.cs
generated
@@ -29,40 +29,52 @@ namespace Diplom_O.SupportForms
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.doljBox = new System.Windows.Forms.TextBox();
|
||||
this.kolvoBox = new System.Windows.Forms.TextBox();
|
||||
this.fNameBox = new System.Windows.Forms.TextBox();
|
||||
this.sNameBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.errorLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.workButton = new System.Windows.Forms.Button();
|
||||
this.canceledButton = new System.Windows.Forms.Button();
|
||||
this.busySizeLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tNameBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.addressBox = new System.Windows.Forms.RichTextBox();
|
||||
this.pasportBox = new System.Windows.Forms.RichTextBox();
|
||||
this.maleBox = new System.Windows.Forms.ComboBox();
|
||||
this.birthdayBox = new System.Windows.Forms.DateTimePicker();
|
||||
this.snilsBox = new System.Windows.Forms.MaskedTextBox();
|
||||
this.innBox = new System.Windows.Forms.MaskedTextBox();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// doljBox
|
||||
// fNameBox
|
||||
//
|
||||
this.doljBox.Location = new System.Drawing.Point(87, 12);
|
||||
this.doljBox.Name = "doljBox";
|
||||
this.doljBox.Size = new System.Drawing.Size(162, 20);
|
||||
this.doljBox.TabIndex = 0;
|
||||
this.fNameBox.Location = new System.Drawing.Point(104, 12);
|
||||
this.fNameBox.Name = "fNameBox";
|
||||
this.fNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.fNameBox.TabIndex = 0;
|
||||
//
|
||||
// kolvoBox
|
||||
// sNameBox
|
||||
//
|
||||
this.kolvoBox.Location = new System.Drawing.Point(87, 38);
|
||||
this.kolvoBox.Name = "kolvoBox";
|
||||
this.kolvoBox.Size = new System.Drawing.Size(162, 20);
|
||||
this.kolvoBox.TabIndex = 1;
|
||||
this.sNameBox.Location = new System.Drawing.Point(104, 38);
|
||||
this.sNameBox.Name = "sNameBox";
|
||||
this.sNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.sNameBox.TabIndex = 1;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.errorLabel,
|
||||
this.busySizeLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 90);
|
||||
this.errorLabel});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 428);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(262, 22);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(332, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
@@ -75,27 +87,9 @@ namespace Diplom_O.SupportForms
|
||||
this.errorLabel.Text = "Ошибка.";
|
||||
this.errorLabel.Visible = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(16, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(65, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Должность";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(69, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Кол-во мест";
|
||||
//
|
||||
// workButton
|
||||
//
|
||||
this.workButton.Location = new System.Drawing.Point(175, 64);
|
||||
this.workButton.Location = new System.Drawing.Point(245, 402);
|
||||
this.workButton.Name = "workButton";
|
||||
this.workButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.workButton.TabIndex = 5;
|
||||
@@ -105,7 +99,7 @@ namespace Diplom_O.SupportForms
|
||||
//
|
||||
// canceledButton
|
||||
//
|
||||
this.canceledButton.Location = new System.Drawing.Point(94, 64);
|
||||
this.canceledButton.Location = new System.Drawing.Point(164, 402);
|
||||
this.canceledButton.Name = "canceledButton";
|
||||
this.canceledButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.canceledButton.TabIndex = 6;
|
||||
@@ -113,29 +107,176 @@ namespace Diplom_O.SupportForms
|
||||
this.canceledButton.UseVisualStyleBackColor = true;
|
||||
this.canceledButton.Click += new System.EventHandler(this.canceledButton_Click);
|
||||
//
|
||||
// busySizeLabel
|
||||
// tNameBox
|
||||
//
|
||||
this.busySizeLabel.Name = "busySizeLabel";
|
||||
this.busySizeLabel.Size = new System.Drawing.Size(51, 17);
|
||||
this.busySizeLabel.Text = "Занято: ";
|
||||
this.busySizeLabel.Visible = false;
|
||||
this.tNameBox.Location = new System.Drawing.Point(104, 64);
|
||||
this.tNameBox.Name = "tNameBox";
|
||||
this.tNameBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.tNameBox.TabIndex = 7;
|
||||
//
|
||||
// WorkShtatForm
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(42, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(56, 13);
|
||||
this.label1.TabIndex = 29;
|
||||
this.label1.Text = "Фамилия";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(69, 41);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(29, 13);
|
||||
this.label2.TabIndex = 30;
|
||||
this.label2.Text = "Имя";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(44, 67);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(54, 13);
|
||||
this.label3.TabIndex = 31;
|
||||
this.label3.Text = "Отчетсво";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(71, 93);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(27, 13);
|
||||
this.label4.TabIndex = 32;
|
||||
this.label4.Text = "Пол";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(12, 119);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(86, 13);
|
||||
this.label5.TabIndex = 33;
|
||||
this.label5.Text = "Дата рождения";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(12, 145);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(38, 13);
|
||||
this.label6.TabIndex = 34;
|
||||
this.label6.Text = "Адрес";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(12, 249);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(31, 13);
|
||||
this.label7.TabIndex = 35;
|
||||
this.label7.Text = "ИНН";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(12, 275);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(45, 13);
|
||||
this.label8.TabIndex = 36;
|
||||
this.label8.Text = "СНИЛС";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(12, 301);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(50, 13);
|
||||
this.label9.TabIndex = 37;
|
||||
this.label9.Text = "Паспорт";
|
||||
//
|
||||
// addressBox
|
||||
//
|
||||
this.addressBox.Location = new System.Drawing.Point(104, 142);
|
||||
this.addressBox.Name = "addressBox";
|
||||
this.addressBox.Size = new System.Drawing.Size(216, 98);
|
||||
this.addressBox.TabIndex = 38;
|
||||
this.addressBox.Text = "";
|
||||
//
|
||||
// pasportBox
|
||||
//
|
||||
this.pasportBox.Location = new System.Drawing.Point(104, 298);
|
||||
this.pasportBox.Name = "pasportBox";
|
||||
this.pasportBox.Size = new System.Drawing.Size(216, 98);
|
||||
this.pasportBox.TabIndex = 39;
|
||||
this.pasportBox.Text = "";
|
||||
//
|
||||
// maleBox
|
||||
//
|
||||
this.maleBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.maleBox.FormattingEnabled = true;
|
||||
this.maleBox.Items.AddRange(new object[] {
|
||||
"Мужчина",
|
||||
"Женщина"});
|
||||
this.maleBox.Location = new System.Drawing.Point(104, 90);
|
||||
this.maleBox.Name = "maleBox";
|
||||
this.maleBox.Size = new System.Drawing.Size(216, 21);
|
||||
this.maleBox.TabIndex = 40;
|
||||
//
|
||||
// birthdayBox
|
||||
//
|
||||
this.birthdayBox.CustomFormat = "yyyy.MM.dd";
|
||||
this.birthdayBox.Location = new System.Drawing.Point(104, 116);
|
||||
this.birthdayBox.Name = "birthdayBox";
|
||||
this.birthdayBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.birthdayBox.TabIndex = 41;
|
||||
//
|
||||
// snilsBox
|
||||
//
|
||||
this.snilsBox.Location = new System.Drawing.Point(104, 272);
|
||||
this.snilsBox.Mask = "000-000-000 00";
|
||||
this.snilsBox.Name = "snilsBox";
|
||||
this.snilsBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.snilsBox.TabIndex = 42;
|
||||
//
|
||||
// innBox
|
||||
//
|
||||
this.innBox.Location = new System.Drawing.Point(104, 246);
|
||||
this.innBox.Mask = "000000000000";
|
||||
this.innBox.Name = "innBox";
|
||||
this.innBox.Size = new System.Drawing.Size(216, 20);
|
||||
this.innBox.TabIndex = 43;
|
||||
//
|
||||
// WorkChelForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(262, 112);
|
||||
this.ClientSize = new System.Drawing.Size(332, 450);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.innBox);
|
||||
this.Controls.Add(this.snilsBox);
|
||||
this.Controls.Add(this.birthdayBox);
|
||||
this.Controls.Add(this.maleBox);
|
||||
this.Controls.Add(this.pasportBox);
|
||||
this.Controls.Add(this.addressBox);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.tNameBox);
|
||||
this.Controls.Add(this.canceledButton);
|
||||
this.Controls.Add(this.workButton);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.kolvoBox);
|
||||
this.Controls.Add(this.doljBox);
|
||||
this.Controls.Add(this.sNameBox);
|
||||
this.Controls.Add(this.fNameBox);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "WorkShtatForm";
|
||||
this.Name = "WorkChelForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Штатное место";
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
@@ -147,14 +288,27 @@ namespace Diplom_O.SupportForms
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox doljBox;
|
||||
private System.Windows.Forms.TextBox kolvoBox;
|
||||
private System.Windows.Forms.TextBox fNameBox;
|
||||
private System.Windows.Forms.TextBox sNameBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel errorLabel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button workButton;
|
||||
private System.Windows.Forms.Button canceledButton;
|
||||
private System.Windows.Forms.ToolStripStatusLabel busySizeLabel;
|
||||
private System.Windows.Forms.TextBox tNameBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.RichTextBox addressBox;
|
||||
private System.Windows.Forms.RichTextBox pasportBox;
|
||||
private System.Windows.Forms.ComboBox maleBox;
|
||||
private System.Windows.Forms.DateTimePicker birthdayBox;
|
||||
private System.Windows.Forms.MaskedTextBox snilsBox;
|
||||
private System.Windows.Forms.MaskedTextBox innBox;
|
||||
}
|
||||
}
|
@@ -34,15 +34,23 @@ namespace Diplom_O.SupportForms
|
||||
public WorkChelForm(Chel chel = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
maleBox.SelectedIndex = 0;
|
||||
birthdayBox.Value = DateTime.Now;
|
||||
try
|
||||
{
|
||||
if (shtat != null)
|
||||
if (chel != null)
|
||||
{
|
||||
this.shtat = shtat;
|
||||
this.chel = chel;
|
||||
workButton.Text = "Изменить";
|
||||
doljBox.Text = shtat.Doljnost;
|
||||
kolvoBox.Text = shtat.Size.ToString();
|
||||
busySizeLabel.Text = "Занято: " + FuncDB.BusySizeShtat(shtat.Id);
|
||||
fNameBox.Text = chel.FName;
|
||||
sNameBox.Text = chel.SName;
|
||||
tNameBox.Text = chel.TName;
|
||||
maleBox.SelectedIndex = chel.Male ? 0 : 1;
|
||||
birthdayBox.Value = chel.Birthday;
|
||||
addressBox.Text = chel.Address;
|
||||
innBox.Text = chel.INN;
|
||||
snilsBox.Text = chel.SNILS;
|
||||
pasportBox.Text = chel.Pasport;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -56,17 +64,35 @@ namespace Diplom_O.SupportForms
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!int.TryParse(kolvoBox.Text, out int kolvo)) throw new Exception("Ошибка указания количества.");
|
||||
if (shtat == null)
|
||||
if (maleBox.SelectedIndex == -1) throw new Exception("Пол не указан.");
|
||||
if (chel == null)
|
||||
{
|
||||
var s = new Shtat() { Doljnost = doljBox.Text, Size = kolvo };
|
||||
FuncDB.AddShtat(s);
|
||||
var s = new Chel()
|
||||
{
|
||||
FName = fNameBox.Text,
|
||||
SName = sNameBox.Text,
|
||||
TName = tNameBox.Text,
|
||||
Male = maleBox.SelectedIndex == 0,
|
||||
Birthday = birthdayBox.Value,
|
||||
Address = addressBox.Text,
|
||||
INN = innBox.Text,
|
||||
SNILS = snilsBox.Text,
|
||||
Pasport = pasportBox.Text
|
||||
};
|
||||
FuncDB.AddChel(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
shtat.Doljnost = doljBox.Text;
|
||||
shtat.Size = kolvo;
|
||||
FuncDB.ChangeShtat(shtat);
|
||||
chel.FName = fNameBox.Text;
|
||||
chel.SName = sNameBox.Text;
|
||||
chel.TName = tNameBox.Text;
|
||||
chel.Male = maleBox.SelectedIndex == 0;
|
||||
chel.Birthday = birthdayBox.Value;
|
||||
chel.Address = addressBox.Text;
|
||||
chel.INN = innBox.Text;
|
||||
chel.SNILS = snilsBox.Text;
|
||||
chel.Pasport = pasportBox.Text;
|
||||
FuncDB.ChangeChel(chel);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user