예제 #1
0
        public bool AuthenticateMailUser(string UserName, string Password)
        {
            try
            {
                UserMaster objUserMaster = new UserMaster();

                SP_PRICINGEntities objSP_PRICINGEntities = new SP_PRICINGEntities();

                ObjectResult <ValidateUserResult> objUserListResult = objSP_PRICINGEntities.SP_VALIDATE_USER(UserName, Password);
                List <ValidateUserResult>         UserList          = objUserListResult.ToList();

                if (UserList != null && UserList.Count == 1)
                {
                    General.ReflectSingleData(objUserMaster, UserList[0]);
                    objUserMaster.Password  = Password;
                    Session["LoggedInUser"] = objUserMaster;
                    Session["Role"]         = objUserMaster.RoleName;

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                UserMaster objUserMaster = new UserMaster();
                objUserMaster = (UserMaster)Session["LoggedInUser"];
                LogError(ex.Message, ex.StackTrace, "", "", objUserMaster.UserID);
                return(false);
            }
        }
 public void LogError(string strErrorDescription, string strStackTrace, string strClassName, string strMethodName, Int32 intUserId)
 {
     SP_PRICINGEntities objSP_PRICINGEntities = new SP_PRICINGEntities();
     var Count = objSP_PRICINGEntities.SP_ERROR_LOG(strErrorDescription, strStackTrace, strClassName, strMethodName, intUserId);
 }