private void _clearStaffInfoPage()
 {
     EmpCodeTextBox.Text            = "";
     EmpFNameTextBox.Text           = "";
     EmpLNameTextBox.Text           = "";
     IDTypeComboBox.Text            = "";
     IDNumberTextBox.Text           = "";
     EmpBirthDayPicker.SelectedDate = null;
     EmpAddressTextBox.Text         = "";
     EmpHandPhone1TextBox.Text      = "";
     EmpHandPhone2TextBox.Text      = "";
     EmpRecedencePhoneTextBox.Text  = "";
     EmpEmailTextBox.Text           = "";
     EmpReligionTextBox.Text        = "";
     EmpCivilStateTextBox.Text      = "";
     EmpNationalityTextBox.Text     = "";
     ImageHandller.setProfImage(null, ProfPicBox);
     AccountTypeComboBox.Text = "";
     PasswordTextBox.Password = "";
     UserNameTextBox.Text     = "";
 }
        public void SetEmployeeDetails(employee employee)
        {
            try
            {
                //employee.EMP_ID = employee.ID.ToString();
                //EmpFNameTextBox.Text=employee.FIRST_NAME;
                //EmpLNameTextBox.Text=employee.LAST_NAME;
                GridStaffInfo.DataContext = employee;

                if (employee.ID_TYPE != null)
                {
                    string ID_TYPE = employee.ID_TYPE;
                    if (ID_TYPE == "nic")
                    {
                        IDTypeComboBox.SelectedIndex = 0;
                    }
                    else if (ID_TYPE == "dl")
                    {
                        IDTypeComboBox.SelectedIndex = 2;
                    }
                    else if (ID_TYPE == "pp")
                    {
                        IDTypeComboBox.SelectedIndex = 1;
                    }
                }

                IDNumberTextBox.Text           = employee.ID_NUM;
                EmpBirthDayPicker.SelectedDate = employee.DOB;
                setGender(employee.GENDER);

                //EmpAddressTextBox.Text = employee.ADDRESS;
                EmpHandPhone1TextBox.Text     = employee.PHONE_HP1;
                EmpHandPhone2TextBox.Text     = employee.PHONE_HP2;
                EmpRecedencePhoneTextBox.Text = employee.PHONE_RECIDENCE;
                EmpEmailTextBox.Text          = employee.EMAIL;

                EmpReligionTextBox.Text    = employee.RELIGION;
                EmpCivilStateTextBox.Text  = employee.CIVIL_STATUS;
                EmpNationalityTextBox.Text = employee.NATIONALITY;

                _imageData = employee.PROFPIC;
                ImageHandller.setProfImage(_imageData, ProfPicBox);

                if (employee.ACCOUNT_TYPE != null)
                {
                    string ACCOUNT_TYPE = employee.ACCOUNT_TYPE;
                    if (ACCOUNT_TYPE == "admin")
                    {
                        AccountTypeComboBox.SelectedIndex = 0;
                    }
                    else if (ACCOUNT_TYPE == "staff")
                    {
                        AccountTypeComboBox.SelectedIndex = 1;
                    }
                    else if (ACCOUNT_TYPE == "other")
                    {
                        AccountTypeComboBox.SelectedIndex = 2;
                    }
                }
                PasswordTextBox.Password = employee.PASSWORD;
                UserNameTextBox.Text     = employee.USERNAME;

                employee.ISRESIGN = false;

                employee.STATUS          = true;
                employee.INSERT_DATETIME = DateTime.Now;
                employee.INSERT_USER_ID  = Session.LoggedEmployee.ID;
                employee.UPDATE_DATETIME = DateTime.Now;
                employee.UPDATE_USER_ID  = Session.LoggedEmployee.ID;
            }
            catch (Exception)
            {
                //MessageBox.Show("Error");
            }
        }