protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //加载客户服务信息 BLL.HKSJ_Clients clients = new BLL.HKSJ_Clients(); ClientsShow = clients.GetModel(int.Parse(Request["id"])); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int clientId = context.Request["id"] == null ? 0 : int.Parse(context.Request["id"]); BLL.HKSJ_Clients clientService = new BLL.HKSJ_Clients(); Model.HKSJ_Clients client = new Model.HKSJ_Clients(); client = clientService.GetModel(clientId); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); context.Response.Write(serializer.Serialize(client)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; BLL.HKSJ_Clients clientServices = new BLL.HKSJ_Clients(); context.Response.ContentType = "text/plain"; //获取参数实现用户的添加 Model.HKSJ_Clients client = new Model.HKSJ_Clients(); //var title = $("# //var softName = $ //var liaisonPhone //var liaisonPeple //var date = $("#t //peple client.title = context.Request["title"]; client.softName = context.Request["softName"]; client.liaisonPhone = context.Request["liaisonPhone"]; client.liaisonPeple = context.Request["liaisonPeple"]; string str = context.Request["date"]; client.date = DateTime.Now; client.peple = context.Request["peple"]; client.content = context.Request["content"]; if (client.title != "" && client.softName != "" && client.liaisonPhone != "" && client.liaisonPeple != "" && str != "" && client.peple != "" && client.content != "") { //实现给数据库中添加数据 if (clientServices.Add(client) > 0) { context.Response.Write("OK"); } else { context.Response.Write("error"); } } else { context.Response.Write("LackOfRequeryItem"); } }
public void ProcessRequest(HttpContext context) { BLL.HKSJ_Clients clientService = new BLL.HKSJ_Clients(); Model.HKSJ_Clients client = new Model.HKSJ_Clients(); context.Response.ContentType = "text/plain"; //id: RowUpdat //title: $("#t //softName: $( //liaisonPhone //liaisonPeple //date: $("#tx // peple: $("#t client.id = context.Request["id"] == null ? 0 : int.Parse(context.Request["id"]); client.title = context.Request["title"]; client.softName = context.Request["softName"]; client.liaisonPhone = context.Request["liaisonPhone"]; client.liaisonPeple = context.Request["liaisonPeple"]; client.date = context.Request["date"] == null ? DateTime.Now : Convert.ToDateTime(context.Request["date"]); client.peple = context.Request["peple"]; client.content = context.Request["content"]; if (client.title != "" && client.softName != "" && client.liaisonPhone != "" && client.liaisonPeple != "" && client.peple != "" && client.content != "") { //实现给数据库中添加数据 if (clientService.Update(client)) { context.Response.Write("OK"); } else { context.Response.Write("error"); } } else { context.Response.Write("LackOfRequeryItem"); } }