private GiftOrderProduct BuildModel(IDataReader reader) { GiftOrderProduct op = new GiftOrderProduct(); op.ProductID = Convert.ToInt32(reader["productId"]); op.ProductName = reader["productName"].ToString(); op.ProductUrl = ConfigurationManager.AppSettings["foreFlatRootUrl"] + "/gift/GiftDetail.aspx?productId=" + op.ProductID; op.ProductImg = reader["SmallImage"].ToString(); op.CatePath = String.Empty; op.TradePrice = 0m; op.MerchantPrice = 0m; op.Stock = Convert.ToInt32(reader["Stock"]); op.ReducePrice = 0m; op.Score = Convert.ToInt32(reader["Score"]); op.Weight = 0m; return op; }
private GiftOrderProduct BuildModel(IDataReader reader) { GiftOrderProduct op = new GiftOrderProduct(); op.ProductID = Convert.ToInt32(reader["productId"]); op.ProductName = reader["productName"].ToString(); op.ProductUrl = ConfigurationManager.AppSettings["foreFlatRootUrl"] + "/gift/GiftDetail.aspx?productId=" + op.ProductID; op.ProductImg = reader["SmallImage"].ToString(); op.CatePath = String.Empty; op.TradePrice = 0m; op.MerchantPrice = 0m; op.Stock = Convert.ToInt32(reader["Stock"]); op.ReducePrice = 0m; op.Score = Convert.ToInt32(reader["Score"]); op.Weight = 0m; return(op); }
private OrderProduct GetOrderProductBll(OrderType opType) { OrderProduct bll = null; switch (opType) { case OrderType.Common: bll = new CommOrderProduct(); break; case OrderType.Gift: bll = new GiftOrderProduct(); break; case OrderType.Suit: bll = new SuitOrderProduct(); break; } return(bll); }
public override OrderProduct CreateOrderProduct(int productId, int quantity, OrderType opType, System.Collections.Specialized.NameValueCollection paras) { GiftOrderProduct op = null; string sql = "SELECT productId,productName,Stock,SmallImage,Status,Score FROM pdGift where status=1 and stock>0 and productid=@productid"; DbCommand comm = CommDataAccess.DbReader.GetSqlStringCommand(sql); CommDataAccess.DbReader.AddInParameter(comm, "productId", DbType.Int32, productId); using (IDataReader reader = CommDataAccess.DbReader.ExecuteReader(comm)) { if (reader.Read()) { op = BuildModel(reader); op.SetQuantiy(quantity); op.ProductType = opType; int typecode; if (int.TryParse(paras["typecode"], out typecode)) { typecode = 0; } op.TypeCode = typecode; } } return(op); }
private OrderProduct GetOrderProductBll(OrderType opType) { OrderProduct bll = null; switch (opType) { case OrderType.Common: bll = new CommOrderProduct(); break; case OrderType.Gift: bll = new GiftOrderProduct(); break; case OrderType.Suit: bll = new SuitOrderProduct(); break; } return bll; }