/// <summary>
 /// 根据商品ID得到商品名称
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 protected string GetProductName(string id)
 {
     try
     {
         ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
         ShowShop.Model.Product.ProductInfo model = bll.GetModel(Convert.ToInt32(id));
         return "<a href=\"../../ProductContent.aspx?ID=" + id + "\" title=\"查看该商品\" target=\"_blank\">" + model.ProductName + "</a>";
     }
     catch
     {
         return "查询相关商品出错";
     }
 }
 protected string ProductName(string ProductId)
 {
     string reStr = string.Empty;
     string str = "";
     if (!string.IsNullOrEmpty(ProductId))
     {
         ShowShop.BLL.Product.ProductInfo dll = new ShowShop.BLL.Product.ProductInfo();
         ShowShop.Model.Product.ProductInfo model = dll.GetModel(Convert.ToInt32(ProductId));
         if (model != null)
         {
             str = model.ProductName;
         }
     }
     return str;
 }
        protected void BindList(int ProductId)
        {
            ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
            ShowShop.Model.Product.ProductInfo modle = bll.GetModel(ProductId);
            if (modle != null)
            {
               // if (!string.IsNullOrEmpty(modle.pro_Specialspecifications))
                {
                    Regex productSpe = new Regex(@"s_spacebar");
                 //   string[] specifiactionVa = productSpe.Split(modle.pro_Specialspecifications);
                    ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
                    //第一步先添加表头
                    table.AddHeadCol("5%", "序号");
                    table.AddHeadCol("75%", "规格值");
                    table.AddHeadCol("20%", "操作");
                    table.AddRow();
                    //添加表的内容
                    //if (!string.IsNullOrEmpty(specifiactionVa[1]))
                    //{
                    //    this.Spec.Text = specifiactionVa[0];
                    //    int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                    //    if (curpage < 0)
                    //    {
                    //        curpage = 1;
                    //    }
                    //    int count = 0;
                    //    string[] spval = specifiactionVa[1].Replace("\r\n",",").Split(',');
                    //    for (int i = 0; i < spval.Length; i++)
                    //    {
                    //        count++;
                    //        string No = (15 * (curpage - 1) + count).ToString();
                    //        table.AddCol(No);
                    //        table.AddCol(spval[i]);
                    //        table.AddCol(string.Format("<a href=product_specialspecification.aspx?productId={0}&id={1}&val={2}&spec={3}>编辑</a>", ProductId, i, spval[i], specifiactionVa[0]));

                    //        table.AddRow();
                    //    }
                    //}
                    string view = table.GetTable();
                    this.Literal1.Text = view;
                }
            }
        }
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected void GetList(string PutoutType)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.Product.ProductInfo data = new ShowShop.BLL.Product.ProductInfo();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList("[order by] ProductID desc", 20, "");
            //第一步先添加表头
            table.AddHeadCol("5%", "<input type=\"checkbox\" id=\"chkAll\" onclick=\"CheckAll(this.form)\" alt=\"全选/取消\" />选择");
            table.AddHeadCol("10%", "商品编号");
            table.AddHeadCol("18%", "商品名称");
            table.AddHeadCol("15%", "所属分类");
            table.AddHeadCol("10%", "品牌");
            table.AddHeadCol("14%", "创建时间");
            table.AddHeadCol("8%", "上架状态");
            table.AddHeadCol("20%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                while (dataPage.DataReader.Read())
                {
                    string pic_url = sp.DummyPaht + dataPage.DataReader["Thumbnail"].ToString();
                    table.AddCol("<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["ProductID"].ToString() + "\" />");
                    table.AddCol(dataPage.DataReader["ProductNo"].ToString());
                    table.AddCol("<span style='cursor:hand'  onMouseOut=\"hiddenPic();\" onMouseMove=\"showPic('" + pic_url + "');\">" + dataPage.DataReader["ProductName"].ToString() + "(" + dataPage.DataReader["ProductAttachName"].ToString() + ")</span>");
                    table.AddCol(ProductClassName(dataPage.DataReader["cid"].ToString()));
                    table.AddCol(dataPage.DataReader["BrandID"].ToString());
                    table.AddCol(dataPage.DataReader["CreateTime"].ToString());
                    table.AddCol(dataPage.DataReader["IsShelves"].ToString() == "1" ? "上架" : "未上架");
                    table.AddCol(string.Format("<a href=product_info_edit.aspx?productNo={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a> <a href=product_info_edit.aspx?productNo={0}>属性添加</a> <a href='../../product/productcontent.aspx?q_productid={0}' target='_blank'>SKU添加</a>", dataPage.DataReader["ProductID"].ToString(), dataPage.DataReader["cid"].ToString(), PutoutType));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            this.Literal1.Text = view;
        }
 /// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 protected void GetList()
 {
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Product.ProductInfo data = new ShowShop.BLL.Product.ProductInfo();
     ChangeHope.DataBase.DataByPage dataPage = data.GetList();
     //第一步先添加表头
     table.AddHeadCol("10%","序号");
     table.AddHeadCol("20%","货号");
     table.AddHeadCol("65%", "商品名称");
     table.AddHeadCol("10%", "库存");
     table.AddRow();
     //添加表的内容
     if (dataPage.DataReader != null)
     {
         int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
         if (curpage < 0)
         {
             curpage = 1;
         }
         int count = 0;
         while (dataPage.DataReader.Read())
         {
             count++;
             string No = (15 * (curpage - 1) + count).ToString();
             table.AddCol(No + "<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["pro_ID"].ToString() + "\" />");
             table.AddCol(dataPage.DataReader["pro_NO"].ToString());
             table.AddCol("" + dataPage.DataReader["pro_Name"].ToString() + "");
             table.AddCol(string.Format("{0}{1}", dataPage.DataReader["pro_Stock"].ToString(), dataPage.DataReader["pro_Unit"].ToString()));
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     this.Literal1.Text = view;
 }
        private void HandleOrder(int id)
        {
            ShowShop.BLL.Order.Orders ordersbll = new ShowShop.BLL.Order.Orders();
            ShowShop.Model.Order.Orders ordersModel = ordersbll.GetModel(id);
            if (ordersModel != null)
            {
                ShowShop.BLL.Order.OrderProduct orderProductbll = new ShowShop.BLL.Order.OrderProduct();
                DataTable orderProductDT = orderProductbll.GetListOrderProduct(id.ToString());

                ShowShop.BLL.Member.MemberAccount memberaccountbll = new ShowShop.BLL.Member.MemberAccount();
                ShowShop.Model.Member.MemberAccount memberaccounModel = memberaccountbll.GetModel(ordersModel.UserId);

             //   ShowShop.BLL.Product.ProductSpecification spebll = new ShowShop.BLL.Product.ProductSpecification();
                decimal DonateIntegral = 0;
                if (orderProductDT.Rows.Count > 0)
                {
                    ShowShop.BLL.Product.ProductInfo productinfoBll = new ShowShop.BLL.Product.ProductInfo();
                    for (int i = 0; i < orderProductDT.Rows.Count; i++)
                    {
                        ShowShop.Model.Product.ProductInfo productInfoModel = productinfoBll.GetModel(Convert.ToInt32(orderProductDT.Rows[i]["ProId"].ToString()));
                        if (productInfoModel != null)
                        {
                           // DonateIntegral += Convert.ToDecimal(productInfoModel.pro_DonateIntegral);
                           // productinfoBll.Amend(productInfoModel.pro_ID, "pro_SaleNum", productInfoModel.pro_SaleNum + Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString()));
                            if (!string.IsNullOrEmpty(orderProductDT.Rows[i]["Specification"].ToString()))
                            {
                              //  List<ShowShop.Model.Product.ProductSpecification> spcList = spebll.GetSpecification(" and ProductId=" + orderProductDT.Rows[i]["ProId"].ToString() + " and Specifications='" + orderProductDT.Rows[i]["Specification"].ToString() + "'");
                              //  if (spcList.Count > 0)
                              //  {
                                  //  spebll.Amend(spcList[0].Id, "ProductStock", Convert.ToInt32(spcList[0].ProductStock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString()));
                              //  }
                            }
                            else
                            {
                                //if (Convert.ToInt32(productInfoModel.pro_Stock) >= Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString()))
                                {
                                   // productinfoBll.Amend(productInfoModel.pro_ID, "pro_Stock", Convert.ToInt32(productInfoModel.pro_Stock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString()));
                                }

                            }
                        }
                    }
                    //购买商品赠送积分
                    if (memberaccounModel != null)
                    {
                        if (DonateIntegral > 0)
                        {
                            if (memberaccountbll.Amend(memberaccounModel.UID, "Points", memberaccounModel.Points + DonateIntegral) > 0)
                            {
                                ShowShop.BLL.Member.Integral integralBll = new ShowShop.BLL.Member.Integral();
                                ShowShop.Model.Member.Integral integral = new ShowShop.Model.Member.Integral();
                                integral.Userid = memberaccounModel.UID;
                                integral.OrderId = ordersModel.OrderId;
                                integral.IntegralClass = 1;
                                integral.IntegralNum = memberaccounModel.Points + DonateIntegral;
                                integral.GainDate = Convert.ToDateTime(System.DateTime.Now);
                                integral.NoteDate = Convert.ToDateTime(System.DateTime.Now);
                                integral.NoteName = "系统";
                                integral.Remark = "购买商品后赠送的积分";
                                integral.IntegralStatus = 0;
                                integral.Origin = "订单";
                                integralBll.Add(integral);
                            }
                        }

                    }
                }
            }
        }
Example #7
0
        public static void FittingDisposal(string SparepartId, string FittingsProductId, string FittingsProductCount, out int FittingProductCount, out string fittingProductInfo, out double fittingTotalPrice,out double fittingProductWeight,out double fittingProductIntergal)
        {
            ShowShop.BLL.Product.ProductInfo productbll = new ShowShop.BLL.Product.ProductInfo();
            ShowShop.BLL.Product.ProductSparepart spabll = new ShowShop.BLL.Product.ProductSparepart();
            int favourableType = -1;
            double favourableLimit = 0;
            int productCount = 0;
            string fittingInfo = "";
            double strfittingPrice = 0;
            double productWeight = 0;
            double productIntergal = 0;
            if (!string.IsNullOrEmpty(SparepartId.Trim()) && Convert.ToInt32(SparepartId) > 0)
            {
                ShowShop.Model.Product.ProductSparepart sparModel = spabll.GetModelID(Convert.ToInt32(SparepartId));
                if (sparModel != null)
                {
                    favourableLimit = Convert.ToDouble(sparModel.FavourableLimit.ToString());
                    favourableType = sparModel.FavourableType;
                }
            }

            if (!string.IsNullOrEmpty(FittingsProductId))
            {
                string[] fittingProIdArr = FittingsProductId.Split(',');
                string[] fittingProCountArr = FittingsProductCount.Split(',');
                for (int c = 0; c < fittingProCountArr.Length; c++)
                {
                    if (!string.IsNullOrEmpty(fittingProCountArr[c].Trim()))
                    {
                        productCount += Convert.ToInt32(fittingProCountArr[c]);
                    }
                }
                for (int f = 0; f < fittingProIdArr.Length; f++)
                {
                    if (!string.IsNullOrEmpty(fittingProIdArr[f].Trim()))
                    {
                        DataTable prodt = productbll.GetAppointField("pro_ID,pro_Name,pro_ShopPrice,pro_RatingDiscount,pro_Specifications,pro_Weight,pro_DonateIntegral", " and pro_ID=" + fittingProIdArr[f]);
                        if (prodt.Rows.Count > 0)
                        {
                            productIntergal += Convert.ToDouble(prodt.Rows[0]["pro_DonateIntegral"].ToString());
                            productWeight += Convert.ToDouble(prodt.Rows[0]["pro_Weight"].ToString());
                            double price = Convert.ToDouble(prodt.Rows[0]["pro_ShopPrice"].ToString());
                            string memberPrice = prodt.Rows[0]["pro_RatingDiscount"].ToString();
                            if (!string.IsNullOrEmpty(prodt.Rows[0]["pro_Specifications"].ToString()))
                            {
                                //ShowShop.BLL.Product.ProductSpecification proSpe = new ShowShop.BLL.Product.ProductSpecification();
                                //List<ShowShop.Model.Product.ProductSpecification> proSpeList = proSpe.GetSpecification(Convert.ToInt32(prodt.Rows[0]["pro_ID"].ToString()));
                                //if (proSpeList.Count > 0)
                                //{
                                //    price = Convert.ToDouble(proSpeList[0].SalePrice);
                                //    memberPrice = proSpeList[0].MemberPrice;
                                //}
                            }
                            if (HttpContext.Current.Session["MemberID"] != null && !string.IsNullOrEmpty(memberPrice.Trim()))
                            {
                                price = ShowShop.Common.ProductInfo.DiscountedPrice(int.Parse(HttpContext.Current.Session["MemberID"].ToString()), price, memberPrice);
                            }

                            double fittingPrice = price;
                            if (HttpContext.Current.Session["MemberID"] != null)
                            {
                                fittingPrice = DiscountedPrice(Convert.ToInt32(HttpContext.Current.Session["MemberID"].ToString()), fittingPrice, prodt.Rows[0]["pro_RatingDiscount"].ToString());
                            }

                            if (!string.IsNullOrEmpty(fittingProCountArr[f].Trim()))
                            {
                                fittingPrice = fittingPrice * Convert.ToInt32(fittingProCountArr[f]);
                            }
                            if (favourableType == 0 && favourableLimit > 0)
                            {
                                fittingPrice = fittingPrice * favourableLimit;
                            }
                            else if (favourableType == 1 && favourableLimit > 0)
                            {
                                fittingPrice = fittingPrice - favourableLimit;
                            }
                            strfittingPrice += fittingPrice;
                            fittingInfo += "&nbsp;+&nbsp;" + prodt.Rows[0]["pro_Name"].ToString() + "&nbsp;(" + fittingProCountArr[f] + ")";
                        }
                    }
                }
            }
            fittingProductWeight = productWeight;
            FittingProductCount = productCount;
            fittingTotalPrice = strfittingPrice;
            fittingProductInfo = fittingInfo;
            fittingProductIntergal=productIntergal;
        }
 private void del(string StrID)
 {
     ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
     ShowShop.BLL.Product.ProductAlbum pabll = new ShowShop.BLL.Product.ProductAlbum();
     ShowShop.BLL.Product.ProductSparepart sbll = new ShowShop.BLL.Product.ProductSparepart();
     DataTable dt = bll.GetPartData(StrID);
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             ChangeHope.Common.FileHelper fh = new ChangeHope.Common.FileHelper();
             if (!dt.Rows[i]["pro_Original"].ToString().Contains("http://"))
             {
                 fh.DeleteFile(Server.MapPath("~//" + dt.Rows[i]["pro_Original"].ToString()));
             }
             sbll.DeleteProductSparepart(Convert.ToInt32(dt.Rows[i]["pro_ID"].ToString()));
         }
     }
     bll.Delete(StrID);
     pabll.DelAll(StrID);
     Response.Write("ok");
 }
        /// <summary>
        /// 上传商品相册图
        /// </summary>
        /// <param name="albumthumbnail"></param>
        /// <param name="ImagesThumbnailsWidth"></param>
        /// <param name="ImagesThumbnailsHeight"></param>
        /// <param name="WhetherWater"></param>
        /// <param name="ImageWatermarkTransparent"></param>
        /// <param name="TextWatermarkTransparent"></param>
        /// <param name="WatermarkPosition"></param>
        /// <param name="WatermarkImage"></param>
        /// <param name="WatermarkText"></param>
        /// <param name="TextOrImagesWatermark"></param>
        protected string Album(int ImagesThumbnailsWidth, int ImagesThumbnailsHeight, bool WhetherWater, int ImageWatermarkTransparent, int TextWatermarkTransparent, string WatermarkPosition, string WatermarkImage, string WatermarkText, string TextOrImagesWatermark, bool IsModfiy, int SignId)
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            string gomessage = "";
            ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
            System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
            ShowShop.BLL.Product.ProductAlbum pabll = new ShowShop.BLL.Product.ProductAlbum();
            ShowShop.Model.Product.ProductAlbum pamodel = new ShowShop.Model.Product.ProductAlbum();
            string[] rd = null;
            string des = ChangeHope.WebPage.PageRequest.GetFormString("description");
            if (!string.IsNullOrEmpty(des))
            {
                rd = des.Split(',');//获得图片描述的文本框字符串数组,为对应的图片的描述
            }
            if (files.Count > 1)//说明图片大小和格式都没问题
            {
                ShowShop.BLL.Product.ProductAlbum PGBLL = new ShowShop.BLL.Product.ProductAlbum();
                ShowShop.Model.Product.ProductAlbum PGModel = new ShowShop.Model.Product.ProductAlbum();
                int autouFile=files.Count;
                ChangeHope.Common.UploadProcesedImages wm = new ChangeHope.Common.UploadProcesedImages();
                ChangeHope.Common.UploadFile uf = new ChangeHope.Common.UploadFile();
                string AlbumThumbnailSave = "/yxuploadfile/product/albumthumbnail";
                string AlbumOriginalSave = "/yxuploadfile/product/albumoriginal";
                string AlbumThumbnail = string.Empty;
                string AlbumOriginal = string.Empty;
                string Message = string.Empty;
                uf.ExtensionLim = ".gif,.jpg,.jpeg,.bmp";
                uf.FileLengthLim = sp.ImageSize;
                for (int i = 1; i < files.Count; i++)
                {
                    uf.MyFile = files[i];
                    uf.SavePath = AlbumOriginalSave;
                    if (uf.HTMLUpLoad())
                    {
                        if (uf.HaveLoad)
                        {
                            AlbumOriginal = uf.FilePath;
                            //原图缩略图
                            wm.SourceImagePath = AlbumOriginal;
                            wm.ThumbnailImagePath = AlbumOriginalSave;
                            wm.ThumbnailImageWidth = ImagesThumbnailsWidth;
                            wm.ThumbnailImageHeight = ImagesThumbnailsHeight;
                            if (wm.ToThumbnailImage())
                            {
                                AlbumThumbnail = wm.FilePath;
                            }
                            else
                            {
                                gomessage += "<br>" + wm.Message;

                            }
                        }
                        else
                        {
                            gomessage += "<br>" + uf.Message;
                        }
                        if (WhetherWater)
                        {
                            //原图水印
                            if (!string.IsNullOrEmpty(AlbumOriginal))
                            {
                                wm.SourceImagePath = AlbumOriginal;
                                wm.ImageDeaphaneity = float.Parse(ImageWatermarkTransparent.ToString());
                                wm.Diaphaneity = TextWatermarkTransparent;
                                switch (WatermarkPosition)
                                {
                                    case "1":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftTop;
                                        break;
                                    case "2":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftBottom;
                                        break;
                                    case "3":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightTop;
                                        break;
                                    case "4":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightBottom;
                                        break;
                                    case "5":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterTop;
                                        break;
                                    case "9":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.Center;
                                        break;
                                    case "7":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterBottom;
                                        break;
                                }
                                if (TextOrImagesWatermark == "0")
                                {
                                    //图片水印
                                    if (!string.IsNullOrEmpty(WatermarkImage))
                                    {
                                        wm.WaterMarkImagePath = WatermarkImage;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印图片是否存在。";
                                    }
                                }
                                else
                                {
                                    //文字水印
                                    if (!string.IsNullOrEmpty(WatermarkText))
                                    {
                                        wm.WaterMarkText = WatermarkText;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印文字是否存在。";
                                    }
                                }
                                wm.SaveWaterMarkImagePath = AlbumOriginalSave;
                                if (wm.ToWaterMark())
                                {
                                    AlbumOriginal = wm.FilePath;
                                }
                                else
                                {
                                    gomessage += "<br>" + "操作失败," + wm.Message + "";
                                }
                            }
                            //原图缩略图水印
                            if (!string.IsNullOrEmpty(AlbumThumbnail))
                            {
                                wm.SourceImagePath = AlbumThumbnail;
                                wm.ImageDeaphaneity = float.Parse(ImageWatermarkTransparent.ToString());
                                wm.Diaphaneity = TextWatermarkTransparent;
                                switch (WatermarkPosition)
                                {
                                    case "1":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftTop;
                                        break;
                                    case "2":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.LeftBottom;
                                        break;
                                    case "3":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightTop;
                                        break;
                                    case "4":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.RightBottom;
                                        break;
                                    case "5":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterTop;
                                        break;
                                    case "9":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.Center;
                                        break;
                                    case "7":
                                        wm.WaterMarkAlign = ChangeHope.Common.ImageAlign.CenterBottom;
                                        break;
                                }
                                if (TextOrImagesWatermark == "0")
                                {
                                    //图片水印
                                    if (!string.IsNullOrEmpty(WatermarkImage))
                                    {
                                        wm.WaterMarkImagePath = WatermarkImage;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印图片是否存在。";
                                    }
                                }
                                else
                                {
                                    //文字水印
                                    if (!string.IsNullOrEmpty(WatermarkText))
                                    {
                                        wm.WaterMarkText = WatermarkText;
                                    }
                                    else
                                    {
                                        gomessage += "<br>" + "操作失败,上传图片水印失败,请确认系统设置水印文字是否存在。";
                                    }
                                }
                                wm.SaveWaterMarkImagePath = AlbumThumbnailSave;
                                if (wm.ToWaterMark())
                                {
                                    AlbumThumbnail = wm.FilePath;
                                }
                                else
                                {
                                    gomessage += "<br>" + "操作失败," + wm.Message + "";
                                }
                            }

                        }
                    }
                    pamodel.Productid = 0;
                    pamodel.OriginalAddress = AlbumOriginal;
                    pamodel.ThumbnailAddress = AlbumThumbnail;
                    pamodel.IsSpecialspecificationsSign = 1;
                    pamodel.SpecificaticationSignId = SignId;
                    pamodel.Description = "";
                    if (AlbumThumbnail != string.Empty)
                    {
                        pabll.Add(pamodel);
                    }
                }

            }
            return gomessage;
        }
 private string GetProductNameById(int id,int commentTypeId)
 {
     string reStr = string.Empty;
     if (commentTypeId == 1)
     {
         ShowShop.BLL.Product.ProductInfo productBll = new ShowShop.BLL.Product.ProductInfo();
         ShowShop.Model.Product.ProductInfo info = productBll.GetModel(id);
         if (info != null)
         {
             reStr="<span style='color:red;'>(商品)</span>"+ChangeHope.Common.StringHelper.SubStringAndAppend(info.ProductName.ToString(), 15, "...");
         }
     }
     else if (commentTypeId == 2)
     {
        // ShowShop.BLL.Shop.Shop shopbll = new ShowShop.BLL.Shop.Shop();
       //  ShowShop.Model.Shop.Shop shopmode = shopbll.GetModelById(id);
         //if (shopmode != null)
         //{
         //    reStr = "<span style='color:red;'>(店铺)</span>" + ChangeHope.Common.StringHelper.SubStringAndAppend(shopmode.Shopname, 15, "...");;
         //}
     }
     return reStr;
 }
Example #11
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string orderId = this.hfOrderId.Value.Trim();
            if (string.IsNullOrEmpty(this.hfid.Value))
            {
                ChangeHope.WebPage.BasePage.PageError("请选择商品.", "order_modify.aspx?OrderId=" + orderId, "");
            }
            ShowShop.Model.Order.OrderProduct model = new ShowShop.Model.Order.OrderProduct();
            ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct();
            ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders();
            ShowShop.BLL.Product.ProductInfo bllProductInfo = new ShowShop.BLL.Product.ProductInfo();
            string[] idStr = this.hfid.Value.Split(',');
            string productId = idStr[0];
            string specificationId = idStr.Length > 1 ? idStr[1] : "";
            string specificationVa = "";
            decimal spePrice = 0;
            //if (!string.IsNullOrEmpty(specificationId.Trim()))
            //{
               // ShowShop.BLL.Product.ProductSpecification proSpe = new ShowShop.BLL.Product.ProductSpecification();
               // ShowShop.Model.Product.ProductSpecification proModel = proSpe.GetModelID(Convert.ToInt32(specificationId));
                //if (proModel != null)
                //{
                //    specificationVa = proModel.Specifications;
                //    spePrice = Convert.ToDecimal(proModel.SalePrice);
                //}
              //  }
            ChangeHope.DataBase.DataByPage db = bll.GetListByPage(" and ProId=" + productId + " and OrderId=" + orderId + " and Specification='" + specificationVa + "'");
            ShowShop.Model.Order.Orders ordModel = ordbll.GetModel(this.blOrderNo.Text.Trim());
            if (db.DataReader == null)
            {
                ShowShop.Model.Product.ProductInfo modelProductInfo = bllProductInfo.GetModel(Convert.ToInt32(productId));
                if (modelProductInfo != null)
                {
                    model.AddTime = System.DateTime.Now;
                    model.OrderId =Convert.ToInt32(orderId);
                    model.ProId = Convert.ToInt32(modelProductInfo.ProductID);
                    model.ProClass = modelProductInfo.ClassID.ToString();
                    model.ProImg = modelProductInfo.Thumbnail;
                    model.ProName = modelProductInfo.ProductName;
                    model.ProNum = 1;
                    model.ProOtherPara = "";
                    model.ProPrice = spePrice;
                    model.Specification = specificationVa;
                    model.FittingsId = 0;
                    model.FittingsProductCount = "";
                    model.FittingsProductId = "";
                    model.FittingsProductPrice = "";
                    bll.Add(model);
                    if (ordModel != null)
                    {
                        ordbll.Amend(ordModel.Id, "TotalPrice",Convert.ToDecimal(ordModel.TotalPrice)+Convert.ToDecimal(spePrice));
                        ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + Convert.ToDecimal(spePrice));
                    }
                }
            }
            else
            {
                if(db.DataReader.Read())
                {
                    bll.Amend(Convert.ToInt32(db.DataReader["Id"].ToString()), "ProNum", Convert.ToInt32(db.DataReader["ProNum"].ToString()) + 1);
                    if (ordModel != null)
                    {
                        ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) + Convert.ToDecimal(db.DataReader["ProPrice"].ToString()));
                        ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + Convert.ToDecimal(db.DataReader["ProPrice"].ToString()));
                    }
                }

            }
            DataTable ordProductdt = bll.GetListOrderProduct(orderId);
            if (ordProductdt.Rows.Count > 0)
            {
            }
            ChangeHope.WebPage.BasePage.PageRight("向" + this.blOrderNo.Text + "添加商品成功.", "order_modify.aspx?OrderId="+orderId, "");
        }
 private void GetSparepartProductInfo(string strProductId,int sparepartId)
 {
     StringBuilder shtml = new StringBuilder();
     ShowShop.BLL.Product.ProductInfo bll = new ShowShop.BLL.Product.ProductInfo();
     DataTable dt = bll.DTGetListWhere(" and pro_ID in (" + strProductId + ")");
     shtml.Append("<table widht='100%'>");
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             shtml.Append("<tr style='height:22px'>");
             shtml.Append("<td><a href=\"javascript:delSparepartProductId(" + dt.Rows[i]["pro_ID"].ToString() + "," + sparepartId + ")\">删除</a></td>");
             shtml.Append("<td width=\"40%\"><span title='" + dt.Rows[i]["pro_Name"].ToString() + "'>" + ChangeHope.Common.StringHelper.SubString(dt.Rows[i]["pro_Name"].ToString(), 20) + "</span></td>");
             shtml.Append("<td width=\"50%\"><span title=\"" + dt.Rows[i]["pro_Synopsis"].ToString() + "\">" + ChangeHope.Common.StringHelper.SubString(dt.Rows[i]["pro_Synopsis"].ToString(), 30) + "</span></td>");
             shtml.Append("</tr>");
         }
     }
     shtml.Append("</table>");
     Response.Write(shtml.ToString());
 }