コード例 #1
0
        public BargainDetialInfo GetBargainDetialInfo(int id)
        {
            BargainDetialInfo info             = new BargainDetialInfo();
            DbCommand         sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_BargainDetial WHERE id = @id AND IsDelete=0");

            this.database.AddInParameter(sqlStringCommand, "id", DbType.Int32, id);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                return(ReaderConvert.ReaderToModel <BargainDetialInfo>(reader));
            }
        }
コード例 #2
0
ファイル: BargainDao.cs プロジェクト: zwkjgs/XKD
        public BargainDetialInfo GetBargainDetialInfo(int id)
        {
            BargainDetialInfo result = new BargainDetialInfo();

            System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_BargainDetial WHERE id = @id AND IsDelete=0");
            this.database.AddInParameter(sqlStringCommand, "id", System.Data.DbType.Int32, id);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                result = ReaderConvert.ReaderToModel <BargainDetialInfo>(dataReader);
            }
            return(result);
        }
コード例 #3
0
        public bool InsertBargainDetial(BargainDetialInfo bargainDetial, out int bargainDetialId)
        {
            bargainDetialId = 0;
            string    query            = "insert into Hishop_BargainDetial(UserId,BargainId,Number,Price,NumberOfParticipants,CreateDate,Sku) values(@UserId,@BargainId,@Number,@Price,@NumberOfParticipants,@CreateDate,@Sku)";
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand(query);

            this.database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, bargainDetial.UserId);
            this.database.AddInParameter(sqlStringCommand, "BargainId", DbType.Int32, bargainDetial.BargainId);
            this.database.AddInParameter(sqlStringCommand, "Number", DbType.Int32, bargainDetial.Number);
            this.database.AddInParameter(sqlStringCommand, "Price", DbType.Decimal, bargainDetial.Price);
            this.database.AddInParameter(sqlStringCommand, "NumberOfParticipants", DbType.Int32, bargainDetial.NumberOfParticipants);
            this.database.AddInParameter(sqlStringCommand, "CreateDate", DbType.DateTime, bargainDetial.CreateDate);
            this.database.AddInParameter(sqlStringCommand, "Sku", DbType.String, bargainDetial.Sku);
            bool flag = this.database.ExecuteNonQuery(sqlStringCommand) > 0;

            if (flag)
            {
                string str2 = "select max(id) from Hishop_BargainDetial ";
                sqlStringCommand = this.database.GetSqlStringCommand(str2);
                bargainDetialId  = (int)this.database.ExecuteScalar(sqlStringCommand);
            }
            return(flag);
        }
コード例 #4
0
        public ShoppingCartItemInfo GetCartItemInfo(MemberInfo member, string skuId, int quantity, int type = 0, int bargainDetialId = 0, int limitedTimeDiscountId = 0)
        {
            ShoppingCartItemInfo info = null;
            DbCommand            storedProcCommand = this.database.GetStoredProcCommand("ss_ShoppingCart_GetItemInfo");

            this.database.AddInParameter(storedProcCommand, "Quantity", DbType.Int32, quantity);
            this.database.AddInParameter(storedProcCommand, "UserId", DbType.Int32, (member != null) ? member.UserId : 0);
            this.database.AddInParameter(storedProcCommand, "SkuId", DbType.String, skuId);
            this.database.AddInParameter(storedProcCommand, "GradeId", DbType.Int32, (member != null) ? member.GradeId : 0);
            this.database.AddInParameter(storedProcCommand, "Type", DbType.Int32, type);
            using (IDataReader reader = this.database.ExecuteReader(storedProcCommand))
            {
                if (!reader.Read())
                {
                    return(info);
                }
                info = new ShoppingCartItemInfo {
                    SkuId            = skuId,
                    Quantity         = quantity,
                    MainCategoryPath = reader["MainCategoryPath"].ToString(),
                    ProductId        = (int)reader["ProductId"]
                };
                if (DBNull.Value != reader["CubicMeter"])
                {
                    info.CubicMeter = (decimal)reader["CubicMeter"];
                }
                if (DBNull.Value != reader["FreightWeight"])
                {
                    info.FreightWeight = (decimal)reader["FreightWeight"];
                }
                if (reader["SKU"] != DBNull.Value)
                {
                    info.SKU = (string)reader["SKU"];
                }
                info.Name = (string)reader["ProductName"];
                if (DBNull.Value != reader["Weight"])
                {
                    info.Weight = (int)reader["Weight"];
                }
                if (DBNull.Value != reader["FreightTemplateId"])
                {
                    info.FreightTemplateId = (int)reader["FreightTemplateId"];
                }
                else
                {
                    info.FreightTemplateId = 0;
                }
                if (DBNull.Value != reader["ThirdCommission"])
                {
                    info.ThirdCommission = (decimal)reader["ThirdCommission"];
                }
                else
                {
                    info.ThirdCommission = 0M;
                }
                if (DBNull.Value != reader["SecondCommission"])
                {
                    info.SecondCommission = (decimal)reader["SecondCommission"];
                }
                else
                {
                    info.SecondCommission = 0M;
                }
                if (DBNull.Value != reader["FirstCommission"])
                {
                    info.FirstCommission = (decimal)reader["FirstCommission"];
                }
                else
                {
                    info.FirstCommission = 0M;
                }
                if (DBNull.Value != reader["IsSetCommission"])
                {
                    info.IsSetCommission = (bool)reader["IsSetCommission"];
                }
                else
                {
                    info.IsSetCommission = false;
                }
                BargainDetialInfo bargainDetialInfo = null;
                if (bargainDetialId > 0)
                {
                    bargainDetialInfo = new BargainDao().GetBargainDetialInfo(bargainDetialId);
                }
                if ((bargainDetialId > 0) && (bargainDetialInfo != null))
                {
                    info.MemberPrice = info.AdjustedPrice = bargainDetialInfo.Price;
                }
                else
                {
                    info.MemberPrice = info.AdjustedPrice = decimal.Round((decimal)reader["SalePrice"], 2);
                }
                if (limitedTimeDiscountId > 0)
                {
                    LimitedTimeDiscountProductInfo info3 = new LimitedTimeDiscountDao().GetLimitedTimeDiscountProductByLimitIdAndProductIdAndUserId(limitedTimeDiscountId, info.ProductId, (member != null) ? member.UserId : 0);
                    if (((info3 != null) && (info3.BeginTime <= DateTime.Now)) && (DateTime.Now < info3.EndTime))
                    {
                        info.MemberPrice           = info.AdjustedPrice = decimal.Round(info3.FinalPrice, 2);
                        info.LimitedTimeDiscountId = limitedTimeDiscountId;
                    }
                    else
                    {
                        info.LimitedTimeDiscountId = 0;
                    }
                }
                else
                {
                    info.LimitedTimeDiscountId = 0;
                }
                if (DBNull.Value != reader["ThumbnailUrl40"])
                {
                    info.ThumbnailUrl40 = reader["ThumbnailUrl40"].ToString();
                }
                if (DBNull.Value != reader["ThumbnailUrl60"])
                {
                    info.ThumbnailUrl60 = reader["ThumbnailUrl60"].ToString();
                }
                if (DBNull.Value != reader["ThumbnailUrl100"])
                {
                    info.ThumbnailUrl100 = reader["ThumbnailUrl100"].ToString();
                }
                if (DBNull.Value != reader["IsfreeShipping"])
                {
                    info.IsfreeShipping = Convert.ToBoolean(reader["IsfreeShipping"]);
                }
                string str = string.Empty;
                if (reader.NextResult())
                {
                    while (reader.Read())
                    {
                        if (((reader["AttributeName"] != DBNull.Value) && !string.IsNullOrEmpty((string)reader["AttributeName"])) && ((reader["ValueStr"] != DBNull.Value) && !string.IsNullOrEmpty((string)reader["ValueStr"])))
                        {
                            object obj2 = str;
                            str = string.Concat(new object[] { obj2, reader["AttributeName"], ":", reader["ValueStr"], "; " });
                        }
                    }
                }
                info.SkuContent = str;
                if (reader.NextResult())
                {
                    while (reader.Read())
                    {
                        info.Type = 1;
                        if (DBNull.Value != reader["ProductNumber"])
                        {
                            info.ProductNumber = Convert.ToInt32(reader["ProductNumber"]);
                        }
                        if (DBNull.Value != reader["PointNumber"])
                        {
                            info.PointNumber = Convert.ToInt32(reader["PointNumber"]);
                        }
                        if (DBNull.Value != reader["status"])
                        {
                            info.Status = Convert.ToInt32(reader["status"]);
                        }
                        if (DBNull.Value != reader["exChangeId"])
                        {
                            info.ExchangeId = Convert.ToInt32(reader["exChangeId"]);
                        }
                    }
                    return(info);
                }
                info.Type = 0;
            }
            return(info);
        }
コード例 #5
0
ファイル: VBargainDetial.cs プロジェクト: 123456-cq/xkq34_src
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["id"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(this.bargainId, currentMember.UserId);
                if (bargainDetialInfo != null)
                {
                    this.Page.Response.Redirect(string.Concat(new object[] { "InviteBargainDetial.aspx?bargainId=", this.bargainId, "&bargainDetialId=", bargainDetialInfo.Id, "&ReferralId=", this.Page.Request.QueryString["ReferralId"] }));
                }
            }
            this.litProdcutName              = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription         = (Literal)this.FindControl("litShortDescription");
            this.litSalePrice                = (Literal)this.FindControl("litSalePrice");
            this.litFloorPrice               = (Literal)this.FindControl("litFloorPrice");
            this.litFloorPrice1              = (Literal)this.FindControl("litFloorPrice1");
            this.litPurchaseNumber           = (Literal)this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (Literal)this.FindControl("litParticipantNumber");
            this.litProductDesc              = (Literal)this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (Literal)this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (Literal)this.FindControl("litProductCommentTotal");
            this.litStock           = (Literal)this.FindControl("litStock");
            this.hiddHasCollected   = (HtmlInputHidden)this.FindControl("hiddHasCollected");
            this.hiddProductId      = (HtmlInputHidden)this.FindControl("hiddProductId");
            this.hiddEndDate        = (HtmlInputHidden)this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (HtmlInputHidden)this.FindControl("hiddPurchaseNumber");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.hideTitle          = (HtmlInputHidden)this.FindControl("hideTitle");
            this.hideImgUrl         = (HtmlInputHidden)this.FindControl("hideImgUrl");
            this.hideDesc           = (HtmlInputHidden)this.FindControl("hideDesc");
            bool        flag        = false;
            BargainInfo bargainInfo = BargainHelper.GetBargainInfo(this.bargainId);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litFloorPrice1.Text       = bargainInfo.FloorPrice.ToString("F2");
                this.litSalePrice.Text         = bargainInfo.InitialPrice.ToString("f2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.HelpBargainCount(this.bargainId).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string activityCover = bargainInfo.ActivityCover;
                string str2          = string.Empty;
                Uri    url           = HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    if (productDetails == null)
                    {
                        this.Context.Response.Write("<script>alert('该商品不存在!');location.href='/default.aspx';</script>");
                        this.Context.Response.End();
                    }
                    else
                    {
                        this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                        this.litProdcutName.Text      = productDetails.ProductName;
                        this.litShortDescription.Text = productDetails.ProductShortName;
                        this.hideImgUrl.Value         = string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str2 + activityCover) : (str2 + productDetails.ThumbnailUrl60);
                        this.litProductDesc.Text      = productDetails.Description;
                        //if (this.rptProductImages != null)
                        //{
                        //    string locationUrl = "javascript:;";
                        //    SlideImage[] imageArray = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                        //    if (CS$<>9__CachedAnonymousMethodDelegate1 == null)
                        //    {
                        //        CS$<>9__CachedAnonymousMethodDelegate1 = new Func<SlideImage, bool>(null, (IntPtr) <AttachChildControls>b__0);
                        //    }
                        //    this.rptProductImages.DataSource = Enumerable.Where<SlideImage>(imageArray, CS$<>9__CachedAnonymousMethodDelegate1);
                        //    this.rptProductImages.DataBind();
                        //}
                        if (this.rptProductImages != null)
                        {
                            string       locationUrl = "javascript:;";
                            SlideImage[] imageArray  = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                            this.rptProductImages.DataSource = from item in imageArray
                                                               where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                               select item;
                            this.rptProductImages.DataBind();
                        }
                        int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                        this.litProductConsultationTotal.SetWhenIsNotNull(productConsultationsCount.ToString());
                        this.litProductCommentTotal.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId).ToString());
                    }
                }
            }
        }
コード例 #6
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["bargainId"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            this.litProdcutName              = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription         = (Literal)this.FindControl("litShortDescription");
            this.litSalePrice                = (Literal)this.FindControl("litSalePrice");
            this.litFloorPrice               = (Literal)this.FindControl("litFloorPrice");
            this.litFloorPrice1              = (Literal)this.FindControl("litFloorPrice1");
            this.litPurchaseNumber           = (Literal)this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (Literal)this.FindControl("litParticipantNumber");
            this.litProductDesc              = (Literal)this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (Literal)this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (Literal)this.FindControl("litProductCommentTotal");
            this.litStock           = (Literal)this.FindControl("litStock");
            this.hiddHasCollected   = (HtmlInputHidden)this.FindControl("hiddHasCollected");
            this.hiddProductId      = (HtmlInputHidden)this.FindControl("hiddProductId");
            this.hideTitle          = (HtmlInputHidden)this.FindControl("hideTitle");
            this.hideImgUrl         = (HtmlInputHidden)this.FindControl("hideImgUrl");
            this.hideDesc           = (HtmlInputHidden)this.FindControl("hideDesc");
            this.hiddEndDate        = (HtmlInputHidden)this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (HtmlInputHidden)this.FindControl("hiddPurchaseNumber");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            MemberInfo  currentMember = MemberProcessor.GetCurrentMember();
            bool        flag          = false;
            BargainInfo bargainInfo   = BargainHelper.GetBargainInfo(this.bargainId);

            if (bargainInfo != null)
            {
                this.hideTitle.Value = bargainInfo.Title;
                this.hideDesc.Value  = bargainInfo.Remarks;
                Uri    url           = HttpContext.Current.Request.Url;
                string activityCover = bargainInfo.ActivityCover;
                string str2          = string.Empty;
                if (!activityCover.StartsWith("http"))
                {
                    str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                int id = Globals.RequestQueryNum("bargainDetialId");
                if (id > 0)
                {
                    BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(id);
                    if ((currentMember == null) || (((currentMember != null) && (bargainDetialInfo != null)) && (bargainDetialInfo.UserId != currentMember.UserId)))
                    {
                        HttpContext.Current.Response.Redirect(string.Concat(new object[] { "HelpBargainDetial.aspx?bargainId=", this.bargainId, "&bargainDetialId=", id }));
                        HttpContext.Current.Response.End();
                    }
                }
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litFloorPrice1.Text       = bargainInfo.FloorPrice.ToString("F2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.HelpBargainCount(this.bargainId).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                    this.litProdcutName.Text      = productDetails.ProductName;
                    this.litShortDescription.Text = productDetails.ShortDescription;
                    this.litSalePrice.Text        = productDetails.MinSalePrice.ToString("f2");
                    this.litProductDesc.Text      = productDetails.Description;
                    this.hideImgUrl.Value         = string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str2 + activityCover) : (str2 + productDetails.ThumbnailUrl60);
                    if (this.rptProductImages != null)
                    {
                        string       locationUrl = "javascript:;";
                        SlideImage[] imageArray  = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                        this.rptProductImages.DataSource = from item in imageArray
                                                           where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                           select item;
                        this.rptProductImages.DataBind();
                    }
                    int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                    this.litProductConsultationTotal.SetWhenIsNotNull(productConsultationsCount.ToString());
                    this.litProductCommentTotal.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId).ToString());
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
        }
コード例 #7
0
        public ShoppingCartItemInfo GetCartItemInfo(DateTime startSendDate, int quantityPerDay, int sendDays, MemberInfo member, string skuId, int quantity, int type = 0, int bargainDetialId = 0, int limitedTimeDiscountId = 0)
        {
            ShoppingCartItemInfo shoppingCartItemInfo = null;

            System.Data.Common.DbCommand storedProcCommand = this.database.GetStoredProcCommand("ss_ShoppingCart_GetItemInfo");
            this.database.AddInParameter(storedProcCommand, "Quantity", System.Data.DbType.Int32, quantity);
            this.database.AddInParameter(storedProcCommand, "UserId", System.Data.DbType.Int32, (member != null) ? member.UserId : 0);
            this.database.AddInParameter(storedProcCommand, "SkuId", System.Data.DbType.String, skuId);
            this.database.AddInParameter(storedProcCommand, "GradeId", System.Data.DbType.Int32, (member != null) ? member.GradeId : 0);
            this.database.AddInParameter(storedProcCommand, "Type", System.Data.DbType.Int32, type);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(storedProcCommand))
            {
                if (dataReader.Read())
                {
                    shoppingCartItemInfo       = new ShoppingCartItemInfo();
                    shoppingCartItemInfo.SkuId = skuId;
                    ShoppingCartItemInfo arg_E7_0 = shoppingCartItemInfo;
                    shoppingCartItemInfo.ShippQuantity = quantity;

                    arg_E7_0.Quantity = quantity;
                    shoppingCartItemInfo.MainCategoryPath = dataReader["MainCategoryPath"].ToString();
                    shoppingCartItemInfo.ProductId        = (int)dataReader["ProductId"];
                    if (DBNull.Value != dataReader["CubicMeter"])
                    {
                        shoppingCartItemInfo.CubicMeter = (decimal)dataReader["CubicMeter"];
                    }
                    if (DBNull.Value != dataReader["FreightWeight"])
                    {
                        shoppingCartItemInfo.FreightWeight = (decimal)dataReader["FreightWeight"];
                    }
                    if (dataReader["SKU"] != DBNull.Value)
                    {
                        shoppingCartItemInfo.SKU = (string)dataReader["SKU"];
                    }
                    shoppingCartItemInfo.Name = (string)dataReader["ProductName"];
                    if (DBNull.Value != dataReader["Weight"])
                    {
                        shoppingCartItemInfo.Weight = (int)dataReader["Weight"];
                    }
                    if (DBNull.Value != dataReader["FreightTemplateId"])
                    {
                        shoppingCartItemInfo.FreightTemplateId = (int)dataReader["FreightTemplateId"];
                    }
                    else
                    {
                        shoppingCartItemInfo.FreightTemplateId = 0;
                    }
                    if (DBNull.Value != dataReader["ThirdCommission"])
                    {
                        shoppingCartItemInfo.ThirdCommission = (decimal)dataReader["ThirdCommission"];
                    }
                    else
                    {
                        shoppingCartItemInfo.ThirdCommission = 0m;
                    }
                    if (DBNull.Value != dataReader["SecondCommission"])
                    {
                        shoppingCartItemInfo.SecondCommission = (decimal)dataReader["SecondCommission"];
                    }
                    else
                    {
                        shoppingCartItemInfo.SecondCommission = 0m;
                    }
                    if (DBNull.Value != dataReader["FirstCommission"])
                    {
                        shoppingCartItemInfo.FirstCommission = (decimal)dataReader["FirstCommission"];
                    }
                    else
                    {
                        shoppingCartItemInfo.FirstCommission = 0m;
                    }
                    if (DBNull.Value != dataReader["IsSetCommission"])
                    {
                        shoppingCartItemInfo.IsSetCommission = (bool)dataReader["IsSetCommission"];
                    }
                    else
                    {
                        shoppingCartItemInfo.IsSetCommission = false;
                    }
                    BargainDetialInfo bargainDetialInfo = null;
                    if (bargainDetialId > 0)
                    {
                        bargainDetialInfo = new BargainDao().GetBargainDetialInfo(bargainDetialId);
                    }
                    if (bargainDetialId > 0 && bargainDetialInfo != null)
                    {
                        shoppingCartItemInfo.MemberPrice = (shoppingCartItemInfo.AdjustedPrice = bargainDetialInfo.Price);
                    }
                    else
                    {
                        shoppingCartItemInfo.MemberPrice = (shoppingCartItemInfo.AdjustedPrice = decimal.Round((decimal)dataReader["SalePrice"], 2));
                    }
                    if (limitedTimeDiscountId > 0)
                    {
                        LimitedTimeDiscountProductInfo limitedTimeDiscountProductByLimitIdAndProductIdAndUserId = new LimitedTimeDiscountDao().GetLimitedTimeDiscountProductByLimitIdAndProductIdAndUserId(limitedTimeDiscountId, shoppingCartItemInfo.ProductId, (member != null) ? member.UserId : 0);
                        if (limitedTimeDiscountProductByLimitIdAndProductIdAndUserId != null && limitedTimeDiscountProductByLimitIdAndProductIdAndUserId.BeginTime <= DateTime.Now && DateTime.Now < limitedTimeDiscountProductByLimitIdAndProductIdAndUserId.EndTime)
                        {
                            shoppingCartItemInfo.MemberPrice           = (shoppingCartItemInfo.AdjustedPrice = decimal.Round(limitedTimeDiscountProductByLimitIdAndProductIdAndUserId.FinalPrice, 2));
                            shoppingCartItemInfo.LimitedTimeDiscountId = limitedTimeDiscountId;
                        }
                        else
                        {
                            shoppingCartItemInfo.LimitedTimeDiscountId = 0;
                        }
                    }
                    else
                    {
                        shoppingCartItemInfo.LimitedTimeDiscountId = 0;
                    }
                    if (DBNull.Value != dataReader["ThumbnailUrl40"])
                    {
                        shoppingCartItemInfo.ThumbnailUrl40 = dataReader["ThumbnailUrl40"].ToString();
                    }
                    if (DBNull.Value != dataReader["ThumbnailUrl60"])
                    {
                        shoppingCartItemInfo.ThumbnailUrl60 = dataReader["ThumbnailUrl60"].ToString();
                    }
                    if (DBNull.Value != dataReader["ThumbnailUrl100"])
                    {
                        shoppingCartItemInfo.ThumbnailUrl100 = dataReader["ThumbnailUrl100"].ToString();
                    }
                    if (DBNull.Value != dataReader["IsfreeShipping"])
                    {
                        shoppingCartItemInfo.IsfreeShipping = Convert.ToBoolean(dataReader["IsfreeShipping"]);
                    }
                    string text = string.Empty;
                    if (dataReader.NextResult())
                    {
                        while (dataReader.Read())
                        {
                            if (dataReader["AttributeName"] != DBNull.Value && !string.IsNullOrEmpty((string)dataReader["AttributeName"]) && dataReader["ValueStr"] != DBNull.Value && !string.IsNullOrEmpty((string)dataReader["ValueStr"]))
                            {
                                object obj = text;
                                text = string.Concat(new object[]
                                {
                                    obj,
                                    dataReader["AttributeName"],
                                    ":",
                                    dataReader["ValueStr"],
                                    "; "
                                });
                            }
                        }
                    }
                    shoppingCartItemInfo.SkuContent = text;
                    if (dataReader.NextResult())
                    {
                        while (dataReader.Read())
                        {
                            shoppingCartItemInfo.Type = 1;
                            if (DBNull.Value != dataReader["ProductNumber"])
                            {
                                shoppingCartItemInfo.ProductNumber = Convert.ToInt32(dataReader["ProductNumber"]);
                            }
                            if (DBNull.Value != dataReader["PointNumber"])
                            {
                                shoppingCartItemInfo.PointNumber = Convert.ToInt32(dataReader["PointNumber"]);
                            }
                            if (DBNull.Value != dataReader["status"])
                            {
                                shoppingCartItemInfo.Status = Convert.ToInt32(dataReader["status"]);
                            }
                            if (DBNull.Value != dataReader["exChangeId"])
                            {
                                shoppingCartItemInfo.ExchangeId = Convert.ToInt32(dataReader["exChangeId"]);
                            }
                        }
                    }
                    else
                    {
                        shoppingCartItemInfo.Type = 0;
                    }
                }
            }
            return(shoppingCartItemInfo);
        }
コード例 #8
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["bargainId"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            int num = int.Parse(this.Page.Request.QueryString["bargainDetialId"]);

            this.litProdcutName              = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litShortDescription         = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSalePrice                = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litFloorPrice               = (System.Web.UI.WebControls.Literal) this.FindControl("litFloorPrice");
            this.litPurchaseNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (System.Web.UI.WebControls.Literal) this.FindControl("litParticipantNumber");
            this.litProductDesc              = (System.Web.UI.WebControls.Literal) this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (System.Web.UI.WebControls.Literal) this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCommentTotal");
            this.litStock           = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litPurcharseNum    = (System.Web.UI.WebControls.Literal) this.FindControl("litPurcharseNum");
            this.hiddHasCollected   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddHasCollected");
            this.hiddProductId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddProductId");
            this.hiddEndDate        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddPurchaseNumber");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.hideTitle          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideTitle");
            this.hideImgUrl         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideImgUrl");
            this.hideDesc           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideDesc");
            MemberInfo        currentMember     = MemberProcessor.GetCurrentMember();
            bool              flag              = false;
            BargainInfo       bargainInfo       = BargainHelper.GetBargainInfo(this.bargainId);
            BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(num);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.GetHelpBargainDetialCount(num).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.litPurcharseNum.Text      = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string     activityCover = bargainInfo.ActivityCover;
                string     str           = string.Empty;
                System.Uri url           = System.Web.HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainDetialInfo != null)
                {
                    this.litSalePrice.Text = bargainDetialInfo.Price.ToString("F2");
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                    this.litProdcutName.Text      = productDetails.ProductName;
                    this.litShortDescription.Text = bargainInfo.Remarks;
                    this.hideImgUrl.Value         = (string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str + activityCover) : (str + productDetails.ThumbnailUrl60));
                    this.litProductDesc.Text      = productDetails.Description;
                    if (this.rptProductImages != null)
                    {
                        string       locationUrl = "javascript:;";
                        SlideImage[] source      = new SlideImage[]
                        {
                            new SlideImage(productDetails.ImageUrl1, locationUrl),
                            new SlideImage(productDetails.ImageUrl2, locationUrl),
                            new SlideImage(productDetails.ImageUrl3, locationUrl),
                            new SlideImage(productDetails.ImageUrl4, locationUrl),
                            new SlideImage(productDetails.ImageUrl5, locationUrl)
                        };
                        this.rptProductImages.DataSource = from item in source
                                                           where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                           select item;
                        this.rptProductImages.DataBind();
                    }
                    int num2 = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                    this.litProductConsultationTotal.SetWhenIsNotNull(num2.ToString());
                    num2 = ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId);
                    this.litProductCommentTotal.SetWhenIsNotNull(num2.ToString());
                }
            }
        }
コード例 #9
0
ファイル: BargainHelper.cs プロジェクト: zwkjgs/XKD
 public static bool InsertBargainDetial(BargainDetialInfo bargainDetial, out int bargainDetialId)
 {
     return(new BargainDao().InsertBargainDetial(bargainDetial, out bargainDetialId));
 }