public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; BLL.User_Service userSer = new BLL.User_Service(); int id = Convert.ToInt32(context.Request.Form["hiddenId"]); Model.User_Model usermodel = userSer.GetUser(id); if (usermodel != null) { usermodel.LoginPwd = context.Request.Form["txtpwd"]; usermodel.NickName = context.Request.Form["txtnick"]; usermodel.Sex = context.Request.Form["txtsex"]; usermodel.Age = Convert.ToInt32(context.Request.Form["txtage"]); usermodel.FaceId = Convert.ToInt32(context.Request.Form["txtface"]); usermodel.Friend = Convert.ToInt32(context.Request.Form["txtfriend"]); usermodel.Name = context.Request.Form["txtname"]; usermodel.StarId = Convert.ToInt32(context.Request.Form["txtstar"]); usermodel.BloodId = Convert.ToInt32(context.Request.Form["txtblood"]); usermodel.Id = id; if (userSer.UpdateUser(usermodel)) { context.Response.Redirect("Index.ashx"); } else { context.Response.Redirect("Error.html"); } } }
private void PostEditUser() { Users_Model usermodel = new Users_Model(); usermodel.LoginPwd = Request.Form["txtpwd"]; usermodel.NickName = Request.Form["txtnick"]; usermodel.Sex = Request.Form["txtsex"]; usermodel.Age = Convert.ToInt32(Request.Form["txtage"]); usermodel.FaceId = Convert.ToInt32(Request.Form["txtface"]); usermodel.Friend = Convert.ToInt32(Request.Form["txtfriend"]); usermodel.Name = Request.Form["txtname"]; usermodel.StarId = Convert.ToInt32(Request.Form["txtstar"]); usermodel.BloodId = Convert.ToInt32(Request.Form["txtblood"]); usermodel.Id = Convert.ToInt32(Request.Form["id"]); if (userservice.UpdateUser(usermodel)) { Response.Redirect("Index.aspx"); } else { Response.Redirect("Error.html"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; Model.Users_Model usermodel = new Model.Users_Model(); usermodel.LoginPwd = context.Request["edittxtpwd"]; usermodel.NickName = context.Request["edittxtnick"]; usermodel.Sex = context.Request["edittxtsex"]; usermodel.Age = Convert.ToInt32(context.Request["edittxtage"]); usermodel.FaceId = Convert.ToInt32(context.Request["edittxtface"]); usermodel.Friend = Convert.ToInt32(context.Request["edittxtfriend"]); usermodel.Name = context.Request["edittxtname"]; usermodel.StarId = Convert.ToInt32(context.Request["edittxtstar"]); usermodel.BloodId = Convert.ToInt32(context.Request["edittxtblood"]); usermodel.Id = Convert.ToInt32(context.Request["editId"]); BLL.User_Service userSer = new BLL.User_Service(); if (userSer.UpdateUser(usermodel)) { context.Response.Write("yes"); } else { context.Response.Write("no"); } }