Beispiel #1
0
        public int UpdateUserProfileFieldForceProfile(UserProfileFieldForceProfile objUserProfileFieldForceProfile)
        {
            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("FieldForceID", SqlDbType.Int, objUserProfileFieldForceProfile.FieldForceID));
                //SqlCmd.Parameters.Add(GetParameter("SettingKeyID", SqlDbType.Int, objUserProfileFieldForceProfile.SettingKeyID));
                SqlCmd.Parameters.Add(GetParameter("SettingKeyValue", SqlDbType.VarBinary, ImageFunctions.ImageToByte(objUserProfileFieldForceProfile.SettingKeyValue)));
                SqlCmd.Parameters.Add(GetParameter("SettingKeyDescription", SqlDbType.VarChar, objUserProfileFieldForceProfile.SettingKeyDescription));
                //SqlCmd.Parameters.Add(GetParameter("DateModified", SqlDbType.DateTime, objUserProfileEmployeeProfile.DateModified));
                SqlCmd.Parameters.Add(GetParameter("ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                SqlCmd.CommandText = "pCRM_UserProfile_FieldForceProfiles_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));
            }
        }
Beispiel #2
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));
            }
        }