public Fire_Employee()
 {
     InitializeComponent();
     control_object          = new Doctor_controller();
     control_obj             = new Storage_controller();
     dt                      = control_object.get_employees();
     comboBox1.DataSource    = dt;
     comboBox1.DisplayMember = "Name";
     comboBox1.ValueMember   = "User_name";
 }
        public Choose_employee(Employee_choice c)
        {
            InitializeComponent();
            control_oject = new Doctor_controller();
            choice2       = new Choose_employee_factory();
            DataTable dt = control_oject.get_employees();

            comboBox1.DataSource    = dt;
            comboBox1.DisplayMember = "Name";
            comboBox1.ValueMember   = "User_name";
            choice = c;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(comboBox1.SelectedValue) / 1000 == 13)
            {
                int check2 = control_obj.set_storage_man(Convert.ToInt32(comboBox1.SelectedValue));
            }
            int check = control_object.fire_employee(Convert.ToInt32(comboBox1.SelectedValue));

            if (check > 0)
            {
                MessageBox.Show("Emloyee is fired successfully");
                dt = control_object.get_employees();
                comboBox1.DataSource    = dt;
                comboBox1.DisplayMember = "Name";
                comboBox1.ValueMember   = "User_name";
            }
            else
            {
                MessageBox.Show("Error!Cannot delete");
            }
        }