Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var id       = Convert.ToInt32(context.Request.Form["hidID"]);
            var bll      = new BLL.UserInfoBLL();
            var userInfo = bll.GetEntityModel(id);

            if (userInfo != null)
            {
                userInfo.UserName = context.Request.Form["txtName"];
                userInfo.UserPass = context.Request.Form["txtPwd"];
                userInfo.Email    = context.Request.Form["txtEmail"];
                if (bll.UpdateEntityModel(userInfo))
                {
                    context.Response.Redirect("UserInfoList.ashx");
                }
                else
                {
                    context.Response.Write("修改失败");
                }
            }
            else
            {
                context.Response.Write("参数异常");
            }
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var id  = Convert.ToInt32(context.Request.QueryString["id"]);
            var bll = new BLL.UserInfoBLL();

            if (bll.DeleteEntityModel(id))
            {
                context.Response.Redirect("UserInfoList.ashx");
            }
            else
            {
                context.Response.Write("删除失败");
            }
        }