コード例 #1
0
ファイル: Reg.ashx.cs プロジェクト: ErekTan/HLedo
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Clear();

            BLL.UserInfoExt bllUserInfo = new BLL.UserInfoExt();
            Model.UserInfo modelUserInfo = new Model.UserInfo();

            string strUserName = context.Request["UName"];
            string strEmail = context.Request["UEmail"];
            string strPwd = context.Request["UPwd"];

            Guid roles = new Guid("7e6573be-d49f-48f0-a9cd-1fe8d64a84a6"); //注册时写死为普通会员
            modelUserInfo.RoleID = roles;
            modelUserInfo.UserName = strUserName;
            modelUserInfo.Email = strEmail;
            modelUserInfo.Password = lv_Common.DEncrypt.DEncrypt.Encrypt(strPwd);
            modelUserInfo.LastLoginDate = DateTime.Now;
            modelUserInfo.CreateDate = DateTime.Now;
            modelUserInfo.ApprovedState = (int)BLL.TypeEnum.UserApprovedState.已审核; //注册就通过审核,否则无法跳转到用户后台

            bllUserInfo.Add(modelUserInfo);

            BLL.MenberValidate.RegisterTicket(strUserName);

            context.Response.Write("yes");
            context.Response.End();
        }
コード例 #2
0
ファイル: QQLogin.ascx.cs プロジェクト: ErekTan/HLedo
 private void Login(string id, string name)
 {
     BLL.UserInfoExt bllUserInfo = new BLL.UserInfoExt();
     if (!bllUserInfo.IsExistUserName(id))
     {
         Model.UserInfo modelUserInfo = new Model.UserInfo();
         modelUserInfo.UserName = id;
         modelUserInfo.Password = lv_Common.DEncrypt.DEncrypt.Encrypt(DateTime.Now.ToString());
         modelUserInfo.ApprovedState = (int)BLL.TypeEnum.UserApprovedState.未审核;
         modelUserInfo.Email = "";
         modelUserInfo.Nick = name;
         BLL.UserRolesExt bllUserRoles = new BLL.UserRolesExt();
         modelUserInfo.RoleID = bllUserRoles.GetRoleByRoleName("普通会员").UserRoleID;
         bllUserInfo.Add(modelUserInfo);
     }
     Model.UserInfo modelUser = bllUserInfo.GetUserByName(id);
     if (modelUser.Nick != name)
     {
         bllUserInfo.UpdateField("Nick", name, modelUser.UserID);
     }
     BLL.MenberValidate.RegisterTicket(id);
 }
コード例 #3
0
ファイル: CheckedInput.ashx.cs プロジェクト: ErekTan/HLedo
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Clear();

            BLL.UserInfoExt bllUserInfo = new BLL.UserInfoExt();

            string strUserName = context.Request["UName"];
            string strEmail = context.Request["UEmail"];
            string strType = context.Request["UType"];

            switch (strType)
            {
                case "1":
                    //注册时判断用户名是否存在
                    context.Response.Write(bllUserInfo.IsExistUserName(strUserName).ToString());
                    break;
                case "2":
                    //注册时判断邮箱是否存在
                    context.Response.Write(bllUserInfo.IsExistEmail(strEmail).ToString());
                    break;
            }
            context.Response.End();
        }
コード例 #4
0
ファイル: WebPageExt.cs プロジェクト: ErekTan/HLedo
 /// <summary>
 /// 判断当前用户的商家主页是否已通过审核
 /// </summary>
 /// <param name="userName"></param>
 /// <returns></returns>
 public bool IsExistWebPageApprovedState(string userName)
 {
     BLL.UserInfoExt bll = new BLL.UserInfoExt();
     List<Model.WebPage> webPage = GetModelList("UserName='******'");
     if (webPage != null && webPage.Count != 0)
     {
         if (webPage[0].ApprovedState == 1)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else
     {
         return false;
     }
 }
コード例 #5
0
ファイル: MenberValidate.cs プロジェクト: ErekTan/HLedo
 /// <summary>
 /// 验证用户名和密码是否正确
 /// </summary>
 /// <param name="userName">用户名</param>
 /// <param name="password">密码</param>
 /// <returns></returns>
 public static bool ValidateUserPassword(string userName, string password)
 {
     BLL.UserInfoExt bllUserInfo = new BLL.UserInfoExt();
     Model.UserInfo user = bllUserInfo.GetUserByName(userName);
     if (user == null)
     {
         return false;
     }
     else
     {
         string userPwd = lv_Common.DEncrypt.DEncrypt.Decrypt(user.Password);
         if (userPwd == password)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
 }