Beispiel #1
0
        internal void UpdateNoteTitle(int id, string title)
        {
            var noteTitleList = db.Queryable <NoteTitle>().Where(nt => nt.id == id).ToList();

            if (noteTitleList.Count > 0)
            {
                var noteTitle = noteTitleList[0];
                noteTitle.n_title = title;
                db.Updateable(noteTitle).ExecuteCommand();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 密码修改,启用停用、重置
        /// </summary>
        /// <returns></returns>
        public ActionResult ReSetpwd(Dictionary <string, string> input, sys_member profile)
        {
            sys_member usr = new sys_member();

            if (input.ContainsKey("pwd"))  //修改密码
            {
                if (input["pwd"].Length < 6)
                {
                    return(new ActionResult(false, null, null, "新密码至少6位"));
                }
                usr = profile;
                string pwd  = CryptoHelper.TripleDesEncrypting(input["opwd"]);
                string Npwd = CryptoHelper.TripleDesEncrypting(input["pwd"]);
                if (usr.pwd == pwd)
                {
                    usr.pwd = Npwd;
                    _db.Updateable(usr).ExecuteCommand();
                    return(new ActionResult(true));
                }
                else
                {
                    return(new ActionResult(false, null, null, "旧密码验证失败:管理员【微信:Anno6295】"));
                }
            }
            else if (input.ContainsKey("state"))  //启用停用
            {
                usr.ID    = Convert.ToInt32(input["uid"]);
                usr.state = Convert.ToInt16(input["state"]);
                _db.Updateable(usr).UpdateColumns(m => new { m.state }).ExecuteCommand();
            }
            else
            {  //重置密码
                usr.ID  = Convert.ToInt32(input["uid"]);
                usr.pwd = CryptoHelper.TripleDesEncrypting(Const.AppSettings.DefaultPwd);
                _db.Updateable(usr).UpdateColumns(m => new { m.pwd }).ExecuteCommand();
            }
            return(new ActionResult(true));
        }