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(); } }
partial void DeleteEmployee(Employee instance);
partial void UpdateEmployee(Employee instance);
partial void InsertEmployee(Employee instance);