public static DataSet GetPagerData(int intPageSize, int intCurrentPageIndex) { int num = 0; int num2 = 0; return(GoodsSpecify.GetPagerData(intPageSize, intCurrentPageIndex, ref num, ref num2)); }
public static GoodsSpecifyInfo Get(int guigeID) { GoodsSpecifyInfo dataById = GoodsSpecify.GetDataById(guigeID); GoodsSpecifyInfo result; if (dataById != null) { result = GoodsSpecify.Get(GoodsSpecify.GetDataById(guigeID)); } else { result = null; } return(result); }
public static ProductInfo GetProduct(int intProductID) { ProductInfo dataById = Product.GetDataById(intProductID); if (dataById != null) { ProductModelInfo cacheModelById = ProductModel.GetCacheModelById(dataById.ModelID); dataById.CustomTable = Product.GetCustomContentInfo(intProductID, cacheModelById.TableName); dataById.PhotoAlbums = PhotoAlbum.GetPhotoAlbumByPID(intProductID); UserInfo user = User.GetLoginUser(); if (user != null) { dataById.MemberPriceSets = MemberPriceSet.GetList(dataById.MemberPriceSet, dataById.SellPrice); MemberPriceSetInfo memberPriceSetInfo = (from p in dataById.MemberPriceSets where p.UserLevelID.Equals(user.LevelID) select p).FirstOrDefault <MemberPriceSetInfo>(); if (memberPriceSetInfo != null) { dataById.MemberPrice = ((memberPriceSetInfo.Price > 0m) ? memberPriceSetInfo.Price : memberPriceSetInfo.DiscoutPrice); if (dataById.MemberPrice == 0m) { dataById.MemberPrice = dataById.SellPrice; } } } dataById.PriceRange = dataById.SellPrice.ToString("f2"); dataById.RealStock = dataById.Stock; if (dataById.ClassID > 0) { List <decimal> priceRange = GoodsSpecify.GetPriceRange(dataById); if (priceRange[0] == priceRange[1]) { dataById.PriceRange = priceRange[0].ToString("f2"); } else { dataById.PriceRange = priceRange[0].ToString("f2") + " - " + priceRange[1].ToString("f2"); } dataById.GuiGe = GoodsSpecify.GetListByProID(dataById.AutoID); if (dataById.GuiGe != null && dataById.GuiGe.Count > 0) { dataById.RealStock = dataById.GuiGe.Sum((GoodsSpecifyInfo p) => p.Stock); } } } return(dataById); }
public static void ReBackStock(ProductInfo pro, GoodsSpecifyInfo goodsattr, int intQuantity) { if (pro != null) { if (goodsattr != null) { goodsattr.Stock += intQuantity; GoodsSpecify.Update(goodsattr); } pro.Stock += intQuantity; BizBase.dbo.UpdateTable(string.Concat(new object[] { " update shop_Product set Stock=Stock+", intQuantity, " where AutoID= ", pro.AutoID })); } }
public static GoodsSpecifyInfo Get(int proID, string strGuiGe) { GoodsSpecifyInfo model = BizBase.dbo.GetModel <GoodsSpecifyInfo>(string.Concat(new object[] { " select top 1 * from shop_GoodsSpecify where ProID=", proID, " and Specification='", StringUtils.ChkSQL(strGuiGe), "' " })); GoodsSpecifyInfo result; if (model != null) { result = GoodsSpecify.Get(model); } else { result = null; } return(result); }
public static IList <GoodsSpecifyInfo> GetList(int intTopCount, string strCondition) { string strSort = " Sort asc,AutoID desc "; return(GoodsSpecify.GetList(intTopCount, strCondition, strSort)); }
public static IList <GoodsSpecifyInfo> GetTopNList(int intTopCount, string strSort) { return(GoodsSpecify.GetList(intTopCount, string.Empty, strSort)); }
public static IList <GoodsSpecifyInfo> GetAllList() { return(GoodsSpecify.GetList(0, string.Empty)); }
public static GoodsSpecifyInfo GetTopData() { return(GoodsSpecify.GetTopData(" Sort ASC,AutoID desc ")); }
public static IList <GoodsSpecifyInfo> GetPagerList(int intCurrentPageIndex, int intPageSize, ref int intTotalCount, ref int intTotalPage) { return(GoodsSpecify.GetPagerList("", "Sort ASC,AutoID DESC", intCurrentPageIndex, intPageSize, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strFilter, string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(GoodsSpecify.GetPagerData(strFilter, strCondition, " Sort asc,AutoID desc ", intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(GoodsSpecify.GetPagerData("*", strCondition, intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static void CancelExpireOrder(int intUserID) { DataTable dataTable = BizBase.dbo.GetDataTable(string.Concat(new object[] { " select ProID,GuiGePath,SUM(Quantity) as QuantityTotal from( select * from shop_OrderItem where OrderID in ( select AutoID from shop_orders where ", (intUserID > 0) ? ("UserID=" + intUserID + " and ") : "", " OrderStatus=", 1, " and GETDATE()>DATEADD(hour,", ConfigProvider.Configs.BuyPayExpire, ",OrderAddTime)) ) as A group by ProID,GuiGePath " })); if (dataTable != null && dataTable.Rows.Count > 0) { BizBase.dbo.InsertNoReValue(string.Concat(new object[] { " insert into shop_OrderAction(OrderID,Operator,OrderStatus,ActionNote,Remark,AutoTimeStamp) select AutoID,'系统',", 101, ",'订单创建后超过", ConfigProvider.Configs.BuyPayExpire, "小时未付款,系统自动关闭订单!','',getdate() from shop_orders where ", (intUserID > 0) ? (" UserID=" + intUserID + " and ") : "", " OrderStatus=", 1, " and GETDATE()>DATEADD(hour,", ConfigProvider.Configs.BuyPayExpire, ",OrderAddTime) " })); BizBase.dbo.UpdateTable(string.Concat(new object[] { " update shop_orders set OrderStatus=", 101, " where ", (intUserID > 0) ? (" UserID=" + intUserID + " and ") : "", " OrderStatus=", 1, " and GETDATE()>DATEADD(hour,", ConfigProvider.Configs.BuyPayExpire, ",OrderAddTime) " })); foreach (DataRow dataRow in dataTable.Rows) { Orders.ReBackStock(Product.GetDataById(WebUtils.GetInt(dataRow["ProID"])), GoodsSpecify.Get(WebUtils.GetInt(dataRow["ProID"]), dataRow["GuiGePath"].ToString()), WebUtils.GetInt(dataRow["QuantityTotal"])); } } }