Beispiel #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="mo"></param>
        /// <returns></returns>
        public string SaveSysUser(Model.sys_user mo)
        {
            string savetype = Request.QueryString["savetype"].ToString();

            mo.u_state = string.IsNullOrEmpty(Request.Form["u_state"]) ? 0 : 1;

            bool b = false;

            if (savetype == "0")
            {
                mo.id     = Guid.NewGuid().ToString();
                mo.u_date = DateTime.Now;
                mo.u_pwd  = DB.CalcTo.MD5(mo.u_pwd);
                b         = new DAL.sys_user().Add(mo);
            }
            else
            {
                mo.id = savetype;
                if (mo.u_pwd.Length != 32)
                {
                    mo.u_pwd = DB.CalcTo.MD5(mo.u_pwd);
                }
                b = new DAL.sys_user().Update(mo);
            }
            return(b ? "success" : "fail");
        }
Beispiel #2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public string DelSysUser()
        {
            string id = Request.QueryString["id"].ToString();
            bool   b  = new DAL.sys_user().Delete(id);

            return(b ? "success" : "fail");
        }