Beispiel #1
0
        /// <summary>
        /// PH_Flow_UserInsert
        /// </summary>
        /// <param name="strConnDB"></param>
        /// <param name="drProfile"></param>
        /// <param name="drVenders"></param>
        /// <returns></returns>
        public PHCore_Status PH_Flow_UserInsert(string strConnDB, PHDS_User.User_ProfileRow drProfile, List <PHDS_User.User_VendorRow> drVenders)
        {
            PHCore_Status status = new PHCore_Status();

            try
            {
                drProfile.UserID = PH_UserProfile.PH_UserProfile_GetMaxID(strConnDB);
                PH_UserProfile.PH_UserProfile_Insert(strConnDB, drProfile);

                if (drVenders != null && drVenders.Count > 0)
                {
                    foreach (PHDS_User.User_VendorRow dr in drVenders)
                    {
                        dr.UserID = drProfile.UserID;
                        PH_UserVendor.PH_UserVendor_Insert(strConnDB, dr);
                    }
                }

                status.Status = PHCore_Status.SignInStatus.Success;
            }
            catch (Exception ex)
            {
                status.Status  = PHCore_Status.SignInStatus.Failure;
                status.Message = ex.Message;
            }
            return(status);
        }
Beispiel #2
0
        public static PHCore_Status UserSignIn(string strConnDB, string strUserName, string strPassword)
        {
            try
            {
                PHCore_Status eStatus = new PHCore_Status();
                DataTable     dtUser  = PH_UserProfile.PH_UserProfile_SigIn(strConnDB, strUserName, PH_EncrptHelper.MD5Encryp(strPassword));
                if (dtUser != null && dtUser.Rows.Count > 0)
                {
                    DateTime dtPassExpired = (DateTime)dtUser.Rows[0]["Passwd_Expired_Date"];
                    if (DateTime.Now > dtPassExpired)
                    {
                        eStatus.Status = PHCore_Status.SignInStatus.PasswordExpired;
                    }
                    else
                    {
                        eStatus.Status = PHCore_Status.SignInStatus.Success;
                    }


                    eStatus.UserId   = dtUser.Rows[0]["userid"].ToString();
                    eStatus.UserName = dtUser.Rows[0]["username"].ToString();
                    eStatus.RoleId   = (PHCore_Status.RoleID)Enum.Parse(typeof(PHCore_Status.RoleID), dtUser.Rows[0]["roleid"].ToString(), true);
                }
                else
                {
                    eStatus.Status = PHCore_Status.SignInStatus.Failure;
                }
                //eStatus = Microsoft.AspNet.Identity.Owin.SignInStatus.Success;
                return(eStatus);
            }
            catch (Exception ex)
            {
                throw new Exception("UserSignIn >> " + ex.Message);
            }
        }
Beispiel #3
0
 /// <summary>
 /// ChangePasswd
 /// </summary>
 /// <param name="strConnDB"></param>
 /// <param name="strUserId"></param>
 /// <param name="strPasswd"></param>
 /// <param name="dtPasswdExp"></param>
 /// <returns></returns>
 public static int ChangePasswd(string strConnDB, string strUserId, string strPasswd, DateTime dtPasswdExp)
 {
     try
     {
         return(PH_UserProfile.PH_UserProfile_ChangePasswd(strConnDB, strUserId, PH_EncrptHelper.MD5Encryp(strPasswd), dtPasswdExp));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Beispiel #4
0
 /// <summary>
 /// SelByUserId
 /// </summary>
 /// <param name="strConnDB"></param>
 /// <param name="strUserId"></param>
 /// <returns></returns>
 public static DataTable SelByUserId(string strConnDB, string strUserId)
 {
     try
     {
         return(PH_UserProfile.PH_UserProfile_SelByUserId(strConnDB, strUserId));
     }
     catch (Exception ex)
     {
         throw new Exception("SelByUserId >>" + ex.Message);
     }
 }
Beispiel #5
0
 public static string SelAllUserName(string strConnDB, string strUserName)
 {
     try
     {
         return(PH_UserProfile.PH_UserProfile_SelUserName(strConnDB, strUserName));
     }
     catch (Exception ex)
     {
         throw new Exception("SelAllUserName >>" + ex.Message);
     }
 }
Beispiel #6
0
 /// <summary>
 /// ChangeProfile
 /// </summary>
 /// <param name="strConnDB"></param>
 /// <param name="strUserId"></param>
 /// <param name="strContact"></param>
 /// <param name="strEmail"></param>
 /// <param name="strMobile"></param>
 /// <returns></returns>
 public static int ChangeProfile(string strConnDB, string strUserId, string strContact, string strEmail, string strMobile)
 {
     try
     {
         return(PH_UserProfile.PH_UserProfile_ChangeProfile(strConnDB, strUserId, strContact, strEmail, strMobile));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }