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 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 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"])); } } }