コード例 #1
0
        private void addButton_Click(object sender, RoutedEventArgs e)
        {
            int branch;
            int bank_n;

            try
            {
                BANK.city       = cityComboBox.SelectedItem.ToString();
                BANK.bankName   = bankNameComboBox.SelectedItem.ToString();
                BANK.adressBank = adressBankComboBox.SelectedItem.ToString();
                int.TryParse(branchBankComboBox.SelectedItem.ToString(), out branch);
                int.TryParse(banknum.Text, out bank_n);
                BANK.branchBank      = branch;
                BANK.bankNum         = 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);
            }
        }
コード例 #2
0
        private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)//update
        {
            int ID;

            int.TryParse(comboBox.SelectedItem.ToString(), out ID);
            employee         = bl.return_emploee(ID);
            this.DataContext = employee;
            showDataGridView();
        }
コード例 #3
0
        public ADD_EMPLOYEE(BL.IBL Bl)
        {
            this.bl = Bl;
            InitializeComponent();
            employee         = new BE.Employee();
            this.DataContext = employee;

            bl = BL.FactoryBL.GetBL();
            showDataGridView();
        }
コード例 #4
0
 public ADD_EMPLOYEE(BL.IBL Bl)//ctor
 {
     this.bl = Bl;
     InitializeComponent();
     employee         = new BE.Employee();
     BANK             = new bank();
     this.DataContext = employee;
     bl = BL.FactoryBL.GetBL();
     showDataGridView();
     this.degreeComboBox.ItemsSource = Enum.GetValues(typeof(BE.Degree));
     comboboxyeshouv();
 }
コード例 #5
0
ファイル: Dal_imp.cs プロジェクト: elisheva100/DotNetProject
 public void deleteEmployee(BE.Employee e)
 {
     if (getEmployee(e.Id) == null)
     {
         throw new Exception("ERROR :this employee doesn't exist");
     }
     else
     {
         DataSources.employeeList.Remove(e);
     }
     return;
 }
コード例 #6
0
 private void addButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         bl.addEmployee(employee);
         employee         = new BE.Employee();
         this.DataContext = employee;
         showDataGridView();
     }
     catch (Exception ex)
     {
         showDataGridView();
         MessageBox.Show(ex.Message);
     }
 }
コード例 #7
0
        public update_Employee(BL.IBL Bl)//ctor
        {
            this.bl = Bl;
            InitializeComponent();
            employee         = new BE.Employee();
            BANK             = new bank();
            this.DataContext = employee;

            bl = BL.FactoryBL.GetBL();
            showDataGridView();
            foreach (int id in bl.return_names_id_employee())
            {
                comboBox.Items.Add(id);
            }
            this.degreeComboBox.ItemsSource = Enum.GetValues(typeof(BE.Degree));
            comboboxyeshouv();
        }
コード例 #8
0
ファイル: DAL_IMP_XML.cs プロジェクト: sbenebrh/C--project
        private XElement ConvertEmployee(BE.Employee employee)//convert objet employee in XELEMENT
        {
            XElement newemployee = new XElement("employee",
                                                new XElement("lastname", employee.lastName),
                                                new XElement("firstname", employee.firstName),
                                                new XElement("birthdate", employee.birthDate),
                                                new XElement("age", employee.age),
                                                new XElement("ID", employee.ID),
                                                new XElement("phone", employee.phone),
                                                new XElement("degree", employee.degree),
                                                new XElement("CODE-BANK", employee.bankdetails.bankNum),
                                                new XElement("NAME-BANK", employee.bankdetails.bankName),
                                                new XElement("CITY", employee.bankdetails.city),
                                                new XElement("CODE-SNIF", employee.bankdetails.branchBank),
                                                new XElement("ADDRESS-ATM", employee.bankdetails.adressBank)
                                                );

            return(newemployee);
        }
コード例 #9
0
        private void addButton_Click(object sender, RoutedEventArgs e)//update
        {
            int      ID;
            int      branch;
            int      bank_n;
            DateTime d         = DateTime.Today;
            DateTime birth_day = employee.birthDate;
            TimeSpan Age       = d - birth_day;
            int      a         = Age.Days / 365;

            try
            {
                employee.age = a;
                if (employee.age < 18)
                {
                    throw new Exception("not possibility to add employee Under 18 years");
                }
                int.TryParse(comboBox.SelectedItem.ToString(), out ID);
                BANK.city       = cityComboBox.SelectedItem.ToString();
                BANK.bankName   = bankNameComboBox.SelectedItem.ToString();
                BANK.adressBank = adressBankComboBox.SelectedItem.ToString();
                int.TryParse(branchBankComboBox.SelectedItem.ToString(), out branch);
                int.TryParse(bankNumTextBox.Text, out bank_n);
                BANK.branchBank      = branch;
                BANK.bankNum         = bank_n;
                employee.bankdetails = BANK;
                employee.ID          = ID;
                bl.uptdateEmployee(employee);
                employee         = new BE.Employee();
                this.DataContext = employee;
                showDataGridView();
            }
            catch (Exception ex)
            {
                showDataGridView();
                MessageBox.Show(ex.Message);
            }
        }
コード例 #10
0
        private XElement ConvertEmployee(BE.Employee employee)
        {
            XElement newemployee = new XElement("employee",

                                                /*
                                                 *
                                                 * new XElement("birthdate", employee.birthDate),
                                                 * new XElement("ID", employee.ID),
                                                 * new XElement("phone", employee.phone),
                                                 * new XElement("adresse", employee.adress),
                                                 * new XElement("degree", employee.degree),
                                                 * new XElement("veteran", employee.veteran),
                                                 * new XElement("bankdetails", employee.bankdetails),
                                                 * new XElement("specialite", employee.specialite),
                                                 * new XElement("experience", employee.experience),
                                                 * new XElement("recommandatation", employee.recommendation),
                                                 * new XElement("mispar iskot", employee.mispar_iskote) ,*/


                                                new XElement("lastname", employee.lastName),
                                                new XElement("firstname", employee.firstName),
                                                new XElement("birthdate", employee.birthDate),
                                                new XElement("age", employee.age),
                                                new XElement("ID", employee.ID),
                                                new XElement("phone", employee.phone)
                                                //   new XElement("veteran", employee.veteran),
                                                //    new XElement("adresse", employee.adress),
                                                //    new XElement("degree", employee.degree),
                                                //    new XElement("bankdetails", employee.bankdetails),
                                                //    new XElement("specialite", employee.specialite),
                                                //    new XElement("experience", employee.experience)


                                                );

            return(newemployee);
        }
コード例 #11
0
ファイル: DAL_IMP_XML.cs プロジェクト: hchirit/Csharp.net
        private XElement ConvertEmployee(BE.Employee employee)
        {
            XElement newEmployee = new XElement("employee",
                                                new XElement("employeeID", employee.Id),
                                                new XElement("Lastname", employee.LastName),
                                                new XElement("Firstname", employee.FirstName),
                                                new XElement("adress", employee.Adress),
                                                new XElement("Phonenumber", employee.PhoneNumber),
                                                new XElement("BirthDate", employee.BirthDate),
                                                new XElement("IsdoArmy", employee.IsDoArmy),
                                                new XElement("CODE-BANK", employee.BankDetails.BankNumber),
                                                new XElement("NAME-BANK", employee.BankDetails.BankName),
                                                new XElement("CITY", employee.BankDetails.BranhCity),
                                                new XElement("CODE-SNIF", employee.BankDetails.BranchNumber),
                                                new XElement("ADDRESS-ATM", employee.BankDetails.BranchAdress),
                                                new XElement("specialities", employee.Specialities),
                                                new XElement("Age", employee.age),
                                                new XElement("Netsalary", employee.NetSalary),
                                                new XElement("Brutsalary", employee.BrutSalary),
                                                new XElement("degree", employee.degree)
                                                );

            return(newEmployee);
        }