/// <summary> /// Метод закрытия счета /// </summary> /// <param name="o"></param> private void CloseAccount(object o) { string message = string.Empty; if (!SelectedDepartment.CloseAccount(SelectedAccount, out message)) { MessageBox.Show(message); } }
/// <summary> /// Действия при смене департамента /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void SelectionChangeHandler(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(SelectedDepartment)) { SelectedDepartment.GetAccounts(Accounts, new NotifyCollectionChangedEventHandler(AccountsChanged), SelectedClient == null ? 0 : SelectedClient.ClientId); } if (e.PropertyName == nameof(SelectedClient) && SelectedClient != null) { SelectedDepartment.GetAccounts(Accounts, new NotifyCollectionChangedEventHandler(AccountsChanged), SelectedClient.ClientId); } }
/// <summary> /// Метод открытия счета /// </summary> /// <param name="o"></param> private void OpenAccount(object o) { try { SelectedDepartment.OpenAccount(SelectedClient); } catch (TransactionFailureException ex) { MessageBox.Show(ex.Info); } catch (Exception ex) { MessageBox.Show(ex.Message); } SelectedDepartment.GetAccounts(Accounts, new NotifyCollectionChangedEventHandler(AccountsChanged), SelectedClient == null ? 0 : SelectedClient.ClientId); }
public ActionResult Edit(int?id) { if (id != null) { if (db.Departments.Find(id) != null) { SelectedDepartment dep = new SelectedDepartment { Dep = db.Departments.Find(id), DepRoles = db.Roles.Where(r => r.DepartmentId == id).ToList(), Emp = db.Employees.Find(db.Departments.Find(id).Head) }; return(View(dep)); } } Session["DepError"] = "This employee is not exist"; return(RedirectToAction("index")); }
public void RemoveEmployee(string id) { SelectedDepartment.RemoveEmployee(id); }
public void AddEmployee(Employee newEmployee) { SelectedDepartment.AddEmployee(newEmployee); }
private void Filter() { Employees = (SelectedDepartment.Equals(TeamName.All) ? AllEmployees : new ObservableCollection <Models.Employee>(AllEmployees.Where(x => x.Team.Equals(SelectedDepartment)))); this.EmployeeGridTitle = SelectedDepartment == TeamName.All ? "All Employees" : $"{SelectedDepartment.ToString()} Team Employees"; }
/// <summary> /// Метод добавления нового клиента /// </summary> /// <param name="o"></param> private void AddClient(object o) { SelectedDepartment.AddClient(Clients); NotifyPropertyChanged(nameof(Clients)); }