Example #1
0
        /// <summary>
        /// 后台登陆页面
        /// </summary>
        /// <param name="username"></param>
        /// <param name="userpwd"></param>
        /// <param name="usercode"></param>
        /// <returns></returns>
        public ActionResult Index(string username, string userpwd, string usercode)
        {
            if (IsPost)
            {
                try
                {
                    string code = DealMvc.Common.Globals.getCode().ToString2();

                    if (code.ToLower() != usercode.ToLower())
                    {
                        throw new ExceptionEx.MyExceptionMessageBox("验证码不正确");
                    }
                    Model.Admin m_XShop_Admins = Model.Admin.GetModel(t => t.AdminID == username.Trim() && t.AdminPwd == userpwd.Jmd5());
                    if (m_XShop_Admins == null || m_XShop_Admins.IsNull)
                    {
                        throw new ExceptionEx.MyExceptionMessageBox("帐号或密码不正确");
                    }

                    //跟新帐号的登录时间
                    m_XShop_Admins.UpTime = DateTime.Now;
                    m_XShop_Admins.Update();

                    DealMvc.Common.Globals.setAdminName(m_XShop_Admins.AdminID);
                    return(RedirectToAction("do"));
                }
                catch (Exception ce)
                {
                    ExceptionEx.MyExceptionLog.WriteLog(this, ce);
                }
            }

            return(View());
        }
Example #2
0
 private void UpdateManager()
 {
     string Id = Public.FilterSql(Request.Params["Id"]);
     string UserEmail = Request.Params["UserEmail"];
     string TrueName = Request.Params["TrueName"];
     string UserTel = Request.Params["UserTel"];
     string UserUnit = Request.Params["UserUnit"];
     Model.Admin user = new Model.Admin();
     user.Id = Convert.ToInt32(Id);
     user.UserEmail = UserEmail;
     user.TrueName = TrueName;
     user.UserTel = UserTel;
     user.UserUnit = UserUnit;
     if (user.Update() == 1)
     {
         Response.Write("{\"returnval\":\"1\"}");
     }
     else
     {
         Response.Write("{\"returnval\":\"0\"}");
     }
     Response.End();
 }
Example #3
0
 private void ResetManagerPass()
 {
     string Id = Public.FilterSql(Request.Params["Id"]);
     string userPass = Request.Params["UserPass"];
     Model.Admin user = new Model.Admin();
     user.Id = Convert.ToInt32(Id);
     user.UserPass = Encrypt.Md5(userPass);
     if (user.Update() == 1)
     {
         Response.Write("{\"returnval\":\"1\"}");
     }
     else
     {
         Response.Write("{\"returnval\":\"0\"}");
     }
     Response.End();
 }