Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (!int.TryParse(ManagerExperience.Text, out int n))
            {
                return;
            }
            if (!int.TryParse(ManagerSalary.Text, out int t))
            {
                return;
            }
            if (!int.TryParse(ManagerDayOfHolidays.Text, out int l))
            {
                return;
            }
            Manager manager = new Manager(ManagerDepartment.Text, int.Parse(ManagerExperience.Text), int.Parse(ManagerSalary.Text), int.Parse(ManagerDayOfHolidays.Text),
                                          ManagerName.Text, int.Parse(ManagerYear.Text));

            ManagerName.Clear();
            ManagerYear.Clear();
            ManagerSalary.Clear();
            ManagerDayOfHolidays.Clear();
            ManagerExperience.Clear();
            ManagerDepartment.Clear();
            ManagerList.Add(manager);
            Managerdata.DataSource = null;
            Managerdata.DataSource = ManagerList;
        }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if ((ManagerName.Text != "") && (ManagerYear.Text != "") && (ManagerSalary.Text != "") && (ManagerDayOfHolidays.Text != "") &&
                (ManagerDepartment.Text != "") && (ManagerExperience.Text != ""))
            {
                Manager obj = new Manager(ManagerName.Text, int.Parse(ManagerYear.Text), int.Parse(ManagerSalary.Text), int.Parse(ManagerDayOfHolidays.Text),
                                          ManagerDepartment.Text, int.Parse(ManagerExperience.Text));


                Owner owner = new Owner(OwnerName.Text, int.Parse(OwnerYear.Text), int.Parse(OwnerBudget.Text), obj);
                OwnerName.Clear();
                OwnerYear.Clear();
                OwnerBudget.Clear();
                ManagerName.Clear();
                ManagerYear.Clear();
                ManagerSalary.Clear();
                ManagerDayOfHolidays.Clear();
                ManagerExperience.Clear();
                ManagerDepartment.Clear();
                OwnerList.Add(owner);
                Ownerdata.DataSource = null;
                Ownerdata.DataSource = OwnerList;
            }
            else
            {
                MessageBox.Show("Заполните поля manager ");
            }
        }