Ejemplo n.º 1
0
 private void editBtnEmp_Click_1(object sender, EventArgs e)
 {
     // edit
     if (DGV_EmployeeHome.SelectedRows.Count == 0)
     {
         MessageBoxIcon.Warning.ToString();
         MessageBox.Show("يجب ان تختار موظف من الموظفين");
     }
     else
     {
         if (Txt_Ee.Visible == false)
         {
             Txt_Ee.Show();
         }
         if (Btn_SaveEmp.Visible == true)
         {
             Btn_SaveEmp.Hide();
         }
         UpdateBtnEmployee.Show();
         Btn_SaveEmp.Hide();
         p_id = int.Parse(DGV_EmployeeHome.SelectedRows[0].Cells[4].Value.ToString());
         var query = store.employee.FirstOrDefault(p => p.ID == p_id);
         EmployeeNamrTxt.Text       = query.EmployeeName;
         EmployeeAddressTxt.Text    = query.Address;
         EmployeePhoneTxt.Text      = query.Phone;
         EmployeeSalaryTxt.Text     = query.Salary.ToString();
         EmployeeNationalIDTxt.Text = query.NationalId;
     }
 }
Ejemplo n.º 2
0
 private void BtnAddEmp_Click_1(object sender, EventArgs e)
 {
     // add
     if (Txt_Ee.Visible == false)
     {
         Txt_Ee.Show();
     }
     if (Btn_SaveEmp.Visible == false)
     {
         Btn_SaveEmp.Show();
     }
     UpdateBtnEmployee.Hide();
     EmployeeAddressTxt.Text    = "";
     EmployeeNamrTxt.Text       = "";
     EmployeeSalaryTxt.Text     = "";
     EmployeeNationalIDTxt.Text = "";
     EmployeePhoneTxt.Text      = "";
 }