public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; IList<Node> list = new List<Node>(); int currentpage = int.Parse(context.Request["page"]); int pagesize = int.Parse(context.Request["pagesize"]); CGZticket ticket = new CGZticket(); List<GZticket> ticketlist = ticket.Query(currentpage, pagesize); var total = ticketlist.Count; var totalpage = (float)ticket.QueryRowCount("gzticket"); for (var i = 0; i < total; i++) { list.Add(new Node() { gzId = ticketlist[i].gzId, gzticketName = ticketlist[i].gzticketName, place = ticketlist[i].place, level = ticketlist[i].level, themeType = ticketlist[i].themeType, imageAdress = ticketlist[i].imageAdress, price = ticketlist[i].price, time = ticketlist[i].starttime, isRecommend = ticketlist[i].isRecommend, ticketTitle = ticketlist[i].ticketTitle, ticketType = ticketlist[i].ticketType, isInvoice = ticketlist[i].isInvoice, isReduce = ticketlist[i].isReduce, stockCount = ticketlist[i].stockCount }); } //声明一个var对象,把读取到的数据复制给它,用来传递给JSON, var gridData = new { Rows = list, Total = totalpage }; string json = JsonConvert.SerializeObject(gridData); context.Response.Write(json); context.Response.End(); }
public static string DeleteTicket(string id) { //CGZbookIntroduction cbookintroduction = new CGZbookIntroduction(); //cbookintroduction.Delete(id); //CGZPriceIntroduction cpriceintrodection = new CGZPriceIntroduction(); //cpriceintrodection.Delete(id); //CGZticketIntroduction cticketintroduction = new CGZticketIntroduction(); //cticketintroduction.Delete(id); //声明数据控制类,调用方法删除 CGZticket cticket = new CGZticket(); Boolean issucess = cticket.Delete(id); if (issucess == true) { return "true"; } else { return "false"; } }
protected void btn_ticket_info_Click(object sender, EventArgs e) { string ticketname = Request.Form["ticketname"]; string ticketTitle = Request.Form["ticketTitle"]; string ticketprice = Request.Form["ticketprice"]; string ticketType = Request.Form["ticketType"]; string starttime = Request.Form["startTime"]; string endtime=Request.Form["endTime"]; string level = Request.Form["level"]; string theme = Request.Form["theme"]; string isRecommend = Request.Form["isRecommend"]; string city = Request.Form["city"]; string isInvoice = Request.Form["ticketStock"]; string ticketStock = Request.Form["ticketStock"]; string isReducStock = Request.Form["isReducStock"]; AddFile(); GZticket ticket = new GZticket(null, ticketname, city, level, theme, path, ticketprice, starttime, endtime, isRecommend, ticketTitle, ticketType, isInvoice, isReducStock, ticketStock); CGZticket cticket = new CGZticket(); cticket.Insert(ticket); string Id=cticket.Query(ticketTitle); string ticketIntrodection = Request.Form["ticketIntrodection"]; CGZticketIntroduction ticketintroduction = new CGZticketIntroduction(); ticketintroduction.Insert(new GZTicketIntroduction(Id, ticketIntrodection)); string priceIntroduction = Request.Form["priceintrodection"]; CGZPriceIntroduction cpriceIntroduction = new CGZPriceIntroduction(); cpriceIntroduction.Insert(new GZPriceIntroduction(Id, priceIntroduction)); string bookIntrodection = Request.Form["bookintrodection"]; CGZbookIntroduction cbookIntroduction = new CGZbookIntroduction(); cbookIntroduction.Insert(new GZbookIntroduction(Id, bookIntrodection)); //GZTourismTicket ticket = new GZTourismTicket(null, ticketname, ticketprice, path, introduction); //CGZTourismTicket insert = new CGZTourismTicket(); //insert.Insert(ticket); Upload_ServerFile(); }