Example #1
0
 public ActionResult UpdatePassword(partyUpdatePasswordModel model)
 {
     model.partyName = User.Identity.Name;
     if (ModelState.IsValid)
     {
         if (new PartyActivities().ReSetPartyPassword(model))
         {
             Response.Write("密码修改成功!");
         }
         else
         {
             Response.Write("原密码输入有误!");
         }
     }
     return View();
 }
Example #2
0
        /// <summary>
        /// 修改社团账号密码
        /// </summary>
        /// <param name="model"></param>
        /// <returns>false:旧密码错误</returns>
        public bool ReSetPartyPassword(partyUpdatePasswordModel model)
        {
            string md5Password = Encryption.Encrype.GetMD5(model.oldPassword);
            var    t009        = operateContext.BLLSession.IT009社团账号表BLL.GetListBy(m => m.PartyName == model.partyName && m.Password == md5Password).FirstOrDefault();

            if (t009 != null)
            {
                t009.Password  = Encryption.Encrype.GetMD5(model.newPassword);
                t009.PartyName = model.partyName;
                operateContext.BLLSession.IT009社团账号表BLL.Modify(t009, "Password");
                return(true);
            }
            else
            {
                return(false);
            }
        }