private void add_Click(object sender, EventArgs e) { switch (item) { case 0: { addEditEmp = new ADD_EDIT_EMPLOYEE(emp, emp.AddEmp()); addEditEmp.Location = this.Location; addEditEmp.Size = this.Size; addEditEmp.Show(); } break; case 1: { addEditDish = new ADD_EDIT_DISH(emp, dish.AddDish()); addEditDish.Size = this.Size; addEditDish.Location = this.Location; addEditDish.Show(); this.Hide(); } break; case 2: { addEditstock = new ADD_EDIT_STOCK(emp, stock.AddStock()); addEditstock.Location = this.Location; addEditstock.Size = this.Size; addEditstock.Show(); this.Hide(); } break; } this.Hide(); }
private void edit_Click(object sender, EventArgs e) { if (selectList.SelectedCells.Count == 1) { int edit = 0; try { edit = (int)selectList.SelectedCells[0].OwningRow.Cells[0].Value; } catch { }; switch (item) { case 0: { addEditEmp = new ADD_EDIT_EMPLOYEE(emp, emp.Editemp(edit)); addEditEmp.Location = this.Location; addEditEmp.Size = this.Size; addEditEmp.Show(); this.Hide(); } break; case 1: { addEditDish = new ADD_EDIT_DISH(emp, dish.EditDish(edit)); addEditDish.Location = this.Location; addEditDish.Size = this.Size; addEditDish.Show(); this.Hide(); } break; case 2: { addEditstock = new ADD_EDIT_STOCK(emp, stock.EditStock(edit)); addEditstock.Location = this.Location; addEditstock.Size = this.Size; addEditstock.Show(); this.Hide(); } break; } } }