private void button_Add(object sender, RoutedEventArgs e) { int branch; int bank_n; try { BANK.BranhCity = cityComboBox.SelectedItem.ToString(); BANK.BankName = bankNameComboBox.SelectedItem.ToString(); BANK.BranchAdress = adressBankComboBox.SelectedItem.ToString(); int.TryParse(branchBankComboBox.SelectedItem.ToString(), out branch); int.TryParse(banknum.Text, out bank_n); BANK.BranchNumber = branch; BANK.BankNumber = bank_n; employee.BankDetails = BANK; bl.addEmployee(employee); employee = new BE.Employee(); banknum.Text = null; branchBankComboBox.SelectedItem = null; adressBankComboBox.SelectedItem = null; bankNameComboBox.SelectedItem = null; cityComboBox.SelectedItem = null; this.DataContext = employee; showDataGridView(); } catch (Exception ex) { showDataGridView(); MessageBox.Show(ex.Message); } }
public AddEmployee() { InitializeComponent(); em = new BE.Employee(); this.EmployeeDetailsGrid.DataContext = em; bl = BL.factoryBL.getBL(); }
public allEmployee(BL.IBL Bl) { this.bl = Bl; InitializeComponent(); employee = new BE.Employee(); this.DataContext = employee; bl = BL.FactoryBL.GetBL(); showDataGridView(); }
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { int ID; int.TryParse(comboBox.SelectedItem.ToString(), out ID); employee = bl.return_emploee(ID); this.DataContext = employee; showDataGridView(); }
public UpdateEmployee(BL.IBL Bl) { this.bl = Bl; InitializeComponent(); employee = new BE.Employee(); this.DataContext = employee; this.degreeComboBox.ItemsSource = Enum.GetValues(typeof(BE.Degree)); bl = BL.FactoryBL.GetBL(); showDataGridView(); }
public update_Employee(BL.IBL Bl) { this.bl = Bl; InitializeComponent(); employee = new BE.Employee(); this.DataContext = employee; bl = BL.FactoryBL.GetBL(); // showDataGridView(); foreach (int id in bl.return_names_id_employee()) { comboBox.Items.Add(id); } }
public AddEmployee(BL.IBL Bl) { this.bl = Bl; InitializeComponent(); BANK = new BE.BankAccount(); employee = new BE.Employee(); this.DataContext = employee; bl = BL.FactoryBL.GetBL(); showDataGridView(); this.degreeComboBox.ItemsSource = Enum.GetValues(typeof(BE.Degree)); foreach (string id in bl.returnCity()) { cityComboBox.Items.Add(id); } }
private void button_Update(object sender, RoutedEventArgs e) { try { bl.updatingEmployee(employee); employee = new BE.Employee(); this.DataContext = employee; showDataGridView(); } catch (Exception ex) { showDataGridView(); MessageBox.Show(ex.Message); } }
private void ComEmplyeeID_SelectionChanged(object sender, SelectionChangedEventArgs e) { BE.Employee foundEmploye = Bl_Object.getEmployeeList().FirstOrDefault(x => x == (BE.Employee)ComEmplyeeID.SelectedItem); // if selected ID not found in DB, reset all fields in UIEmployee, thus resetting all controls in UI if (Equals(foundEmploye, null)) { Globals.CopyObject(new BE.Employee(), UIEmployee); } else // selection exists in DB { Globals.CopyObject(foundEmploye, UIEmployee); ComEmplyeeBranchNum.SelectedItem = Bl_Object.getBankList().Find(b => b.BankName == UIEmployee.bank.BankName && b.Branch == UIEmployee.bank.Branch); } }
private void addButton_Click(object sender, RoutedEventArgs e) { int ID; int.TryParse(comboBox.SelectedItem.ToString(), out ID); try { employee.ID = ID; bl.uptdateEmployee(employee); employee = new BE.Employee(); this.DataContext = employee; showDataGridView(); } catch (Exception ex) { showDataGridView(); MessageBox.Show(ex.Message); } }
private void addButton_Click(object sender, RoutedEventArgs e) { try { em.Id = (this.idTextBox.Text); em.lastName = this.nameTextBox.Text; bl.addEmployee(em); em = new BE.Employee(); this.idTextBox.ClearValue(TextBox.TextProperty); } catch (FormatException) { MessageBox.Show("check your input and try again"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void saveButton_Click(object sender, RoutedEventArgs e) { try { switch (EmployeeUC_State) { case State.createNew: BE.Employee addEmploye = new BE.Employee(); Globals.CopyObject(UIEmployee, addEmploye); Bl_Object.addEmployee(addEmploye); Employee_DS_Change_Event?.Invoke(); break; case State.modify: Bl_Object.updateEmployee(UIEmployee); Employee_DS_Change_Event?.Invoke(); break; } restoreRegButtonVisib(); EmployeeUC_State = State.view; } catch (Exception ex) { Globals.exceptionHandler(ex); } }