private void DeleteAClietnFromDB(AClient client)
 {
     if (client is Client)
     {
         BankDB.DeleteClient(connectionStringBuilder, (Client)client);
     }
     else if (client is Entity)
     {
         BankDB.DeleteEntity(connectionStringBuilder, (Entity)client);
     }
 }
        public void DeleteEmployee(Employee employee)
        {
            BankDB.DeleteEmployee(connectionStringBuilder, employee);
            var dep = employee.Departament;

            if (dep is Departament)
            {
                SimpleDepartament.RemoveEmployee(employee);
            }
            else if (dep is VIPDepartament)
            {
                VipDepartament.RemoveEmployee(employee);
            }
            else if (dep is LegalDepartament)
            {
                EntityDepartament.RemoveEmployee(employee);
            }

            Employees.Remove(employee);
        }
        public void DeleteEmployee(Employee employee, TreeView tv)
        {
            BankDB.DeleteEmployee(connectionStringBuilder, employee);
            var dep = employee.Departament;


            if (dep is Departament)
            {
                SimpleDepartament.RemoveEmployee(employee);
                (tv.Items[0] as TreeViewItem).ItemsSource = SimpleDepartament.Employees;
            }
            else if (dep is VIPDepartament)
            {
                VipDepartament.RemoveEmployee(employee);
                (tv.Items[1] as TreeViewItem).ItemsSource = VipDepartament.Employees;
            }
            else if (dep is LegalDepartament)
            {
                EntityDepartament.RemoveEmployee(employee);
                (tv.Items[2] as TreeViewItem).ItemsSource = EntityDepartament.Employees;
            }

            Employees.Remove(employee);
        }
 public void CloseDeposit(Deposit deposit)
 {
     BankDB.DeleteDeposit(connectionStringBuilder, deposit);
     Deposits.Remove(deposit);
 }
 public void CloseCredit(Credit credit)
 {
     BankDB.DeleteCredit(connectionStringBuilder, credit);
     Credits.Remove(credit);
 }
 public void UpdateAllData()
 {
     BankDB.UpdateAll(connectionStringBuilder, this);
 }