public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string name = "icon"; string savepath = GetPath(); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); name = name + fileExtension; string ServerPath = System.Web.HttpContext.Current.Server.MapPath("/"); string fdir = ServerPath + savepath + "/icon" + fileExtension; string fdirs = ServerPath + savepath + "/icon_small" + fileExtension; if (File.Exists(fdir)) { File.Delete(fdir); } if (File.Exists(fdirs)) { File.Delete(fdirs); } int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } string OldImage = savepath + name; //生成所有自定义规格 ImageHelper.UPLoad(OldImage, savepath, "icon_small" + fileExtension, 100, 100, "Cut"); //写入数据库 Lebi_Image model = new Lebi_Image(); model.Image = name; model.Keyid = 0; model.Size = "100,100"; model.TableName = "temp"; B_Lebi_Image.Add(model); msg = "OK"; Response.Write("{\"msg\":\"" + msg + "\",\"ImageUrl\":\"" + model.Image + "\"}"); return; } msg = Language.Tag("没有选择任何文件", ""); Response.Write("{\"msg\":\"" + msg + "\"}"); }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; HttpFileCollection files = HttpContext.Current.Request.Files; if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; //string name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; string savepath = GetPath(ShopCache.GetBaseConfig().UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); //name = name + fileExtension; int status = FileHelper.UPLoad(postedFile, savepath, fileName); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } else { Response.Write("{\"msg\":\"OK\",\"url\":\"" + savepath + fileName + "\"}"); return; } } msg = Language.Tag("没有选择任何文件"); Response.Write("{\"msg\":\"" + msg + "\"}"); }
protected string billstatus = "";//发票状态 protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); string where = "id = " + id + ""; if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids)) { where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))"; } if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids)) { where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))"; } model = B_Lebi_Order.GetModel(where); if (model == null) { model = new Lebi_Order(); } if (domain3admin && CurrentAdmin.Site_ids != "") { if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ",")) { PageError(); return; } } oldmodel = B_Lebi_Order.GetModel(model.Order_id); if (oldmodel == null) { oldmodel = new Lebi_Order(); } //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); } }
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 string billstatus = "";//发票状态 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(id); if (model == null) { model = new Lebi_Order(); } 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 + " and Supplier_id = " + CurrentSupplier.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + " and Supplier_id = " + CurrentSupplier.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)); } }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; string sizestr = "100,100"; //缩略图大小 HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(conf.UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } string OldImage = savepath + name; string SmallImage = ""; //生成所有自定义规格 string[] sizes = sizestr.Split('$'); foreach (string ss in sizes) { string[] s = ss.Split(','); int w = Convert.ToInt32(s[0]); int h = Convert.ToInt32(s[1]); SmallImage = name.Replace("_w$h_", "_" + w + "$" + h + "_"); ImageHelper.UPLoad(OldImage, savepath, SmallImage, w, h); } SmallImage = savepath + SmallImage; //写入数据库 Lebi_Image model = new Lebi_Image(); model.Image = savepath + name; model.Keyid = 0; model.Size = sizestr; model.TableName = "temp"; B_Lebi_Image.Add(model); msg = "OK"; Response.Write("{\"msg\":\"" + msg + "\",\"ImageSmall\":\"" + SmallImage + "\",\"ImageUrl\":\"" + model.Image + "\"}"); return; } msg = Language.Tag("没有选择任何文件", ""); Response.Write("{\"msg\":\"" + msg + "\"}"); }
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); } }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(conf.UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } //if (Shop.LebiAPI.Service.Instanse.Check("imageserver") && WebConfig.Instrance.UpLoadURL != "") //{ // try // { // string url = WebConfig.Instrance.UpLoadURL; // if (url.Contains("?")) // url += "&filename=" + fileName; // else // url += "?filename=" + fileName; // if (WebConfig.Instrance.ImageServerKey != "") // url += "&key=" + WebConfig.Instrance.ImageServerKey; // string res = HtmlEngine.PostFile(url, ImageHelper.rootpath(savepath + name)); // //api = jss.Deserialize<LBAPI>(res); // ImageHelper.DeleteImage(savepath + name); // Response.Write(res); // } // catch (Exception ex) // { // Response.Write("{\"msg\":\"" + ex.Message + "\"}"); // } // return; //} string pos = ""; Thread thread = new Thread(() => { pos = PostFiles(fileName, savepath, name); }); thread.IsBackground = true; thread.Start(); thread.Join(); Response.Write(pos); return; } msg = Language.Tag("没有选择任何文件", ""); Response.Write("{\"msg\":\"" + msg + "\"}"); }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; int theme_id = RequestTool.RequestInt("theme_id", 0); Lebi_Theme theme = B_Lebi_Theme.GetModel(theme_id); if (theme == null) { Response.Write("{\"msg\":\"" + Language.Tag("参数错误") + "\"}"); return; } HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(theme.Path_Advert); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } string OldImage = savepath + name; OldImage = ThemeUrl.CheckURL(OldImage); string ImageSmall = name.Replace("_w$h_", "_100$100_"); string size = "100$100"; ImageHelper.UPLoad(OldImage, savepath, ImageSmall, Convert.ToInt32(conf.ImageSmallWidth), Convert.ToInt32(conf.ImageSmallHeight)); //写入数据库 Lebi_Image model = new Lebi_Image(); model.Image = savepath + name; model.Keyid = 0; model.Size = size; model.TableName = "temp"; B_Lebi_Image.Add(model); msg = "OK"; Response.Write("{\"msg\":\"" + msg + "\",\"url\":\"" + savepath + name + "\",\"Image\":\"" + name + "\",\"ImageSmall\":\"" + ImageSmall + "\"}"); return; } msg = Language.Tag("没有选择任何文件", ""); Response.Write("{\"msg\":\"" + msg + "\"}"); }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; int minWidth = 80; //最小宽度 int minHeight = 80; //最小高度 int maxWidth = 200; //最大宽度 int maxHeight = 200; //最大高度 HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(ShopCache.GetBaseConfig().UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } if (RequestTool.RequestSafeString("path") == "Temp") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } else { string OldImage = savepath + name; string ImageMedium = name.Replace("_w$h_", "_200$200_"); ////写入数据库 //Lebi_Image model = new Lebi_Image(); //model.Image = savepath + ImageMedium; //model.Keyid = 0; //model.Size = ""; //model.TableName = "temp"; //B_Lebi_Image.Add(model); //if (originalImage.Width > minWidth && originalImage.Height > minHeight) //{ ImageHelper.UPLoad(OldImage, savepath, ImageMedium, maxWidth, maxHeight); //} string FilePath = ImageHelper.rootpath(savepath + ImageMedium); System.Drawing.Image originalImage = System.Drawing.Image.FromFile(FilePath); ImageHelper.DeleteImage(OldImage); Response.Write("{\"msg\":\"OK\",\"ImageUrl\":\"" + savepath + ImageMedium + "\",\"width\":\"" + originalImage.Width + "\",\"height\":\"" + originalImage.Height + "\"}"); return; } } msg = Language.Tag("没有选择任何文件"); Response.Write("{\"msg\":\"" + msg + "\"}"); }
/// <summary> /// 发放卡券 /// </summary> public void SendCard() { if (!EX_Admin.Power("user_card_add", "发放卡券")) { AjaxNoPower(); return; } string User_Name_To = RequestTool.RequestString("User_Name_To"); string User_ids = RequestTool.RequestString("User_ids"); int orderid = RequestTool.RequestInt("orderid", 0); Lebi_CardOrder co = B_Lebi_CardOrder.GetModel(orderid); if (co == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } SearchUser su = new SearchUser(CurrentAdmin, CurrentLanguage.Code); int count = B_Lebi_Card.Counts("CardOrder_id=" + orderid + " and Type_id_CardStatus=200 and User_id=0"); string where = ""; if (User_Name_To != "") { where = "UserName = lbsql{'" + User_Name_To + "'}"; } else if (User_ids != "") { where = "id in (lbsql{" + User_ids + "})"; } else { where = "1=1 " + su.SQL; } if (count < B_Lebi_User.Counts(where)) { Response.Write("{\"msg\":\"" + Tag("卡券数量不足") + "\"}"); return; } List <Lebi_User> users = B_Lebi_User.GetList(where, ""); if (users.Count == 0) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } foreach (Lebi_User user in users) { Lebi_Card c = B_Lebi_Card.GetModel("CardOrder_id=" + orderid + " and Type_id_CardStatus=200 and User_id=0"); if (c == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } c.User_id = user.id; c.Type_id_CardStatus = 201;//已发放 c.User_UserName = user.UserName; B_Lebi_Card.Update(c); } Log.Add("发送" + EX_Type.TypeName(co.Type_id_CardType) + "", "card", "", CurrentAdmin, su.Description + User_Name_To + User_ids); Response.Write("{\"msg\":\"OK\"}"); }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(ShopCache.GetBaseConfig().UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } if (RequestTool.RequestSafeString("path") == "verified") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } else { //写入数据库 Lebi_Image model = new Lebi_Image(); model.Image = savepath + name; model.Keyid = 0; model.Size = ""; model.TableName = "temp"; B_Lebi_Image.Add(model); Response.Write("{\"msg\":\"OK\",\"ImageUrl\":\"" + model.Image + "\"}"); return; } } msg = Language.Tag("没有选择任何文件"); Response.Write("{\"msg\":\"" + msg + "\"}"); }
/// <summary> /// 获取订单 /// </summary> public void GetOrders() { int id = RequestTool.RequestInt("order_id", 0); int size = RequestTool.RequestInt("size", 1); size = size < 0 ? 0 : size; size = size > 50 ? 50 : size; List <Lebi_Order> orders = B_Lebi_Order.GetList("id>=" + id, "id asc", size, 1); List <apiOrder> models = new List <apiOrder>(); apiOrder model; string domain = "http://" + RequestTool.GetRequestDomain(); int port = RequestTool.GetRequestPort(); if (port != 80) { domain = domain + ":" + port; } foreach (Lebi_Order order in orders) { model = new apiOrder(); model.Code = order.Code; model.Currency_Code = order.Code; model.Currency_ExchangeRate = order.Currency_ExchangeRate; model.Currency_Msige = order.Currency_Msige; model.id = order.id; model.IsCompleted = order.IsCompleted; model.IsInvalid = order.IsInvalid; model.IsPaid = order.IsPaid; model.IsReceived = order.IsReceived; model.IsReceived_All = order.IsReceived_All; model.IsShipped = order.IsShipped; model.IsShipped_All = order.IsShipped_All; model.IsVerified = order.IsVerified; model.Money_Bill = order.Money_Bill; model.Money_Market = order.Money_Market; model.Money_Order = order.Money_Order; model.Money_Product = order.Money_Product; model.Money_Transport = order.Money_Transport; model.OnlinePay = order.OnlinePay; model.OnlinePay_Code = order.OnlinePay_Code; model.Pay = order.Pay; model.Point = order.Point; model.Point_Buy = order.Point_Buy; model.Remark_Admin = order.Remark_Admin; model.Remark_User = order.Remark_User; model.T_Address = order.T_Address; model.T_Area = EX_Area.GetAreaName(order.T_Area_id, 4); model.T_Email = order.T_Email; model.T_MobilePhone = order.T_MobilePhone; model.T_Name = order.T_Name; model.T_Phone = order.T_Phone; model.T_Postalcode = order.T_Postalcode; model.Time_Add = order.Time_Add; model.Time_Completed = order.Time_Completed; model.Time_Paid = order.Time_Paid; model.Time_Received = order.Time_Received; model.Time_Shipped = order.Time_Shipped; model.Time_Verified = order.Time_Verified; model.Transport_Code = order.Transport_Code; model.Transport_Mark = order.Transport_Mark; model.Transport_Name = order.Transport_Name; model.OrderType = EX_Type.TypeName(order.Type_id_OrderType); model.User_id = order.User_id; model.User_UserName = order.User_UserName; model.Volume = order.Volume; model.Weight = order.Weight; List <apiOrderProduct> products = new List <apiOrderProduct>(); List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", ""); apiOrderProduct product; foreach (Lebi_Order_Product pro in pros) { product = new apiOrderProduct(); product.Count = pro.Count; product.Guige = ""; product.ImageBig = domain + pro.ImageBig; product.ImageSmall = domain + pro.ImageSmall; product.Name = Language.Content(pro.Product_Name, "CN"); product.Number = pro.Product_Number; product.Price = pro.Price; product.URL = domain + URL("P_Product", pro.Product_id); products.Add(product); } model.Products = products; models.Add(model); } JavaScriptSerializer jss = new JavaScriptSerializer(); string json = jss.Serialize(models); LBAPI api = new LBAPI(); api.data = json; api.msg = "OK"; json = jss.Serialize(api); Response.Write(json); }
public void LoadPage() { if (!AjaxLoadCheck()) { return; } string msg = ""; string name = ""; HttpFileCollection files = HttpContext.Current.Request.Files; BaseConfig conf = ShopCache.GetBaseConfig(); B_WaterConfig bc = new B_WaterConfig(); WaterConfig mx = bc.LoadConfig(); if (files.Count > 0) { ///'检查文件扩展名字 HttpPostedFile postedFile = files[0]; string savepath = GetPath(conf.UpLoadPath); string fileName, fileExtension; fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); if (conf.UpLoadSaveName == "" || conf.UpLoadSaveName == null) { conf.UpLoadSaveName = "0"; } if (conf.UpLoadSaveName == "0") { name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_"; } else { name = System.IO.Path.GetFileNameWithoutExtension(fileName) + "_w$h_"; } name = conf.UpLoadRName + name + fileExtension; int status = ImageHelper.SaveImage(postedFile, savepath, name); if (status != 290) { msg = Language.Tag(EX_Type.TypeName(status)); Response.Write("{\"msg\":\"" + msg + "\"}"); return; } if (Shop.LebiAPI.Service.Instanse.Check("imageserver") && WebConfig.Instrance.UpLoadURL != "") { try { string url = WebConfig.Instrance.UpLoadURL; if (url.Contains("?")) { url += "&filename=" + fileName; } else { url += "?filename=" + fileName; } if (WebConfig.Instrance.ImageServerKey != "") { url += "&key=" + WebConfig.Instrance.ImageServerKey; } string res = HtmlEngine.PostFile(url, ImageHelper.rootpath(savepath + name)); //api = jss.Deserialize<LBAPI>(res); ImageHelper.DeleteImage(savepath + name); Response.Write(res); } catch (Exception ex) { Response.Write("{\"msg\":\"" + ex.Message + "\"}"); } return; } string OldImage = savepath + name; //string ImageBig = name.Replace("_w$h_", "_" + conf.ImageBigWidth + "$" + conf.ImageBigHeight + "_"); //string ImageMedium = name.Replace("_w$h_", "_" + conf.ImageMediumWidth + "$" + conf.ImageMediumHeight + "_"); //string ImageSmall = name.Replace("_w$h_", "_" + conf.ImageSmallWidth + "$" + conf.ImageSmallHeight + "_"); //string size = conf.ImageBigWidth + "$" + conf.ImageBigHeight + "," + conf.ImageMediumWidth + "$" + conf.ImageMediumHeight + "," + conf.ImageSmallWidth + "$" + conf.ImageSmallHeight; string size = ""; //if (mx.OnAndOff == "1") //{ // ImageHelper.UPLoad(OldImage, savepath, "temp_" + name, Convert.ToInt32(conf.ImageBigWidth), Convert.ToInt32(conf.ImageBigHeight)); // ImageHelper.MakeWater(System.Web.HttpContext.Current.Server.MapPath(savepath) + "temp_" + name, savepath, ImageBig, mx); // ImageHelper.DeleteImage(savepath + "temp_" + name); //} //else //{ // ImageHelper.UPLoad(OldImage, savepath, ImageBig, Convert.ToInt32(conf.ImageBigWidth), Convert.ToInt32(conf.ImageBigHeight)); //} //ImageHelper.UPLoad(OldImage, savepath, ImageMedium, Convert.ToInt32(conf.ImageMediumWidth), Convert.ToInt32(conf.ImageMediumHeight)); //ImageHelper.UPLoad(OldImage, savepath, ImageSmall, Convert.ToInt32(conf.ImageSmallWidth), Convert.ToInt32(conf.ImageSmallHeight)); ////生成所有规格 //string where = "id not in (select id from Lebi_ImageSize where (Width=" + conf.ImageBigWidth + " and Height=" + conf.ImageBigHeight + ") or (Width=" + conf.ImageMediumWidth + " and Height=" + conf.ImageMediumHeight + ") or (Width=" + conf.ImageSmallWidth + " and Height=" + conf.ImageSmallHeight + "))"; //List<Lebi_ImageSize> ss = B_Lebi_ImageSize.GetList(where, ""); //foreach (Lebi_ImageSize s in ss) //{ // ImageHelper.UPLoad(OldImage, savepath, name.Replace("_w$h_", "_" + s.Width + "$" + s.Height + "_"), s.Width, s.Height); // size += "," + s.Width + "$" + s.Height; //} //写入数据库 Lebi_Image model = new Lebi_Image(); model.Image = OldImage; model.Keyid = 0; model.Size = size; model.TableName = "Product"; B_Lebi_Image.Add(model); msg = "OK"; Response.Write("{\"msg\":\"" + msg + "\",\"img\":\"" + OldImage + "\",\"file\":\"" + fileName + "\"}"); return; } msg = Language.Tag("没有选择任何文件", ""); Response.Write("{\"msg\":\"" + msg + "\"}"); }