예제 #1
0
        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("تم الحفظ");

        }
예제 #2
0
		private void detach_Employees(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Account = null;
		}
예제 #3
0
		private void attach_Employees(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Account = this;
		}
예제 #4
0
 partial void DeleteEmployee(Employee instance);
예제 #5
0
 partial void UpdateEmployee(Employee instance);
예제 #6
0
 partial void InsertEmployee(Employee instance);