Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int id;

            if (int.TryParse(context.Request.Form["ID"], out id))
            {
                UserInfo userInfo = new UserInfo();
                userInfo.ID       = id;
                userInfo.UserName = context.Request.Form["txtUserName"];
                userInfo.UserPass = context.Request.Form["passUserPass"];
                userInfo.Email    = context.Request.Form["txtEmail"];

                BLL.UserInfoService userInfoService = new BLL.UserInfoService();
                if (userInfoService.Update(userInfo))
                {
                    context.Response.Redirect("UserInfoList.ashx");
                }
                else
                {
                    context.Response.Redirect("Error.html");
                }
            }
            else
            {
                context.Response.Write("更新参数错误");
            }
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int id;

            if (int.TryParse(context.Request["txtEditUserID"], out id))
            {
                Model.UserInfo userInfo = new Model.UserInfo();
                userInfo.ID       = id;
                userInfo.UserName = context.Request["txtEditUserName"];
                userInfo.UserPass = context.Request["txtEditUserPass"];
                userInfo.Email    = context.Request["txtEditEmail"];
                BLL.UserInfoService userInfoService = new BLL.UserInfoService();
                if (userInfoService.Update(userInfo))
                {
                    context.Response.Write("ok");
                }
                else
                {
                    context.Response.Write("no");
                }
            }
            else
            {
                context.Response.Write("no");
            }
        }
Example #3
0
        public void UpdateUserInfo()
        {
            userInfo.ID       = int.Parse(Context.Request.Form["ID"]);
            userInfo.UserName = Context.Request.Form["txtUserName"];
            userInfo.UserPass = Context.Request.Form["passUserPass"];
            userInfo.Email    = Context.Request.Form["txtEmail"];
            userInfo.RegTime  = DateTime.Parse(Context.Request.Form["RegTime"]);

            if (userInfoService.Update(userInfo))
            {
                Context.Response.Redirect("UserInfoWebForm.aspx");
            }
            else
            {
                Context.Response.Redirect("/Error.html.html");
            }
        }