public int UpdateUserProfileEmployee(UserProfileEmployee emp)
 {
     try
     {
         return(UserProfileEmployeeIntegration.UpdateUserProfileEmployee(emp));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
        public int UpdateUserProfileEmployee(UserProfileEmployee emp)
        {
            try
            {
                int        ReturnValue = 0;
                SqlCommand SqlCmd      = new SqlCommand();
                SqlCmd.CommandType = CommandType.StoredProcedure;
                SqlCmd.Parameters.Add(GetParameter("ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;

                SqlCmd.Parameters.Add(GetParameter("EmployeeID", SqlDbType.Int, emp.EmployeeID));


                //SqlCmd.Parameters.Add(GetParameter("Salutation", SqlDbType.VarChar, emp.Salutation));
                //SqlCmd.Parameters.Add(GetParameter("EmployeeName", SqlDbType.VarChar, emp.EmployeeName));
                //SqlCmd.Parameters.Add(GetParameter("FatherName", SqlDbType.VarChar, emp.FatherName));
                //SqlCmd.Parameters.Add(GetParameter("SpouseName", SqlDbType.VarChar, emp.SpouseName));
                SqlCmd.Parameters.Add(GetParameter("DateOfBirth", SqlDbType.DateTime, emp.DateOfBirth.ToString(MicroConstants.DateFormat)));
                //SqlCmd.Parameters.Add(GetParameter("Gender", SqlDbType.VarChar, emp.Gender));
                //SqlCmd.Parameters.Add(GetParameter("BloodGroup", SqlDbType.VarChar, emp.BloodGroup));
                //SqlCmd.Parameters.Add(GetParameter("Religion", SqlDbType.VarChar, emp.Religion));
                //SqlCmd.Parameters.Add(GetParameter("Nationality", SqlDbType.VarChar, emp.Nationality));
                //SqlCmd.Parameters.Add(GetParameter("MaritalStatus", SqlDbType.VarChar, emp.MaritalStatus));
                //SqlCmd.Parameters.Add(GetParameter("KnownAilments", SqlDbType.VarChar, emp.KnownAilments));
                //SqlCmd.Parameters.Add(GetParameter("IdentificationMark", SqlDbType.VarChar, emp.IdentificationMark));

                SqlCmd.Parameters.Add(GetParameter("Address_Present_TownOrCity", SqlDbType.VarChar, emp.Address_Present_TownOrCity));
                SqlCmd.Parameters.Add(GetParameter("Address_Present_LandMark", SqlDbType.VarChar, emp.Address_Present_LandMark));
                SqlCmd.Parameters.Add(GetParameter("Address_Present_DistrictID", SqlDbType.Int, emp.Address_Present_DistrictID));
                SqlCmd.Parameters.Add(GetParameter("Address_Present_Pincode", SqlDbType.VarChar, emp.Address_Present_Pincode));

                //SqlCmd.Parameters.Add(GetParameter("Address_Permanent_TownOrCity", SqlDbType.VarChar, emp.Address_Permanent_TownOrCity));
                //SqlCmd.Parameters.Add(GetParameter("Address_Permanent_LandMark", SqlDbType.VarChar, emp.Address_Permanent_LandMark));
                //SqlCmd.Parameters.Add(GetParameter("Address_Permanent_DistrictID", SqlDbType.Int, emp.Address_Permanent_DistrictID));
                //SqlCmd.Parameters.Add(GetParameter("Address_Permanent_Pincode", SqlDbType.VarChar, emp.Address_Permanent_Pincode));

                SqlCmd.Parameters.Add(GetParameter("PhoneNumber", SqlDbType.VarChar, emp.PhoneNumber));
                SqlCmd.Parameters.Add(GetParameter("Mobile", SqlDbType.VarChar, emp.Mobile));
                SqlCmd.Parameters.Add(GetParameter("EmailID", SqlDbType.VarChar, emp.EmailID));
                SqlCmd.Parameters.Add(GetParameter("PersonalEMailID", SqlDbType.VarChar, emp.PersonalEMailID));
                SqlCmd.Parameters.Add(GetParameter("EmergencyContactNumber", SqlDbType.VarChar, emp.EmergencyContactNumber));

                SqlCmd.Parameters.Add(GetParameter("ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                SqlCmd.CommandText = "pHRM_UserProfile_Employee_Update";
                ExecuteStoredProcedure(SqlCmd);

                ReturnValue = int.Parse(SqlCmd.Parameters[0].Value.ToString());

                return(ReturnValue);
            }
            catch (Exception ex)
            {
                throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
            }
        }
        private int UpdateEmployees(int employeeid)
        {
            int ProcReturnValue = 0;

            UserProfileEmployee theEmployee = new UserProfileEmployee();

            theEmployee.EmployeeID = Connection.LoggedOnUser.UserReferenceID;

            //theEmployee.EmployeeCode = lbl_EmployeeCode.Text;
            //theEmployee.Salutation = txt_EmployeeSalutation.SelectedValue;
            //theEmployee.EmployeeName = txt_EmployeeName.Text;
            //theEmployee.FatherName = txt_EmployeeFatherName.Text;
            //theEmployee.SpouseName = txt_EmployeeSpouseName.Text;
            //theEmployee.DateOfBirth = DateTime.Parse(txt_EmployeeDateOfBirth.Text);
            //theEmployee.Gender = ddl_EmployeeGender.SelectedValue;
            //theEmployee.BloodGroup = ddl_EmployeeBloodGroup.SelectedValue;
            //theEmployee.Religion = ddl_EmployeeReligion.SelectedValue;
            //theEmployee.Nationality = ddl_EmployeeNationality.SelectedValue;
            //theEmployee.MaritalStatus = ddl_EmployeeMaritalStatus.SelectedValue;
            theEmployee.DateOfBirth = DateTime.Parse(txt_EmployeeDateOfBirth.Text);
            //theEmployee.KnownAilments = txt_EmployeeKnownAliments.Text;
            //theEmployee.IdentificationMark = txt_EmployeeIdentificationMark.Text;
            theEmployee.Address_Present_TownOrCity = txt_EmployeePresentTownOrCity.Text;
            theEmployee.Address_Present_LandMark   = txt_EmployeePresentLandMark.Text;
            theEmployee.Address_Present_Pincode    = txt_EmployeePresentPinCode.Text;
            theEmployee.Address_Present_DistrictID = int.Parse(ddl_EmployeePresentDistrict.SelectedValue);
            //theEmployee.Address_Permanent_TownOrCity = txt_EmployeePermanentTownOrCity.Text;
            //theEmployee.Address_Permanent_LandMark = txt_EmployeePermanentLandmark.Text;
            //theEmployee.Address_Permanent_Pincode = txt_EmployeePermanentPinCode.Text;
            //theEmployee.Address_Permanent_DistrictID = int.Parse(ddl_EmployeePermanentDistrict.SelectedValue);
            theEmployee.PhoneNumber = txt_EmployeePhoneNumber.Text;
            theEmployee.Mobile      = txt_EmployeeMobile.Text;
            //theEmployee.EmailID = txt_EmployeeEmailId.Text;
            theEmployee.PersonalEMailID        = txt_EmployeePersonalEmailId.Text;
            theEmployee.EmergencyContactNumber = txt_EmployeeEmergencyContactNumber.Text;
            //TODO Image
            ProcReturnValue = UserProfileEmployeeManagement.GetInstance.UpdateUserProfileEmployee(theEmployee);

            return(ProcReturnValue);
        }