public employee GetEmployeeDetails()
        {
            try
            {
                employee employee = new employee();
                if (Session.SelectedEmployee != null)
                {
                    employee.ID = Session.SelectedEmployee.ID;
                }
                else
                {
                    employee.ID = IDHandller.generateID("employee");
                }
                employee.EMP_ID = EmpCodeTextBox.Text;
                employee.FIRST_NAME = EmpFNameTextBox.Text;
                employee.LAST_NAME = EmpLNameTextBox.Text;
                employee.ID_TYPE=setIDType(IDTypeComboBox.Text);
                employee.ID_NUM = IDNumberTextBox.Text;
                employee.DOB = Convert.ToDateTime(EmpBirthDayPicker.SelectedDate);                
                employee.GENDER = getGender();

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

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

                employee.PROFPIC = _imageData;

                employee.ACCOUNT_TYPE = AccountTypeComboBox.Text;
                employee.PASSWORD = PasswordTextBox.Password;
                employee.USERNAME = UserNameTextBox.Text;

                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;

                return employee;
            }
            catch (Exception)
            {
                return null;
            }
        }
 private void clearData()
 {
     _selectedCustomer = null;
     _selectedEmployee = null;
     _selectedLoanType = null;
     _selectedLoan = null;
 }
        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");
            }
        }