Пример #1
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     Form1AddEdit.Mode        = FormMode.Add;
     form1AddEdit             = new Form1AddEdit();
     form1AddEdit.FormClosed += new FormClosedEventHandler(formGrid);
     form1AddEdit.Show();
 }
Пример #2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            var currentEmployee = Employees.Find(zx => zx.EmployeeId == this.idText.Text);

            Form1AddEdit.CurrentEmployee = currentEmployee;
            if (currentEmployee is FixedTimeEmployee)
            {
                Form1AddEdit.Mode = FormMode.EditFixPrice;
            }
            else
            if (currentEmployee is ByTimeEmployee)
            {
                Form1AddEdit.Mode = FormMode.EditCalcPrice;
            }

            if (currentEmployee != null)
            {
                form1AddEdit             = new Form1AddEdit();
                form1AddEdit.FormClosed += new FormClosedEventHandler(formGrid);
                form1AddEdit.Show();
            }
        }