예제 #1
0
        /// <summary>
        /// Метод закрытия счета
        /// </summary>
        /// <param name="o"></param>
        private void CloseAccount(object o)
        {
            string message = string.Empty;

            if (!SelectedDepartment.CloseAccount(SelectedAccount, out message))
            {
                MessageBox.Show(message);
            }
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
 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);
 }
예제 #7
0
 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";
 }
예제 #8
0
 /// <summary>
 /// Метод добавления нового клиента
 /// </summary>
 /// <param name="o"></param>
 private void AddClient(object o)
 {
     SelectedDepartment.AddClient(Clients);
     NotifyPropertyChanged(nameof(Clients));
 }