private void btnSave_Click(object sender, EventArgs e) { #region " Check All Values First " // Your Code Here if (txtEmployeeName.Text == string.Empty) { MessageBox.Show("أدخل الاسم الان وبعدها يمكن لك التعديل او اكمال البيانات لاحقا"); return; } #endregion #region " Check Current Employee if exiseted or not " // Your Code Here Employee emp = cmd.GetEmployeeByName(txtEmployeeName.Text); if (emp != null) { MessageBox.Show(" موجود بالفعل "); ClearValues(); txtEmployeeName.Focus(); return; } #endregion if (txtSalary.Text == string.Empty) { txtSalary.Text = "0"; } #region " Save New Employee " Employee employee = new Employee() { EmployeeName = txtEmployeeName.Text, IdCard = txtIdCard.Text, Phone = txtPhone.Text, Mobile = txtMobile.Text, Address = txtAddress.Text, Email = txtEmail.Text, Salary = Convert.ToDouble(txtSalary.Text), Status = "Active" }; cmd = new EmployeeCmd(); cmd.NewEmployee(employee); #endregion MessageBox.Show("تم الحفظ"); }
private void detach_Employees(Employee entity) { this.SendPropertyChanging(); entity.Account = null; }
private void attach_Employees(Employee entity) { this.SendPropertyChanging(); entity.Account = this; }
partial void DeleteEmployee(Employee instance);
partial void UpdateEmployee(Employee instance);
partial void InsertEmployee(Employee instance);