Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtEmployeeName.Text != string.Empty)
            {
                #region "                check Employee   existed or not               "

                Employee employee = cmd.GetEmployeeByName(txtEmployeeName.Text);
                if (employee != null)
                {
                    return;
                }


                #endregion ""
                // كمل الكود 
                // او
                // Start Save New Employee//
                _Operation.StartOperation(this);


                Employee tb = new Employee() { EmployeeName = txtEmployeeName .Text,Address=txtAddress.Text,
                                            Email=txtEmail.Text ,IdNumber=txtIDCard.Text,Phone=txtPhone.Text  };
                cmd.NewEmployee(tb);
                _Operation.EndOperation(this);

                MessageBox.Show("Saved ");
            }
        }
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (txtEmployeeName.Text != string.Empty)
     {
         Employee emp = new Employee()
         {
             EmployeeName = txtEmployeeName.Text,
             Address = txtAddress.Text,
             IdNumber = txtIDCard.Text,
             Phone = txtPhone.Text,
             Email = txtEmail.Text
         };
         cmd.EditEmployee(emp, TargetEmployee.Id);
         MessageBox.Show("تم التعديل");
         base.Close();
     }
 }
Ejemplo n.º 3
0
 partial void DeleteEmployee(Employee instance);
Ejemplo n.º 4
0
 partial void UpdateEmployee(Employee instance);
Ejemplo n.º 5
0
 partial void InsertEmployee(Employee instance);