private void ButtonEmployee_Click(object sender, EventArgs e)
{
int id = -1;
if (((DataRowView)salaryBindingSource.Current)["ID_Employee"].ToString() != "")
{
id = (int)(((DataRowView)salaryBindingSource.Current)["ID_Employee"]);
}
// id = FormEmployee.fd.ShowSelectForm(id);
try
{
id = FormEmployee.fd.ShowSelectForm(id);
if (id >= 0)
{
// MessageBox.Show(id.ToString());
((DataRowView)salaryBindingSource.Current)["ID_Employee"] = id;
salaryBindingSource.EndEdit();
standard_salaryTextBox1.Focus();
}
if (!(String.IsNullOrEmpty(iD_EmployeeTextBox1.Text)))
FIO();
}
catch (Exception err)
{
MessageBox.Show("Информация о данном сотруднике уже имеется в базе. Выберете другого", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
/* if (id >= 0)
{
MessageBox.Show(id.ToString());
((DataRowView)salaryBindingSource.Current)["ID_Employee"] = id;
salaryBindingSource.EndEdit();
standard_salaryTextBox1.Focus();
}*/
}