Exemplo n.º 1
0
        public static List <UserProfileEmployeeProfile> SetPhotoByEmployeeID(DataTable EmployeeProfileDataTable)
        {
            try
            {
                List <UserProfileEmployeeProfile> EmployeeList = new List <UserProfileEmployeeProfile>();
                foreach (DataRow dr in EmployeeProfileDataTable.Rows)
                {
                    UserProfileEmployeeProfile theEmployeeProfile = new UserProfileEmployeeProfile();
                    theEmployeeProfile.EmployeeID      = int.Parse(dr["EmployeeID"].ToString());
                    theEmployeeProfile.SettingKeyValue = ImageFunctions.ByteToImage((Byte[])(dr["SettingKeyValue"]));

                    //theWebForm.ModuleID = int.Parse(dr["ModuleID"].ToString());
                    //theWebForm.WebFormName = dr["WebFormName"].ToString();
                    //theWebForm.WebFormURL = dr["WebFormURL"].ToString();
                    //theWebForm.WebFormImageURL = dr["WebFormImageURL"].ToString();
                    //theWebForm.ModuleName = dr["ModuleName"].ToString();
                    //theWebForm.CompanyCode = dr["CompanyCode"].ToString();
                    //theWebForm.IsActive = bool.Parse(dr["IsActive"].ToString());
                    //theWebForm.IsDeleted = bool.Parse(dr["IsDeleted"].ToString());
                    //theWebForm.WebFormDescription = dr["WebFormDescription"].ToString();

                    EmployeeList.Add(theEmployeeProfile);
                }
                return(EmployeeList);
            }

            catch (Exception ex)
            {
                throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
            }
        }
Exemplo n.º 2
0
        public int UpdateUserProfileEmployeeProfile(UserProfileEmployeeProfile objUserProfileEmployeeProfile)
        {
            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, objUserProfileEmployeeProfile.EmployeeID));
                SqlCmd.Parameters.Add(GetParameter("SettingKeyID", SqlDbType.Int, objUserProfileEmployeeProfile.SettingKeyID));
                SqlCmd.Parameters.Add(GetParameter("SettingKeyValue", SqlDbType.VarBinary, ImageFunctions.ImageToByte(objUserProfileEmployeeProfile.SettingKeyValue)));
                SqlCmd.Parameters.Add(GetParameter("SettingKeyDescription", SqlDbType.VarChar, objUserProfileEmployeeProfile.SettingKeyDescription));
                //SqlCmd.Parameters.Add(GetParameter("DateModified", SqlDbType.DateTime, objUserProfileEmployeeProfile.DateModified));
                SqlCmd.Parameters.Add(GetParameter("ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                SqlCmd.CommandText = "pHRM_UserProfile_EmployeeProfiles_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));
            }
        }
Exemplo n.º 3
0
 public int UpdateUserProfileEmployeeProfile(UserProfileEmployeeProfile objUserProfileEmployeeProfile)
 {
     try
     {
         return(UserProfileEmployeeProfileIntegration.UpdateUserProfileEmployeeProfile(objUserProfileEmployeeProfile));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
Exemplo n.º 4
0
 public static UserProfileEmployeeProfile GetEmployeePhotoByUserID(int EmployeeID)
 {
     try
     {
         DataRow DtRow = UserProfileEmployeeProfileDataAccess.GetInstance.GetPhotoByUserID(EmployeeID);
         UserProfileEmployeeProfile objEmployeeProfile = new UserProfileEmployeeProfile();
         objEmployeeProfile.EmployeeID      = int.Parse(DtRow["EmployeeID"].ToString());
         objEmployeeProfile.SettingKeyValue = Base64ToImage(DtRow["SettingKeyValue"].ToString());
         return(objEmployeeProfile);
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
Exemplo n.º 5
0
        public int GetEmployeePhotoByUserID(UserProfileEmployeeProfile objUserProfileEmployeeProfile)
        {
            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, objUserProfileEmployeeProfile.EmployeeID));

                SqlCmd.Parameters.Add(GetParameter("SettingKeyValue", SqlDbType.VarBinary, ImageFunctions.ImageToByte(objUserProfileEmployeeProfile.SettingKeyValue)));

                SqlCmd.CommandText = "pHRM_EmployeePhoto_Select";
                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));
            }
        }