private void btnEdit_Click(object sender, EventArgs e) { EditEmployeeForm editAccount = new EditEmployeeForm(connectedEmployee, employee); editAccount.Show(); this.Hide(); }
private void DataGridEmployees_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (dataGridEmployees.CurrentCell != null) { var editEmployeeFrm = new EditEmployeeForm(this, dataGridEmployees); editEmployeeFrm.ShowDialog(); } }
private void EditEmployeeBtn_Click(object sender, EventArgs e) { if (dataGridEmployees.CurrentCell != null) { var editEmployeeFrm = new EditEmployeeForm(this, dataGridEmployees); editEmployeeFrm.ShowDialog(); } }
private void EmployeeTable_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { using (var context = new PineappleContext()) { EditEmployeeForm editClientForm = new EditEmployeeForm(Convert.ToInt32(EmployeeTable.SelectedRows[0].Cells[0].Value)); editClientForm.ShowDialog(); } }
public IActionResult Edit(Guid id, EditEmployeeForm editEmployeeForm) { var employee = Mediator.Send <EditEmployee, EmployeeDto>(new EditEmployee() { Id = id, EditEmployeeForm = editEmployeeForm }); return(Ok(employee)); }
private void btnAdd_Click(object sender, EventArgs e) { var emp = new Employee(); var dialogResult = new EditEmployeeForm(emp).ShowDialog(); if (dialogResult == DialogResult.OK) { _empService.Add(emp); MetroMessageBox.Show(this, $"Пользователь {emp.Login} успешно создан", "Справка", MessageBoxButtons.OK, MessageBoxIcon.Information); UpdateDataGrid(); UpdateCounter(); } }
private void updateemployee_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows == null || this.dataGridView1.SelectedRows.Count == 0) { return; } EditEmployeeForm form = new EditEmployeeForm(); form.employee = list[dataGridView1.CurrentRow.Index]; DialogResult dr = form.ShowDialog(); if (dr == DialogResult.OK) { refresh(); } }
private void btnEdit_Click(object sender, EventArgs e) { var emp = _empService.Find(Convert.ToInt32(dataGrid.SelectedRows[0].Cells[0].Value)); if (emp != null) { var dialogResult = new EditEmployeeForm(emp).ShowDialog(); if (dialogResult == DialogResult.OK) { _empService.Update(emp); MetroMessageBox.Show(this, $"Пользователь {emp.Login} изменен", "Справка", MessageBoxButtons.OK, MessageBoxIcon.Information); UpdateDataGrid(); } } }
public IActionResult Edit(int id) { if (!RoleIs(Role.Administrator)) { return(Forbid()); } Employee employee = _employeeService.GetById(id); EditEmployeeForm form = _mapper.Map <EditEmployeeForm>(employee); var departments = _departmentService.AllActive(); form.Departments = GetDepartmentsItems(departments, form.DepartmentId); return(View(form)); }
public IActionResult Edit(EditEmployeeForm form) { if (!RoleIs(Role.Administrator)) { return(Forbid()); } return(Form( form, () => this.RedirectToAction(c => c.View(form.Id)), () => { var departments = _departmentService.AllActive(); form.Departments = GetDepartmentsItems(departments, form.DepartmentId); return View(form); })); }