/// <summary> /// 编辑配送点 /// </summary> public void Delivery_Edit() { if (!Power("supplier_delivery_list", "配送点管理")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); bool addflag = false; Lebi_Supplier_Delivery model = B_Lebi_Supplier_Delivery.GetModel("id = " + id + " and Supplier_id = " + CurrentSupplier.id + ""); if (model == null) { addflag = true; model = new Lebi_Supplier_Delivery(); } model = B_Lebi_Supplier_Delivery.SafeBindForm(model); if (addflag) { model.Supplier_id = CurrentSupplier.id; B_Lebi_Supplier_Delivery.Add(model); id = B_Lebi_Supplier_Delivery.GetMaxId(); Log.Add("添加配送点", "Delivery", id.ToString(), CurrentSupplier, model.Name); } else { B_Lebi_Supplier_Delivery.Update(model); Log.Add("编辑配送点", "Delivery", id.ToString(), CurrentSupplier, model.Name); } string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
public Lebi_Supplier_Delivery GetDelivery(int id) { Lebi_Supplier_Delivery model = B_Lebi_Supplier_Delivery.GetModel(id); if (model == null) { model = new Lebi_Supplier_Delivery(); } return(model); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { PageError(); return; } else { shop = CurrentSupplier; if (shop == null) { shop = new Lebi_Supplier(); } if (CurrentSupplier.id != model.Supplier_id) { PageError(); return; } } if (model.Type_id_OrderType == 212) { str = "- "; } //if (model.Type_id_OrderType == 212) // Response.Redirect("Torder_view.aspx?id=" + id); pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc"); comms = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc"); langs = Language.Languages(); Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + ""); if (bill == null) { billstatus = Tag("不开发票"); } else { billstatus = Tag(EX_Type.TypeName(bill.Type_id_BillStatus)); } TransportCount = B_Lebi_Transport_Order.Counts("Order_id=" + model.id + ""); CommentCount = B_Lebi_Comment.Counts("TableName='Order' and Keyid=" + model.id + ""); LogCount = B_Lebi_Log.Counts("TableName='Order' and Keyid='" + model.id + "'"); deliveries = B_Lebi_Supplier_Delivery.GetList("Supplier_id = " + model.Supplier_id + "", "Sort desc"); DeliveryCount = B_Lebi_Supplier_Delivery.Counts("Supplier_id = " + model.Supplier_id + ""); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_delivery_list", "配送点管理")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Supplier_Delivery.GetModel("id = " + id + " and Supplier_id = " + CurrentSupplier.id + ""); if (model == null) { model = new Lebi_Supplier_Delivery(); } }
/// <summary> /// 删除配送点 /// </summary> public void Delivery_Del() { if (!Power("supplier_delivery_list", "配送点管理")) { AjaxNoPower(); return; } string id = RequestTool.RequestSafeString("Fid"); if (id == "") { Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_Delivery.Delete("id in (lbsql{" + id + "}) and Supplier_id = " + CurrentSupplier.id + ""); Log.Add("删除配送点", "Delivery", id.ToString(), CurrentSupplier, id.ToString()); Response.Write("{\"msg\":\"OK\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_delivery_list", "配送点管理")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); key = RequestTool.RequestString("key"); string where = "Supplier_id = " + CurrentSupplier.id + ""; if (key != "") { where += " and ([Name] like lbsql{'%" + key + "%'} or [Remark] like lbsql{'%" + key + "%'})"; } models = B_Lebi_Supplier_Delivery.GetList(where, "Sort desc", PageSize, page); int recordCount = B_Lebi_Supplier_Delivery.Counts(where); PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}", page, PageSize, recordCount); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); shop = new Lebi_Supplier(); } else { if (model.Supplier_id > 0) { shop = B_Lebi_Supplier.GetModel(model.Supplier_id); } if (shop == null) { shop = new Lebi_Supplier(); } if (domain3admin && CurrentAdmin.Site_ids != "") { if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ",")) { PageError(); return; } } } if (model.Type_id_OrderType == 212) { str = "- "; } //if (model.Type_id_OrderType == 212) // Response.Redirect("Torder_view.aspx?id=" + id); pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc"); comms = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc"); langs = Language.Languages(); Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + ""); if (bill == null) { billstatus = Tag("不开发票"); } else { billstatus = EX_Type.TypeName(bill.Type_id_BillStatus); } TransportCount = B_Lebi_Transport_Order.Counts("Order_id=" + model.id + ""); CommentCount = B_Lebi_Comment.Counts("TableName='Order' and Keyid=" + model.id + ""); LogCount = B_Lebi_Log.Counts("TableName='Order' and Keyid='" + model.id + "'"); deliveries = B_Lebi_Supplier_Delivery.GetList("Supplier_id = " + model.Supplier_id + "", "Sort desc"); DeliveryCount = B_Lebi_Supplier_Delivery.Counts("Supplier_id = " + model.Supplier_id + ""); if (model.Promotion_Type_ids != "") { //List<Lebi_Promotion_Type> Promotions = B_Lebi_Promotion_Type.GetList("id in (" + model.Promotion_Type_ids + ")", ""); //foreach (Lebi_Promotion_Type p in Promotions) //{ // if (Promotion == "") // Promotion = Lang(p.Name); // else // Promotion += "<br/>" + Lang(p.Name); //} Promotion = Lang(model.Promotion_Type_Name); } }
/// <summary> /// 导出供应商订单数据(商品) /// </summary> public void SupplierOrder_product_Export() { if (!EX_Admin.Power("statis_orderproduct", "订单报表")) { PageNoPower(); } string where = RequestTool.RequestString("where"); where = Server.UrlDecode(where).Replace("´", "'"); //SystemLog.Add(where); string titles = "" + Tag("序号") + "," + Tag("供应商") + "," + Tag("配送点") + "," + Tag("单号") + "," + Tag("订购日期") + "," + Tag("发货时间") + "," + Tag("支付状态") + "," + Tag("支付方式") + "," + Tag("配送方式") + "," + Tag("商品名称") + "," + Tag("条形码") + "," + Tag("商品条码") + "," + Tag("单位") + "," + Tag("数量") + "," + Tag("金额") + ""; string[] arr = titles.Split(','); DataTable dt = new DataTable(); foreach (string col in arr) { dt.Columns.Add(col); } DataRow r = dt.NewRow(); dt.Rows.Add(r); //List<Lebi_Order_Product> models = B_Lebi_Order_Product.GetList("Order_id in (select id from Lebi_Order where " + where + ")", "id desc"); List <Lebi_Order_Product> models = B_Lebi_Order_Product.GetList(where, "id desc"); //Response.Write(models.Count); //Response.End(); StringBuilder sb = new StringBuilder(); if (!Shop.LebiAPI.Service.Instanse.Check("managelicenese")) { sb.Append("LebiShop V" + SYS.Version + "." + SYS.Version_Son + " (http://www.lebi.cn),\r\n"); } sb.Append(titles + "\r\n"); //sb.Append("标签,"); //sb.Append(tag + "\r\n"); int i = 0; Lebi_Supplier supplier; Lebi_Supplier_Delivery delivery; Lebi_Order order; foreach (Lebi_Order_Product model in models) { order = Shop.Bussiness.Order.GetOrder(model.Order_id); i++; supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier == null) { supplier = new Lebi_Supplier(); } delivery = B_Lebi_Supplier_Delivery.GetModel(order.Supplier_Delivery_id); if (delivery == null) { delivery = new Lebi_Supplier_Delivery(); } sb.Append(i + ","); sb.Append(out_txt(supplier.SubName) + ","); sb.Append(out_txt(delivery.Name) + ","); sb.Append(order.Code + ","); sb.Append(order.Time_Add.ToString("yyyy-MM-dd HH:mm:ss") + ","); if (order.IsShipped == 1) { sb.Append(order.Time_Shipped.ToString("yyyy-MM-dd HH:mm:ss") + ","); } else { sb.Append("-,"); } sb.Append((order.IsPaid == 1 ? Tag("已支付") : Tag("未支付")) + ","); sb.Append(out_txt(Lang(order.Pay) + Lang(order.OnlinePay)) + ","); sb.Append(out_txt(order.Transport_Name) + ","); sb.Append(out_txt(Lang(model.Product_Name)) + ","); sb.Append(model.Product_Number + ","); sb.Append(Shop.Bussiness.EX_Product.GetProduct(model.Product_id).Code + ","); sb.Append(Lang(Shop.Bussiness.EX_Product.ProductUnit(Shop.Bussiness.EX_Product.GetProduct(model.Product_id).Units_id)) + ","); sb.Append(model.Count + ","); sb.Append(model.Price * model.Count); sb.Append("\r\n"); } FileTool.StringTofile(sb.ToString(), "order", ".csv"); }