public IList <OrdersGoodsTmpInfo> Get_Orders_Carts(int Orders_ID) { IList <OrdersGoodsInfo> OrderGoods = MyOrders.GetGoodsListByOrderID(Orders_ID); OrdersGoodsTmpInfo cart; IList <OrdersGoodsTmpInfo> Cartinfos = null; if (OrderGoods != null) { Cartinfos = new List <OrdersGoodsTmpInfo>(); foreach (OrdersGoodsInfo goods in OrderGoods) { cart = new OrdersGoodsTmpInfo(); cart.Orders_Goods_ID = goods.Orders_Goods_ID; cart.Orders_Goods_BuyerID = goods.Orders_Goods_ID; cart.Orders_Goods_Amount = goods.Orders_Goods_Amount; cart.Orders_Goods_ParentID = goods.Orders_Goods_ParentID; cart.Orders_Goods_Product_BrandID = goods.Orders_Goods_Product_BrandID; cart.Orders_Goods_Product_CateID = goods.Orders_Goods_Product_CateID; cart.Orders_Goods_Product_ID = goods.Orders_Goods_Product_ID; cart.Orders_Goods_Product_IsFavor = goods.Orders_Goods_Product_IsFavor; cart.Orders_Goods_Product_Price = goods.Orders_Goods_Product_Price; cart.Orders_Goods_Type = goods.Orders_Goods_Type; Cartinfos.Add(cart); cart = null; } } return(Cartinfos); }
public virtual bool EditOrdersGoodsTmp(OrdersGoodsTmpInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM Orders_Goods_tmp WHERE Orders_Goods_ID = " + entity.Orders_Goods_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["Orders_Goods_ID"] = entity.Orders_Goods_ID; DrAdd["Orders_Goods_Type"] = entity.Orders_Goods_Type; DrAdd["Orders_Goods_BuyerID"] = entity.Orders_Goods_BuyerID; DrAdd["Orders_Goods_SessionID"] = entity.Orders_Goods_SessionID; DrAdd["Orders_Goods_ParentID"] = entity.Orders_Goods_ParentID; DrAdd["Orders_Goods_Product_ID"] = entity.Orders_Goods_Product_ID; DrAdd["Orders_Goods_Product_SupplierID"] = entity.Orders_Goods_Product_SupplierID; DrAdd["Orders_Goods_Product_Code"] = entity.Orders_Goods_Product_Code; DrAdd["Orders_Goods_Product_CateID"] = entity.Orders_Goods_Product_CateID; DrAdd["Orders_Goods_Product_BrandID"] = entity.Orders_Goods_Product_BrandID; DrAdd["Orders_Goods_Product_Name"] = entity.Orders_Goods_Product_Name; DrAdd["Orders_Goods_Product_Img"] = entity.Orders_Goods_Product_Img; DrAdd["Orders_Goods_Product_Price"] = entity.Orders_Goods_Product_Price; DrAdd["Orders_Goods_Product_MKTPrice"] = entity.Orders_Goods_Product_MKTPrice; DrAdd["Orders_Goods_Product_Maker"] = entity.Orders_Goods_Product_Maker; DrAdd["Orders_Goods_Product_Spec"] = entity.Orders_Goods_Product_Spec; DrAdd["Orders_Goods_Product_DeliveryDate"] = entity.Orders_Goods_Product_DeliveryDate; DrAdd["Orders_Goods_Product_AuthorizeCode"] = entity.Orders_Goods_Product_AuthorizeCode; DrAdd["Orders_Goods_Product_brokerage"] = entity.Orders_Goods_Product_brokerage; DrAdd["Orders_Goods_Product_SalePrice"] = entity.Orders_Goods_Product_SalePrice; DrAdd["Orders_Goods_Product_PurchasingPrice"] = entity.Orders_Goods_Product_PurchasingPrice; DrAdd["Orders_Goods_Product_Coin"] = entity.Orders_Goods_Product_Coin; DrAdd["Orders_Goods_Product_IsFavor"] = entity.Orders_Goods_Product_IsFavor; DrAdd["Orders_Goods_Product_UseCoin"] = entity.Orders_Goods_Product_UseCoin; DrAdd["Orders_Goods_Amount"] = entity.Orders_Goods_Amount; DrAdd["Orders_Goods_Addtime"] = entity.Orders_Goods_Addtime; DrAdd["Orders_Goods_OrdersID"] = entity.Orders_Goods_OrdersID; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual OrdersGoodsTmpInfo GetOrdersGoodsTmpByID(int ID) { OrdersGoodsTmpInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM Orders_Goods_tmp WHERE Orders_Goods_ID = " + ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new OrdersGoodsTmpInfo(); entity.Orders_Goods_ID = Tools.NullInt(RdrList["Orders_Goods_ID"]); entity.Orders_Goods_Type = Tools.NullInt(RdrList["Orders_Goods_Type"]); entity.Orders_Goods_BuyerID = Tools.NullInt(RdrList["Orders_Goods_BuyerID"]); entity.Orders_Goods_SessionID = Tools.NullStr(RdrList["Orders_Goods_SessionID"]); entity.Orders_Goods_ParentID = Tools.NullInt(RdrList["Orders_Goods_ParentID"]); entity.Orders_Goods_Product_ID = Tools.NullInt(RdrList["Orders_Goods_Product_ID"]); entity.Orders_Goods_Product_SupplierID = Tools.NullInt(RdrList["Orders_Goods_Product_SupplierID"]); entity.Orders_Goods_Product_Code = Tools.NullStr(RdrList["Orders_Goods_Product_Code"]); entity.Orders_Goods_Product_CateID = Tools.NullInt(RdrList["Orders_Goods_Product_CateID"]); entity.Orders_Goods_Product_BrandID = Tools.NullInt(RdrList["Orders_Goods_Product_BrandID"]); entity.Orders_Goods_Product_Name = Tools.NullStr(RdrList["Orders_Goods_Product_Name"]); entity.Orders_Goods_Product_Img = Tools.NullStr(RdrList["Orders_Goods_Product_Img"]); entity.Orders_Goods_Product_Price = Tools.NullDbl(RdrList["Orders_Goods_Product_Price"]); entity.Orders_Goods_Product_MKTPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_MKTPrice"]); entity.Orders_Goods_Product_Maker = Tools.NullStr(RdrList["Orders_Goods_Product_Maker"]); entity.Orders_Goods_Product_Spec = Tools.NullStr(RdrList["Orders_Goods_Product_Spec"]); entity.Orders_Goods_Product_DeliveryDate = Tools.NullStr(RdrList["Orders_Goods_Product_DeliveryDate"]); entity.Orders_Goods_Product_AuthorizeCode = Tools.NullStr(RdrList["Orders_Goods_Product_AuthorizeCode"]); entity.Orders_Goods_Product_brokerage = Tools.NullDbl(RdrList["Orders_Goods_Product_brokerage"]); entity.Orders_Goods_Product_SalePrice = Tools.NullDbl(RdrList["Orders_Goods_Product_SalePrice"]); entity.Orders_Goods_Product_PurchasingPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_PurchasingPrice"]); entity.Orders_Goods_Product_Coin = Tools.NullInt(RdrList["Orders_Goods_Product_Coin"]); entity.Orders_Goods_Product_IsFavor = Tools.NullInt(RdrList["Orders_Goods_Product_IsFavor"]); entity.Orders_Goods_Product_UseCoin = Tools.NullInt(RdrList["Orders_Goods_Product_UseCoin"]); entity.Orders_Goods_Amount = Tools.NullInt(RdrList["Orders_Goods_Amount"]); entity.Orders_Goods_Addtime = Tools.NullDate(RdrList["Orders_Goods_Addtime"]); entity.Orders_Goods_OrdersID = Tools.NullInt(RdrList["Orders_Goods_OrdersID"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool EditOrdersGoodsTmp(OrdersGoodsTmpInfo entity) { return(MyDAL.EditOrdersGoodsTmp(entity)); }
public virtual IList <OrdersGoodsTmpInfo> GetOrdersGoodsTmpsByOrdersID(int Orders_ID) { IList <OrdersGoodsTmpInfo> entitys = null; OrdersGoodsTmpInfo entity = null; string SqlList; SqlDataReader RdrList = null; try { SqlList = "Select * from Orders_goods_Tmp where Orders_Goods_OrdersID=" + Orders_ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <OrdersGoodsTmpInfo>(); while (RdrList.Read()) { entity = new OrdersGoodsTmpInfo(); entity.Orders_Goods_ID = Tools.NullInt(RdrList["Orders_Goods_ID"]); entity.Orders_Goods_Type = Tools.NullInt(RdrList["Orders_Goods_Type"]); entity.Orders_Goods_BuyerID = Tools.NullInt(RdrList["Orders_Goods_BuyerID"]); entity.Orders_Goods_SessionID = Tools.NullStr(RdrList["Orders_Goods_SessionID"]); entity.Orders_Goods_ParentID = Tools.NullInt(RdrList["Orders_Goods_ParentID"]); entity.Orders_Goods_Product_ID = Tools.NullInt(RdrList["Orders_Goods_Product_ID"]); entity.Orders_Goods_Product_SupplierID = Tools.NullInt(RdrList["Orders_Goods_Product_SupplierID"]); entity.Orders_Goods_Product_Code = Tools.NullStr(RdrList["Orders_Goods_Product_Code"]); entity.Orders_Goods_Product_CateID = Tools.NullInt(RdrList["Orders_Goods_Product_CateID"]); entity.Orders_Goods_Product_BrandID = Tools.NullInt(RdrList["Orders_Goods_Product_BrandID"]); entity.Orders_Goods_Product_Name = Tools.NullStr(RdrList["Orders_Goods_Product_Name"]); entity.Orders_Goods_Product_Img = Tools.NullStr(RdrList["Orders_Goods_Product_Img"]); entity.Orders_Goods_Product_Price = Tools.NullDbl(RdrList["Orders_Goods_Product_Price"]); entity.Orders_Goods_Product_MKTPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_MKTPrice"]); entity.Orders_Goods_Product_Maker = Tools.NullStr(RdrList["Orders_Goods_Product_Maker"]); entity.Orders_Goods_Product_Spec = Tools.NullStr(RdrList["Orders_Goods_Product_Spec"]); entity.Orders_Goods_Product_DeliveryDate = Tools.NullStr(RdrList["Orders_Goods_Product_DeliveryDate"]); entity.Orders_Goods_Product_AuthorizeCode = Tools.NullStr(RdrList["Orders_Goods_Product_AuthorizeCode"]); entity.Orders_Goods_Product_brokerage = Tools.NullDbl(RdrList["Orders_Goods_Product_brokerage"]); entity.Orders_Goods_Product_SalePrice = Tools.NullDbl(RdrList["Orders_Goods_Product_SalePrice"]); entity.Orders_Goods_Product_PurchasingPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_PurchasingPrice"]); entity.Orders_Goods_Product_Coin = Tools.NullInt(RdrList["Orders_Goods_Product_Coin"]); entity.Orders_Goods_Product_IsFavor = Tools.NullInt(RdrList["Orders_Goods_Product_IsFavor"]); entity.Orders_Goods_Product_UseCoin = Tools.NullInt(RdrList["Orders_Goods_Product_UseCoin"]); entity.Orders_Goods_Amount = Tools.NullInt(RdrList["Orders_Goods_Amount"]); entity.Orders_Goods_Addtime = Tools.NullDate(RdrList["Orders_Goods_Addtime"]); entity.Orders_Goods_OrdersID = Tools.NullInt(RdrList["Orders_Goods_OrdersID"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual IList <OrdersGoodsTmpInfo> GetOrdersGoodsTmps(QueryInfo Query) { int PageSize; int CurrentPage; IList <OrdersGoodsTmpInfo> entitys = null; OrdersGoodsTmpInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "Orders_Goods_tmp"; SqlField = "*"; SqlParam = DBHelper.GetSqlParam(Query.ParamInfos); SqlOrder = DBHelper.GetSqlOrder(Query.OrderInfos); SqlList = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize); RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <OrdersGoodsTmpInfo>(); while (RdrList.Read()) { entity = new OrdersGoodsTmpInfo(); entity.Orders_Goods_ID = Tools.NullInt(RdrList["Orders_Goods_ID"]); entity.Orders_Goods_Type = Tools.NullInt(RdrList["Orders_Goods_Type"]); entity.Orders_Goods_BuyerID = Tools.NullInt(RdrList["Orders_Goods_BuyerID"]); entity.Orders_Goods_SessionID = Tools.NullStr(RdrList["Orders_Goods_SessionID"]); entity.Orders_Goods_ParentID = Tools.NullInt(RdrList["Orders_Goods_ParentID"]); entity.Orders_Goods_Product_ID = Tools.NullInt(RdrList["Orders_Goods_Product_ID"]); entity.Orders_Goods_Product_SupplierID = Tools.NullInt(RdrList["Orders_Goods_Product_SupplierID"]); entity.Orders_Goods_Product_Code = Tools.NullStr(RdrList["Orders_Goods_Product_Code"]); entity.Orders_Goods_Product_CateID = Tools.NullInt(RdrList["Orders_Goods_Product_CateID"]); entity.Orders_Goods_Product_BrandID = Tools.NullInt(RdrList["Orders_Goods_Product_BrandID"]); entity.Orders_Goods_Product_Name = Tools.NullStr(RdrList["Orders_Goods_Product_Name"]); entity.Orders_Goods_Product_Img = Tools.NullStr(RdrList["Orders_Goods_Product_Img"]); entity.Orders_Goods_Product_Price = Tools.NullDbl(RdrList["Orders_Goods_Product_Price"]); entity.Orders_Goods_Product_MKTPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_MKTPrice"]); entity.Orders_Goods_Product_Maker = Tools.NullStr(RdrList["Orders_Goods_Product_Maker"]); entity.Orders_Goods_Product_Spec = Tools.NullStr(RdrList["Orders_Goods_Product_Spec"]); entity.Orders_Goods_Product_DeliveryDate = Tools.NullStr(RdrList["Orders_Goods_Product_DeliveryDate"]); entity.Orders_Goods_Product_AuthorizeCode = Tools.NullStr(RdrList["Orders_Goods_Product_AuthorizeCode"]); entity.Orders_Goods_Product_brokerage = Tools.NullDbl(RdrList["Orders_Goods_Product_brokerage"]); entity.Orders_Goods_Product_SalePrice = Tools.NullDbl(RdrList["Orders_Goods_Product_SalePrice"]); entity.Orders_Goods_Product_PurchasingPrice = Tools.NullDbl(RdrList["Orders_Goods_Product_PurchasingPrice"]); entity.Orders_Goods_Product_Coin = Tools.NullInt(RdrList["Orders_Goods_Product_Coin"]); entity.Orders_Goods_Product_IsFavor = Tools.NullInt(RdrList["Orders_Goods_Product_IsFavor"]); entity.Orders_Goods_Product_UseCoin = Tools.NullInt(RdrList["Orders_Goods_Product_UseCoin"]); entity.Orders_Goods_Amount = Tools.NullInt(RdrList["Orders_Goods_Amount"]); entity.Orders_Goods_Addtime = Tools.NullDate(RdrList["Orders_Goods_Addtime"]); entity.Orders_Goods_OrdersID = Tools.NullInt(RdrList["Orders_Goods_OrdersID"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }