//注册成功页面  验证邮箱页面
 // GET: /RegisterSuccessMail/
 public ActionResult RegisterSuccessPage()
 {
     string successname = RequestBase.GetString("username");
     string successusertype = RequestBase.GetString("usertype");
     if (LoginMember != null)
     {
         ViewData["IsLogin"] = true;
     }
     else
     {
         ViewData["IsLogin"] = false;
     }
     if (successname != null && successname != "" && successusertype == "0")
     {
         BLL.MemberBase mbbll = new BLL.MemberBase();
         DataSet ds = mbbll.GetList(" m_UserName='******' and m_UserType=0");
         string id = ds.Tables[0].Rows[0]["m_ID"].ToString();
         Model.MemberBase mbmodel = new Model.MemberBase();
         mbmodel = mbbll.GetModel(int.Parse(id));
         mbmodel.m_StatusCode = 0;
         mbmodel.m_mailyanzheng = true;
         if (mbbll.Update(mbmodel))
         {
             ViewData["ueername"] = "恭喜您," + successname + ",邮箱验证成功!";
             return View();
         }
         else
         {
             ViewData["ueername"] = successname + ",数据异常,邮箱验证失败,请联系管理员!";
             return View();
         }
     }
     else
     {
         BLL.MemberBase mbbll = new BLL.MemberBase();
         DataSet ds = mbbll.GetList(" m_UserName='******' and m_UserType=2");
         string id = ds.Tables[0].Rows[0]["m_ID"].ToString();
         Model.MemberBase mbmodel = new Model.MemberBase();
         mbmodel = mbbll.GetModel(int.Parse(id));
         mbmodel.m_StatusCode = 0;
         mbmodel.m_ShenPstatus = 1;
         if (mbbll.Update(mbmodel))
         {
             ViewData["ueername"] = "恭喜您," + successname + ",邮箱验证成功!";
             return View();
         }
         else
         {
             ViewData["ueername"] = successname + ",数据异常,邮箱验证失败,请联系管理员!";
             return View();
         }
     }
 }
Beispiel #2
0
        public void DsnsLogon(HttpContext context)
        {
            string username = context.Request.QueryString["uname"].ToString().Trim();
            string passwd = context.Request.QueryString["passwd"].ToString().Trim();
            passwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(passwd, "MD5");
            string AutoLogon = context.Request.QueryString["AutoLogon"].ToString();
            BLL.MemberBase bll = new BLL.MemberBase();
            DataSet ds = bll.GetList(string.Format(" m_UserName='******' and m_Password='******' and m_UserType=2", username, passwd));
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                if (dr["m_StatusCode"].ToString() == "1")
                {
                    context.Response.Write("账号异常,请联系工作人员");
                }
                else if (dr["m_ShenPstatus"].ToString() == "0")
                {
                    context.Response.Write("账号未审核");
                }
                else
                {
                    DateTime ckExpires = DateTime.Now.AddHours(1);
                    if (AutoLogon == "1")
                    {
                        ckExpires = DateTime.Now.AddDays(7);
                    }
                    Model.MemberBase model = bll.GetModel(int.Parse(dr["m_id"].ToString()));
                    context.Response.Cookies["UserInfo"].Value = CookieEncrypt.SerializeObject(model);
                    context.Response.Cookies["UserInfo"].Expires = ckExpires;

                    string url = context.Request.UrlReferrer.AbsoluteUri;
                    context.Response.Write("1");

                }
            }
            else
            {
                context.Response.Write("账号不存在或用户名密码错误");
            }
        }