private void buttonStaffAdd_Click(object sender, EventArgs e) { var Form = new StaffEntityForm(); Form.sf = this; Form.Show(); }
private void buttonStaffEdit_Click(object sender, EventArgs e) { try { var sSId = dataGridViewStaff.SelectedCells[0].Value.ToString(); if (String.IsNullOrEmpty(sSId)) { throw new Exception("Не выбран сотрудник"); } var Form = new StaffEntityForm(); Form.StaffId = Int32.Parse(dataGridViewStaff.SelectedCells[0].Value.ToString()); Form.sf = this; Form.Show(); } catch (Exception gg) { MessageBox.Show(gg.Message, "SWA", MessageBoxButtons.OK, MessageBoxIcon.Error); } }