コード例 #1
0
ファイル: employeeUC.cs プロジェクト: logoffro1/ROSA
        private void btnEdit_Click(object sender, EventArgs e)
        {
            EditEmployeeForm editAccount = new EditEmployeeForm(connectedEmployee, employee);

            editAccount.Show();
            this.Hide();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: helsereet/helpDesk
 private void DataGridEmployees_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (dataGridEmployees.CurrentCell != null)
     {
         var editEmployeeFrm = new EditEmployeeForm(this, dataGridEmployees);
         editEmployeeFrm.ShowDialog();
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: helsereet/helpDesk
 private void EditEmployeeBtn_Click(object sender, EventArgs e)
 {
     if (dataGridEmployees.CurrentCell != null)
     {
         var editEmployeeFrm = new EditEmployeeForm(this, dataGridEmployees);
         editEmployeeFrm.ShowDialog();
     }
 }
コード例 #4
0
 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();
     }
 }
コード例 #5
0
        public IActionResult Edit(Guid id, EditEmployeeForm editEmployeeForm)
        {
            var employee = Mediator.Send <EditEmployee, EmployeeDto>(new EditEmployee()
            {
                Id = id,
                EditEmployeeForm = editEmployeeForm
            });

            return(Ok(employee));
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
        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();
            }
        }
コード例 #8
0
        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();
                }
            }
        }
コード例 #9
0
        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));
        }
コード例 #10
0
        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);
            }));
        }