124
FormDialog.Path = ofdDialog.FileName;
FormDialog.FileName = ofdDialog.SafeFileName;
chStatement.Checked = true;
}
}
}
private void chStatement_Click(object sender, EventArgs e)
{
if (sender is CheckBox)
((CheckBox)sender).Checked = !((CheckBox)sender).Checked;
}
private void btAdd_Click(object sender, EventArgs e)
{
if (txtName.Text != "" && txtName.Text != "<Имя>" && txtSecondName.Text != "" &&
txtSecondName.Text != "<Отчество>" && txtSurname.Text != "<Фамилия>" &&
txtSurname.Text != "" &&
cbGender.Text != "" && txtEducation.Text != "" && txtEducation.Text !=
"<Образование>"
&& txtRub.Text != "" && txtKop.Text != "" &&
txtExperience.Text != "" && txtExperience.Text != "<Стаж>" && chStatement.Checked
&& txtPost.Text != "" && txtPost.Text != "<Должность>"&& chPhoto.Checked)
{
//try
//{
System.IO.File.Copy(FormDialog.Path, @"CoWorker_Statement_For_A_Job//" +
txtSurname.Text + "_" + dtpBirtday.Text + "_" +
Path.GetExtension(FormDialog.FileName));
string File = txtSurname.Text + "_" + dtpBirtday.Text + "_" +
Path.GetExtension(FormDialog.FileName);
System.IO.File.Copy(FormDialog.PathPhoto, @"Picture//CoWorkerPhoto//" +
txtSurname.Text + "_" + dtpBirtday.Text + "_" +
Path.GetExtension(FormDialog.FilePhoto));
string Photo = txtSurname.Text + "_" + dtpBirtday.Text + "_" +
Path.GetExtension(FormDialog.FilePhoto);
// GetTable.Get("INSERT INTO CoWorker ( Фамилия, Имя, Отчество, Пол, [Дата
рождения], Образование, Стаж , Оклад, Должность, [Дата принятия на работу],
Заявление) VALUES ( '" + txtSurname.Text + "', '" + txtName.Text + "', '" +
txtSecondName.Text + "','" + cbGender.Text + "', '" + dtpBirtday.Text.Replace('.',
'/') + "', '" + txtEducation.Text + "','" + txtExperience.Text + "', " + txtRub.Text
+ "," + txtKop.Text + ", '" + txtPost.Text + "', '" + dtpWork.Text.Replace('.', '/')
+ "', '" + File + "') ");
GetTable.Get("INSERT INTO CoWorker (Фамилия, Имя, Отчество, Пол, [Дата рождения],
Образование, Стаж, Оклад, Должность, [Дата принятия на работу], Заявление, Фото)
VALUES ('"+txtSurname.Text+"', '"+txtName.Text+"', '"+txtSecondName.Text+"'
,'"+cbGender.Text+"' ,
'"+dtpBirtday.Text.Replace('.','/')+"','"+txtEducation.Text+"',
'"+txtExperience.Text+"', '" + txtRub.Text + "," + txtKop.Text+"',
'"+txtPost.Text+"', '"+dtpWork.Text.Replace('.','/')+"', '"+File+"','"+Photo+"')");
GetTable.Get("INSERT INTO CoWorkerEducation ([Дата окончания], [Название учебного
заведения], [Полученое образование], Степень, [Номер диплома], [Дата выдачи диплома],
Специальность, Квалификация) VALUES ('" + FormDialog.EndType.Replace(".", "/") +
"','"