public ActionResult GetCustomer(string ID) { var result = BaseDataDAL.GetCustByID(ID); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public static List <SkuProductDetailModel> GetProductDetailModelList() { IEnumerable <string> pids = BaseDataDAL.GetPIDList(); List <SkuProductDetailModel> productdetailList = new List <SkuProductDetailModel>(); if (pids != null && pids.Any()) { using (var client = new ProductClient()) { int count = pids.Count() / 100; List <string> pidList = new List <string>(); for (int i = 0; i <= count; i++) { pidList = pids.Skip(i * 100).Take(100).ToList(); var response = client.SelectSkuProductListByPids(pidList); if (response != null && response.Result != null) { productdetailList.AddRange(response.Result); } } } } return(productdetailList); }
//獲取系統信息 public ActionResult GetSystemMessage(string ID) { var result = BaseDataDAL.GetSystemMessage(ID); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult GetProduct(string ProductID) { var result = BaseDataDAL.GetGoodsByID(ProductID); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult GetGoodsInfo(string GoodsID) { var result = BaseDataDAL.GetGoodsByID(GoodsID); //var result = new { rows = list }; return(Json(result.ProductCdesc, JsonRequestBehavior.AllowGet)); }
public ActionResult GetUnit(string kind) { var result = BaseDataDAL.GetUnit(kind); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public static void CreateBaoYangFile() { List <string> baoyangUrlList = new List <string>(); IEnumerable <VehicleInfo> Vehicles = BaseDataDAL.GetVehicleInfo(true); if (Vehicles.Any()) { WeeklySitemapJob.Logger.Info("有" + Vehicles.Count() + "个保养地址需要收录"); } if (Vehicles != null && Vehicles.Any()) { foreach (var vehicle in Vehicles.Where(q => q != null)) { for (int i = vehicle.StartYear; i <= vehicle.EndYear; i++) { string title = vehicle.Brand + vehicle.VehicleSeries + "系列" + vehicle.PaiLiang + i + "年保养"; baoyangUrlList.Add(string.Format("<li><a target=\"_blank\" title=\"{3}\" href=\"http://by.tuhu.cn/baoyang/{0}/pl{1}-n{2}.html\">{3}</a></li>", vehicle.VehicleID, vehicle.PaiLiang, i, title)); } } } Stream baoyangstream = GenerateStreamFromString(baoyangUrlList); Attachment fileattachment = new Attachment(baoyangstream, "SEOBaoYang.html"); SendMail("SEOBaoYangHtml", ConfigurationManager.AppSettings["SEOFileJob:To"], fileattachment); }
public ActionResult GetLoc() { var result = BaseDataDAL.GetLoc(); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult GetDocFlag(string DocType) { var result = BaseDataDAL.GetDocFlag(DocType); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public static void CreateShopFile() { List <string> shopUrlList = new List <string>(); IEnumerable <ShopInfo> shops = BaseDataDAL.GetShopListInfo(true); IEnumerable <ShopInfo> detailshops = BaseDataDAL.GetShopDetailInfo(true); if (shops.Any()) { WeeklySitemapJob.Logger.Info("有" + shops.Count() + "个门店地址需要收录"); } if (shops != null && shops.Any()) { foreach (var shop in shops.Where(q => q != null)) { string title = shop.RegionName + "门店"; shopUrlList.Add(string.Format("<li><a target=\"_blank\" title=\"{2}\" href=\"http://www.tuhu.cn/shops/{0}{1}.aspx\">{2}</a></li>", shop.RegionNamePinYin, shop.RegionId, title)); } } //if (detailshops != null && detailshops.Any()) //{ // foreach (var shop in detailshops.Where(q => q != null)) // { // //string title = shop.ShopName + "门店"; // shopUrlList.Add(string.Format("<li><a target=\"_blank\" title=\"{3}\" href=\"http://www.tuhu.cn/shop/{0}{1}/{2}.aspx\">{3}</a></li>", shop.RegionNamePinYin, shop.RegionId, shop.ShopId,shop.ShopName)); // } //} Stream shopstream = GenerateStreamFromString(shopUrlList); Attachment fileattachment = new Attachment(shopstream, "SEOShop.html"); SendMail("SEOShopHTML", ConfigurationManager.AppSettings["SEOFileJob:To"], fileattachment); }
public ActionResult GetDocFlagReturnString(string ID) { DataTable dt = BaseDataDAL.GetDocFlayReturnTable("wh_transfer", ID); var val = dt.Rows[0]["flag2"].ToString().Trim(); return(Json(val, JsonRequestBehavior.AllowGet)); }
public ActionResult LoadFormLanguage(string WebFormName) { var result = BaseDataDAL.LoadFormLanguage(WebFormName); var json = Json(result, JsonRequestBehavior.AllowGet); //var result = new { rows = list }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public static bool InsertProductURL(bool isFull = false) { List <string> productUrlList = new List <string>(); IEnumerable <Product> products = BaseDataDAL.GetProducts(isFull); if (products != null && products.Any()) { foreach (var product in products.Where(q => q != null)) { productUrlList.Add(string.Format("http://item.tuhu.cn/Products{0}{1}.html", !string.IsNullOrWhiteSpace(product.ProductID) ? "/" + product.ProductID : string.Empty, !string.IsNullOrWhiteSpace(product.VariantID) ? "/" + product.VariantID : string.Empty)); } } WeeklySitemapJob.Logger.Info("有" + productUrlList.Count() + "需要导入库"); return(InsertURLToDB(productUrlList, "Product")); }
public static bool InsertShopDetailURL(bool isFull = false) { List <string> shopdetailUrlList = new List <string>(); IEnumerable <ShopInfo> shops = BaseDataDAL.GetShopDetailInfo(isFull); if (shops != null && shops.Any()) { foreach (var shop in shops.Where(q => q != null)) { shopdetailUrlList.Add(string.Format("http://www.tuhu.cn/shop/{0}{1}/{2}.aspx", shop.RegionNamePinYin, shop.RegionId, shop.ShopId)); } } WeeklySitemapJob.Logger.Info("有" + shopdetailUrlList.Count() + "需要导入库"); return(InsertURLToDB(shopdetailUrlList, "ShopDetail")); }
public static bool GenerateSitemapFile(bool isFull) { bool flag = true; try { List <SitemapNode> sitemapNodeList = new List <SitemapNode>(); IEnumerable <UrlNode> urlNodes = BaseDataDAL.GetUrls(isFull); if (urlNodes != null && urlNodes.Any()) { foreach (var urlNode in urlNodes) { sitemapNodeList.Add(new SitemapNode() { Url = urlNode.URL, Frequency = SitemapFrequency.Weekly, Priority = 2, LastModified = DateTime.Now }); } } WeeklySitemapJob.Logger.Info("有" + sitemapNodeList.Count() + "个URL需要导入文件"); int count = sitemapNodeList.Count() / 20000; List <string> filelist = new List <string>(); for (int i = 0; i <= count; i++) { var sitemapList = sitemapNodeList.Skip(i * 20000).Take(20000); string sitemapstr = GetSitemapDocument(sitemapList); MemoryStream baoyangstream = GenerateStreamFromString(sitemapstr); string filename = string.Format("Sitemap_{0}_{1}.xml", DateTime.Now.ToString("yyyy-MM-dd"), i); using (FileStream filestream = new FileStream(filename, FileMode.Create)) { baoyangstream.WriteTo(filestream); filelist.Add(filename); } } AddFileToZip("sitemap.zip", filelist); Attachment fileattachment = new Attachment("sitemap.zip"); SendMail("SitemapFiles", ConfigurationManager.AppSettings["SEOFileJob:To"], fileattachment); } catch (Exception ex) { flag = false; WeeklySitemapJob.Logger.Error(ex); } return(flag); }
public static bool InsertDianPingURL(bool isFull = false) { List <string> dianpingUrlList = new List <string>(); IEnumerable <VehicleInfo> Vehicles = BaseDataDAL.GetVehicleInfo(isFull); if (Vehicles != null && Vehicles.Any()) { foreach (var vehicle in Vehicles.Where(q => q != null)) { for (int i = vehicle.StartYear; i <= vehicle.EndYear; i++) { dianpingUrlList.Add(string.Format("http://www.tuhu.cn/spages/Battery.aspx?pid={0}&n={1}&pl={2}", vehicle.VehicleID, i, vehicle.PaiLiang)); } } } return(InsertURLToDB(dianpingUrlList, "DianPing")); }
public static bool InsertBaoYangURL(bool isFull = false) { List <string> baoyangUrlList = new List <string>(); IEnumerable <VehicleInfo> Vehicles = BaseDataDAL.GetVehicleInfo(isFull); if (Vehicles != null && Vehicles.Any()) { foreach (var vehicle in Vehicles.Where(q => q != null)) { for (int i = vehicle.StartYear; i <= vehicle.EndYear; i++) { baoyangUrlList.Add(string.Format("http://by.tuhu.cn/baoyang/{0}/pl{1}-n{2}.html", vehicle.VehicleID, vehicle.PaiLiang, i)); } } } WeeklySitemapJob.Logger.Info("有" + baoyangUrlList.Count() + "需要导入库"); return(InsertURLToDB(baoyangUrlList, "BaoYang")); }
public static List <string> GetTireBrandURLs(bool isFull = false) { List <string> tireUrlList = new List <string>(); List <VehicleBrand> vehicles = new List <VehicleBrand>(); using (var vehicleclient = new VehicleClient()) { var response = vehicleclient.GetAllVehicles(); if (response != null && response.Result != null) { vehicles = response.Result.ToList(); } } IEnumerable <TireInfo> TireBrandInfos = BaseDataDAL.GetTireInfo(isFull); WeeklySitemapJob.Logger.Info("有" + TireBrandInfos.Count() + "个品牌适配轮胎"); if (vehicles != null && vehicles.Any()) { foreach (var vehicle in vehicles.Where(q => q != null)) { foreach (var tiresize in hotTiresizes) { foreach (var brand in TireBrandInfos.Where(q => q != null)) { // var count = BaseDataDAL.GetTireCount(vehicle.VehicleID, tiresize); // int pagecount = count % 20 > 0 ? count / 20 + 1 : count / 20; string w = tiresize.Substring(0, tiresize.IndexOf('/')); string a = tiresize.Substring(tiresize.IndexOf('/') + 1, tiresize.IndexOf('R') - tiresize.IndexOf('/') - 1); string r = tiresize.Substring(tiresize.IndexOf('R') + 1); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}.html", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}.html#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o1.html", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o3.html", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o6.html", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o1.html#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o3.html#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("https://item.tuhu.cn/Tires/1/au1-b{0}-a{1}-r{2}-w{3}-v{4}-o6.html#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); } } } } return(tireUrlList); }
public static bool InsertTireBrandURL(bool isFull = false) { List <string> tireUrlList = new List <string>(); List <VehicleBrand> vehicles = new List <VehicleBrand>(); using (var vehicleclient = new VehicleClient()) { var response = vehicleclient.GetAllVehicles(); if (response != null && response.Result != null) { vehicles = response.Result.ToList(); } } IEnumerable <TireInfo> TireBrandInfos = BaseDataDAL.GetTireInfo(isFull); if (vehicles != null && vehicles.Any()) { foreach (var vehicle in vehicles.Where(q => q != null)) { foreach (var tiresize in hotTiresizes) { foreach (var brand in TireBrandInfos.Where(q => q != null)) { // var count = BaseDataDAL.GetTireCount(vehicle.VehicleID, tiresize); // int pagecount = count % 20 > 0 ? count / 20 + 1 : count / 20; string w = tiresize.Substring(0, tiresize.IndexOf('/')); string a = tiresize.Substring(tiresize.IndexOf('/') + 1, tiresize.IndexOf('R') - tiresize.IndexOf('/') - 1); string r = tiresize.Substring(tiresize.IndexOf('R') + 1); tireUrlList.Add(string.Format("http://item.tuhu.cn/Tires/1/b{0}-a{1}-r{2}-w{3}-v{4}.html?oe=", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("http://item.tuhu.cn/Tires/1/b{0}-a{1}-r{2}-w{3}-v{4}.html?oe=#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("http://item.tuhu.cn/Tires/1/b{0}-a{1}-r{2}-w{3}-v{4}-o1.html?oe=#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("http://item.tuhu.cn/Tires/1/b{0}-a{1}-r{2}-w{3}-v{4}-o3.html?oe=#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); tireUrlList.Add(string.Format("http://item.tuhu.cn/Tires/1/b{0}-a{1}-r{2}-w{3}-v{4}-o6.html?oe=#Products", brand.BrandID, a, r, w, vehicle.VehicleId.Replace("-", "_"))); } // tireUrlList.Add(string.Format("http://www.tuhu.cn/spages/Battery.aspx?pid={0}&n={1}&pl={2}", vehicle.VehicleID, i, vehicle.PaiLiang)); } } } WeeklySitemapJob.Logger.Info("有" + tireUrlList.Count() + "需要导入库"); return(InsertURLToDB(tireUrlList, "TireBrandList")); }
protected static string CheckQtyStore(string LocID, string GoodsID, string ProdcutMo, string LotNo, string flag1, decimal Weg, decimal Qty) { string result = ""; decimal InQty = 0, InWeg = 0, OutQty = 0, OutWeg = 0; DataTable dtStore1 = GetStoreDetails(LocID, GoodsID, ProdcutMo, LotNo); if (dtStore1.Rows.Count > 0) { InWeg = dtStore1.Rows[0]["InWeg"].ToString() != "" ? Convert.ToDecimal(dtStore1.Rows[0]["InWeg"].ToString()) : 0; InQty = dtStore1.Rows[0]["InQty"].ToString() != "" ? Convert.ToDecimal(dtStore1.Rows[0]["InQty"].ToString()) : 0; OutWeg = dtStore1.Rows[0]["OutWeg"].ToString() != "" ? Convert.ToDecimal(dtStore1.Rows[0]["OutWeg"].ToString()) : 0; OutQty = dtStore1.Rows[0]["OutQty"].ToString() != "" ? Convert.ToDecimal(dtStore1.Rows[0]["OutQty"].ToString()) : 0; } if (flag1 == "+") { if (InWeg + Weg < OutWeg || InWeg + Weg < 0) { result = BaseDataDAL.GetSystemMessage("ST00002"); } else if (InQty + Qty < OutQty || InQty + Qty < 0) { result = BaseDataDAL.GetSystemMessage("ST00001"); } } else { if (dtStore1.Rows.Count == 0) { result = BaseDataDAL.GetSystemMessage("ST00003"); } else if (OutWeg + Weg > InWeg || OutWeg + Weg < 0) { result = BaseDataDAL.GetSystemMessage("ST00002"); } else if (OutQty + Qty > InQty || OutQty + Qty < 0) { result = BaseDataDAL.GetSystemMessage("ST00001"); } } return(result); }
public static bool InsertURLToDB(List <string> urlList, string type) { bool isInsert = true; try { if (urlList != null && urlList.Any()) { foreach (var url in urlList.Where(q => !string.IsNullOrWhiteSpace(q))) { BaseDataDAL.InsertURL(url, type); } } } catch (Exception ex) { isInsert = false; DailySitemapJob.Logger.Error(ex); } return(isInsert); }
public static bool InsertArticleURL(bool isFull = false) { List <string> articleUrlList = new List <string>(); IEnumerable <int> articleIds = BaseDataDAL.GetArticleID(isFull); if (articleIds != null) { foreach (var article in articleIds.Where(q => q > 0)) { articleUrlList.Add(string.Format("http://www.tuhu.cn/Community/detail/{0}.aspx", article)); } } if (isFull) { InsertURLToDB(new List <string> { "http://www.tuhu.cn/Community/", "http://www.tuhu.cn/Community/Discovery.aspx", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=1", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=1344", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=6", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=21", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=61", "http://www.tuhu.cn/Community/Discovery.aspx?tagId=4" }, "DiscoveryList"); } return(InsertURLToDB(articleUrlList, "DiscoveryDetail")); }
//下拉列表框基礎信息,返回ID,Name public ActionResult GetBaseInfo(string strTableName) { var result = BaseDataDAL.GetBaseInfoReturnList(strTableName); return(Json(result, JsonRequestBehavior.AllowGet)); }
//返回當前服務器日期,時間 public ActionResult GetDBDate() { var list = BaseDataDAL.GetCurrentDateList(); return(Json(list, JsonRequestBehavior.AllowGet)); }
//下拉列表框基礎信息,返回Name public ActionResult GetBaseInfoByName(string strTableName) { var list = BaseDataDAL.GetBaseInfoByNameReturnList(strTableName); return(Json(list)); }
public static UpdateStatusModels UpdateTransferDetails(TransferDetails model) { string result = ""; bool ValidFlag = true; string strSql = ""; string ID = model.ID; string LocID = model.LocID; string NextLocID = model.NextLocID; string QtyUnit = model.QtyUnit; string WegUnit = model.WegUnit; UpdateStatusModels resModel = new UpdateStatusModels(); DataTable dtFlag = BaseDataDAL.GetDocFlayReturnTable("wh_transfer", model.FlagID); string flag0 = dtFlag.Rows[0]["flag0"].ToString().Trim(); string flag1 = dtFlag.Rows[0]["flag1"].ToString().Trim(); string flag2 = dtFlag.Rows[0]["flag2"].ToString().Trim(); strSql += string.Format(@" SET XACT_ABORT ON "); strSql += string.Format(@" BEGIN TRANSACTION "); bool FirstRec = false; if (ID == null || ID == "") { FirstRec = true; ID = GenNumberDAL.GenTransferID(flag0, LocID, NextLocID, flag2); } else { if (!CheckTransferHead(ID)) { FirstRec = true; ID = GenNumberDAL.GenTransferID(flag0, LocID, NextLocID, flag2); } } if (FirstRec) { strSql += string.Format(@"Insert Into wm_TransferHead (ID,TransferDate,LocID,NextLocID,FlagID) Values ('" + ID + "','" + model.TransferDate + "','" + model.LocID + "','" + model.NextLocID + "','" + model.FlagID + "')"); } else { strSql += string.Format(@"UPDATE wm_TransferHead SET TransferDate='{0}' WHERE ID='{1}'" , model.TransferDate, ID); } string ProductMo = model.ProductMo; string GoodsID = model.GoodsID; string LotNo = model.LotNo; decimal Qty = model.TransferQty.ToString().Trim() != "" ? model.TransferQty : 0; decimal Weg = model.TransferWeg.ToString().Trim() != "" ? model.TransferWeg : 0; result = CheckQtyStore(LocID, GoodsID, ProductMo, LotNo, flag1, Weg, Qty); if (result != "") { ValidFlag = false; } else { if (flag2 == "TO") { result = CheckQtyStore(NextLocID, GoodsID, ProductMo, LotNo, "+", Weg, Qty); if (result != "") { ValidFlag = false; } } } if (ValidFlag == false) { resModel.Msg = result; return(resModel); } string Seq = GenNumberDAL.GetDetailsSeq("wm_TransferDetails", model.ID); string CreateUser = ""; string CreateTime = System.DateTime.Now.ToString("yyyy/MM/dd HH:ss:mm"); strSql += string.Format(@"Insert Into wm_TransferDetails (ID,Seq,ProductMo,GoodsID,LocID,LotNo,TransferQty,TransferWeg,QtyUnit,WegUnit,NextLocID,CreateUser,CreateTime) Values " + "('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}')" , ID, Seq, model.ProductMo, model.GoodsID, model.LocID, model.LotNo, model.TransferQty, model.TransferWeg, QtyUnit, WegUnit, NextLocID, "", CreateTime); strSql += string.Format(JoinUpdateStr("U", LocID, GoodsID, ProductMo, LotNo, flag1, Weg, Qty, CreateUser, CreateTime)); if (flag2 == "TO") { strSql += string.Format(JoinUpdateStr("U", NextLocID, GoodsID, ProductMo, LotNo, "+", Weg, Qty, CreateUser, CreateTime)); } strSql += string.Format(@" COMMIT TRANSACTION "); result = SQLHelper.ExecuteSqlUpdate(strSql); if (result == "") { resModel.Status = "OK"; } else { resModel.Status = "ERROR"; resModel.Msg = result; } resModel.ReturnValue = ID; return(resModel); }
public static ProductDetail CreateTireProductDetail(SkuProductDetailModel productTiredetail) { List <ProductCategory> productCategories = null; SpecifyProperty property25 = new SpecifyProperty() { CDataKey = "移动地址", CDataValue = string.Format("https://wx.tuhu.cn/Products/Details?pid={0}&source=wxshantou", !string.IsNullOrWhiteSpace(productTiredetail.VariantID) ? productTiredetail.ProductId + "&vid=" + productTiredetail.VariantID : productTiredetail.ProductId) }; SpecifyProperty property21 = new SpecifyProperty() { CDataKey = "产品规格", CDataValue = productTiredetail.Size.Width + "/" + productTiredetail.Size.AspectRatio + "R" + productTiredetail.Size.Rim }; SpecifyProperty property22 = new SpecifyProperty() { CDataKey = "速度级别", CDataValue = productTiredetail.SpeedRating }; SpecifyProperty property23 = new SpecifyProperty() { CDataKey = "轮胎花纹", CDataValue = productTiredetail.Pattern }; SpecifyProperty property24 = new SpecifyProperty() { CDataKey = "重量", CDataValue = productTiredetail.Weight }; ChoicePropertyList propertyList2 = new ChoicePropertyList() { SpecifyPropertyList = new List <SpecifyProperty>() { property25, string.IsNullOrWhiteSpace(property21.CDataValue) ? null : property21, string.IsNullOrWhiteSpace(property22.CDataValue) ? null : property22, string.IsNullOrWhiteSpace(property23.CDataValue) ? null : property23, string.IsNullOrWhiteSpace(property24.CDataValue) ? null : property24 } }; List <string> imageUrls = new List <string>(); if (productTiredetail.ImageUrls != null && productTiredetail.ImageUrls.Any()) { foreach (var imageUrl in productTiredetail.ImageUrls) { imageUrls.Add("https://img3.tuhu.org" + imageUrl + "@484w_300h_100Q.jpg"); imageUrls.Add("https://img3.tuhu.org" + imageUrl + "@400w_400h_100Q.jpg"); } } if (productTiredetail.NodeNo.Split(new char[] { '.' }).Count() >= 2) { string oids = productTiredetail.NodeNo.Replace('.', ','); productCategories = BaseDataDAL.GetProductCategoryByOid(oids).ToList(); productCategories = productCategories.OrderByDescending(s => s.DescendantProductCount).ToList(); } ProductDetail detail = new ProductDetail() { CDataName = productTiredetail.DisplayName, CDataOuterID = productTiredetail.Pid, CDataSellerName = "途虎", CDataSellerSiteUrl = "https://www.tuhu.cn/", CDataTitle = productTiredetail.ShuXing5, CDataImage = imageUrls[0], // CDataMoreImages = "<img index=\"1\">https://img3.tuhu.org/Images/Products/1607/47B48818B4002255.jpg@100w_100h_100Q.jpg</img><img index=\"2\">https://img3.tuhu.org/Images/Products/1607/ADCAA3A068A026D0.jpg@100w_100h_100Q.jpg</img>", // ImgValues = images, ImageValues = imageUrls.Skip(1).Select(s => new ImageValue() { Index = imageUrls.IndexOf(s), CDataImg = s }).ToList(), CDataPrice = productTiredetail.Price.ToString(), CDataBrand = productTiredetail.Brand, CDataTargetUrl = "http://item.tuhu.cn/Products/" + productTiredetail.ProductId + (!string.IsNullOrWhiteSpace(productTiredetail.VariantID) ? "/" + productTiredetail.VariantID + ".html" : ".html") + "?source=pcshantou", CDataCategory = "轮胎", CDataSubCategory = productCategories[1] != null ? productCategories[1].DisplayName : "越野胎", CDataCategoryUrl = "http://item.tuhu.cn/Tires.html", CDataSubCategoryUrl = "http://item.tuhu.cn/List/" + productCategories[1] != null ? productCategories[1].CategoryName : "TireCross" + "/", CDataTags = productTiredetail.CP_Tab, Availability = 1, Bought = productTiredetail.SalesQuantity, choiceProperties = propertyList2 }; return(detail); }
public static UpdateStatusModels Delete(string ID, string Seq) { string result = ""; UpdateStatusModels resModel = new UpdateStatusModels(); DataTable dtTransfer = FindDetailsByID(ID, Seq); DataRow dr = dtTransfer.Rows[0]; string FlagID = dr["FlagID"].ToString().Trim(); string ProductMo = dr["ProductMo"].ToString().Trim(); string GoodsID = dr["GoodsID"].ToString().Trim(); string LotNo = dr["LotNo"].ToString().Trim(); string LocID = dr["LocID"].ToString().Trim(); string NextLocID = dr["NextLocID"].ToString().Trim(); decimal Weg = 0 - (dr["TransferWeg"].ToString().Trim() != "" ? Convert.ToDecimal(dr["TransferWeg"].ToString().Trim()) : 0); decimal Qty = 0 - (dr["TransferQty"].ToString().Trim() != "" ? Convert.ToDecimal(dr["TransferQty"].ToString().Trim()) : 0); string CreateUser = ""; string CreateTime = System.DateTime.Now.ToString("yyyy/MM/dd HH:ss:mm"); DataTable dtFlag = BaseDataDAL.GetDocFlayReturnTable("wh_transfer", FlagID); string flag1 = dtFlag.Rows[0]["flag1"].ToString().Trim(); string flag2 = dtFlag.Rows[0]["flag2"].ToString().Trim(); bool valid_flag = true; result = CheckQtyStore(LocID, GoodsID, ProductMo, LotNo, flag1, Weg, Qty); if (result != "") { valid_flag = false; } else { if (flag2 == "TO") { result = CheckQtyStore(NextLocID, GoodsID, ProductMo, LotNo, "+", Weg, Qty); if (result != "") { valid_flag = false; } } } if (valid_flag == true) { string strSql = ""; strSql += string.Format(@" SET XACT_ABORT ON "); strSql += string.Format(@" BEGIN TRANSACTION "); strSql += string.Format(@"Delete From wm_TransferDetails Where ID='{0}' And Seq='{1}'", ID, Seq); strSql += string.Format(JoinUpdateStr("D", LocID, GoodsID, ProductMo, LotNo, flag1, Weg, Qty, CreateUser, CreateTime)); if (flag2 == "TO") { strSql += string.Format(JoinUpdateStr("D", NextLocID, GoodsID, ProductMo, LotNo, "+", Weg, Qty, CreateUser, CreateTime)); } strSql += string.Format(@" COMMIT TRANSACTION "); result = SQLHelper.ExecuteSqlUpdate(strSql); } if (result == "") { resModel.Status = "OK"; } else { resModel.Status = "ERROR"; resModel.Msg = result; } resModel.ReturnValue = ID; return(resModel); }
public static ProductDetail CreateVehicleProductDetail(SkuProductDetailModel productVehicledetail) { List <ProductCategory> productCategories = null; SpecifyProperty property35 = new SpecifyProperty() { CDataKey = "移动地址", CDataValue = string.Format("https://wx.tuhu.cn/Products/Details?pid={0}&source=wxshantou", !string.IsNullOrWhiteSpace(productVehicledetail.VariantID) ? productVehicledetail.ProductId + "&vid=" + productVehicledetail.VariantID : productVehicledetail.ProductId) }; SpecifyProperty property31 = new SpecifyProperty() { CDataKey = "重量", CDataValue = productVehicledetail.Weight }; SpecifyProperty property32 = new SpecifyProperty() { CDataKey = "颜色", CDataValue = productVehicledetail.Color }; ChoicePropertyList propertyList3 = new ChoicePropertyList() { SpecifyPropertyList = new List <SpecifyProperty>() { property35, string.IsNullOrWhiteSpace(property31.CDataValue) ? null : property31, string.IsNullOrWhiteSpace(property32.CDataValue) ? null : property32 } }; List <string> imageUrls = new List <string>(); if (productVehicledetail.ImageUrls != null && productVehicledetail.ImageUrls.Any()) { foreach (var imageUrl in productVehicledetail.ImageUrls) { imageUrls.Add("https://img3.tuhu.org" + imageUrl + "@484w_300h_100Q.jpg"); imageUrls.Add("https://img3.tuhu.org" + imageUrl + "@400w_400h_100Q.jpg"); } } if (productVehicledetail.NodeNo.Split(new char[] { '.' }).Count() >= 2) { string oids = productVehicledetail.NodeNo.Replace('.', ','); productCategories = BaseDataDAL.GetProductCategoryByOid(oids).ToList(); productCategories = productCategories.OrderByDescending(s => s.DescendantProductCount).ToList(); } ProductDetail detail = new ProductDetail() { CDataName = productVehicledetail.DisplayName, CDataOuterID = productVehicledetail.Pid, CDataSellerName = "途虎", CDataSellerSiteUrl = "https://www.tuhu.cn/", CDataTitle = productVehicledetail.ShuXing5, CDataImage = imageUrls[0], //CDataMoreImages = "<img index=\"1\">https://img3.tuhu.org/Images/Products/TW-DASUN-DSXL_02.jpg@100w_100h_100Q.jpg</img><img index=\"2\">https://img3.tuhu.org/Images/Products/TW-DASUN-DSXL_03.jpg@100w_100h_100Q.jpg</img><img index=\"3\">https://img3.tuhu.org/Images/Products/TW-DASUN-DSXL_04.jpg@100w_100h_100Q.jpg</img><img index=\"4\">https://img3.tuhu.org/Images/Products/TW-DASUN-DSXL_05.jpg@100w_100h_100Q.jpg</img>", ImageValues = imageUrls.Skip(1).Select(s => new ImageValue() { Index = imageUrls.IndexOf(s), CDataImg = s }).ToList(), CDataPrice = productVehicledetail.Price.ToString(), CDataBrand = productVehicledetail.Brand, CDataTargetUrl = "http://item.tuhu.cn/Products/" + productVehicledetail.ProductId + (!string.IsNullOrWhiteSpace(productVehicledetail.VariantID) ? "/" + productVehicledetail.VariantID + ".html" : ".html") + "?source=pcshantou", CDataCategory = "车品", CDataSubCategory = productCategories[1].DisplayName, CDataThirdCategory = productCategories[2].DisplayName, CDataCategoryUrl = "http://item.tuhu.cn/List/AutoProduct/", CDataSubCategoryUrl = "http://item.tuhu.cn/List/" + productCategories[1].CategoryName + "/", CDataThirdCategoryUrl = "http://item.tuhu.cn/List/" + productCategories[2].CategoryName + "/", Availability = 1, Bought = productVehicledetail.SalesQuantity, choiceProperties = propertyList3 }; return(detail); }