public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; int id = context.Request.QueryString["goods_id"] == null ? 0 : Int32.Parse(context.Request.QueryString["goods_id"]); string temp = File.ReadAllText(context.Server.MapPath("drugstore_details.html")); GoodModel good = GoodsBLL.GetAGoodDetail(id); temp = temp.Replace("@goods_id", good.GoodsId.ToString()); temp = temp.Replace("@a1", good.GoodsName); temp = temp.Replace("@a2", good.GoodsEffect); temp = temp.Replace("@a3", good.GoodsPrice.ToString()); temp = temp.Replace("@a4", "商品规格:" + good.GoodsNorms); temp = temp.Replace("@a5", "生产厂家:" + good.GoodsFactory); temp = temp.Replace("@a6", "库存状态: " + good.GoodsStock); temp = temp.Replace("@a7", "../Images/product_img/" + good.GoodsPicture); if (context.Session["users_id"] != null) { temp = temp.Replace("@user_name", context.Session["user_name"].ToString()); } else { temp = temp.Replace("@user_name", "游客"); } context.Response.Write(temp); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; if (context.Session["id"] != null) { string temp = File.ReadAllText(context.Server.MapPath("drugstore_admin_order.html")); if (context.Request.Form["goods_number"] != null) { int i = OrderBLL.SendOrder(context.Request.Form["goods_number"].ToString()); } List <OrdersModel> orderList = new List <OrdersModel>(); if (context.Request.Form["name"] == null) { orderList = OrderBLL.GetOrderByIsend(); } else { orderList = OrderBLL.GetOrderByName(context.Request.Form["name"].ToString()); } StringBuilder sb = new StringBuilder(); if (orderList != null) { foreach (OrdersModel item in orderList) { sb.AppendFormat("<div class='panel panel-default'><div class='panel-heading'><b>{0}</b>订单号: <span>{1}</span> <span class='pull-right'>是否发货:{5}</span><span class='pull-right'>买家ID:{2}</span><span class='pull-right'> </span><span class='pull-right'>手机:{3}</span><span class='pull-right'> </span><span class='pull-right'>{4}</span> </div><table class='table table-bordered'><thead><tr><td>#</td><td>药品名</td><td>治疗症状</td><td>数量</td></tr></thead><tbody>", item.Ordertime, item.Ordernumber, item.Orderusersid.ToString(), item.Orderphone, item.Orderadress, item.OrderIssend); List <GoodsorderModel> dt1 = GoodsOrderBLL.GetGoodsOrderListById(item.Orderid); foreach (GoodsorderModel item1 in dt1) { GoodModel goods = GoodsBLL.GetAGoodDetail(item1.Gdod_goods_id); //dt2.Rows[0].item[""] sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td></tr>", goods.GoodsId, goods.GoodsName, goods.GoodsEffect, item1.Gdod_order_count); } sb.AppendFormat("</tbody></table></div> "); } } temp = temp.Replace("@admin", context.Session["admin_name"].ToString()); temp = temp.Replace("@content", sb.ToString()); context.Response.Write(temp); } else { context.Response.Redirect("~/admin_login.html"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; if (context.Session["id"] != null) { int id = context.Request.QueryString["goods_id"] == null ? 0 : Int32.Parse(context.Request.QueryString["goods_id"]); string temp = File.ReadAllText(context.Server.MapPath("admin_product_save.html")); GoodModel good = GoodsBLL.GetAGoodDetail(id); temp = temp.Replace("@Goods_name", good.GoodsName); temp = temp.Replace("@Goods_effect", good.GoodsEffect); temp = temp.Replace("@Goods_price", good.GoodsPrice.ToString()); temp = temp.Replace("@Goods_norms", good.GoodsNorms.ToString()); temp = temp.Replace("@Goods_factory", good.GoodsFactory.ToString()); temp = temp.Replace("@Goods_stock", good.GoodsStock.ToString()); temp = temp.Replace("@Goods_id", id.ToString()); List <GoodsTypeModel> goodsType = GoodsTypeBLL.GetGoodsTypeList(); StringBuilder sb = new StringBuilder(); string selectedHtml = ""; foreach (GoodsTypeModel item in goodsType) { if (good.GoodsGoodsType == item.GoodsTypeid) { selectedHtml = "selected = 'true'"; } sb.AppendFormat(@"<option value='{0}' {2}>{1}</option>", item.GoodsTypeid, item.GoodsTypename, selectedHtml); selectedHtml = ""; } temp = temp.Replace("@admin", context.Session["admin_name"].ToString()); temp = temp.Replace("@product_type", sb.ToString()); context.Response.Write(temp); } else { context.Response.Redirect("~/admin_login.html"); } }