Ejemplo n.º 1
0
        public ActionResult selectGood(string searchString, string SortInfoFrom)
        {
            var good   = GoodsManage.selectGoods();
            var tugood = GoodsManage.FindGoods().Take(3);

            if (!String.IsNullOrEmpty(searchString))
            {
                good = good.Where(s => s.GoodsDes.Contains(searchString) || s.GoodsName.Contains(searchString) || s.Classify.ClassifyName.Contains(searchString));
            }
            if (!String.IsNullOrEmpty(SortInfoFrom))
            {
                if (SortInfoFrom == "价格降序")
                {
                    good = good.OrderByDescending(p => p.GoodsPrice);
                }
                else if (SortInfoFrom == "价格升序")
                {
                    good = good.OrderBy(p => p.GoodsPrice);
                }

                else if (SortInfoFrom == "更新时间")
                {
                    good = good.OrderByDescending(p => p.Grounding);
                }
            }
            SelectGoods inde = new SelectGoods();

            inde.good1 = good;
            inde.good2 = tugood;
            return(View(inde));
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 绑定订单明细
    /// </summary>
    public void BindOrderDetail(int DisID)
    {
        SelectGoods.OrderDetail(KeyID, DisID, this.CompID);
        DataTable dt = Session["GoodsInfo"] as DataTable;

        this.rpDtl.DataSource = dt;
        this.rpDtl.DataBind();
        SelectGoods.Clear(DisID, this.CompID);
    }
Ejemplo n.º 3
0
    protected void Bind()
    {
        this.txtDisUser.InnerText = Common.GetUserName(this.UserID);
        this.hidDisUserId.Value   = this.UserID.ToString();
        if (KeyID != 0)
        {
            if (!Common.PageCompOperable("Order", KeyID, CompID))
            {
                Response.Redirect("../../NoOperable.aspx");
                return;
            }

            Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(KeyID);

            if (OrderInfoModel != null)
            {
                string js = "<script language=javascript>history.go(-1);</script>";
                //编辑订单时 判断订单状态
                if (OrderInfoModel.AddType == (int)Enums.AddType.企业补单 || OrderInfoModel.AddType == (int)Enums.AddType.App企业补单)
                {
                    //企业补单
                    if (OrderInfoModel.OState >= (int)Enums.OrderState.已审 && OrderInfoModel.PayState != (int)Enums.PayState.未支付)
                    {
                        HttpContext.Current.Response.Write(string.Format(js));
                    }
                }
                else
                {
                    //App下单 网页下单
                    if (OrderInfoModel.OState >= (int)Enums.OrderState.待审核)
                    {
                        HttpContext.Current.Response.Write(string.Format(js));
                    }
                }

                this.lblReceiptNo.InnerText = OrderInfoModel.ReceiptNo;

                DisId = OrderInfoModel.DisID;
                this.hidTotalAmount.Value = OrderInfoModel.TotalAmount.ToString("N");
                this.txtArriveDate.Value  = OrderInfoModel.ArriveDate == DateTime.MinValue ? "" : OrderInfoModel.ArriveDate.ToString("yyyy-MM-dd");
                this.txtDisUser.InnerText = Common.GetUserName(OrderInfoModel.DisUserID);
                this.hidDisUserId.Value   = OrderInfoModel.DisUserID.ToString();


                this.txtRemark.Value = OrderInfoModel.Remark;
            }
        }
        else
        {
            //清除商品数据
            SelectGoods.Clear();
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 绑定订单明细
    /// </summary>
    public void BindOrderDetail(int DisID)
    {
        List <Hi.Model.BD_RebateDetail> list = OrderDetailBll.GetList("", " RebateID = " + KeyID + " and IsNull(dr,0) = 0 ", " createdate desc");

        if (list != null)
        {
            this.rpDtl.DataSource = list;
            this.rpDtl.DataBind();
        }
        else
        {
            this.rpDtl.DataSource = "";
            this.rpDtl.DataBind();
        }
        SelectGoods.Clear(DisID, this.CompID);
    }
Ejemplo n.º 5
0
    public void BindGoods()
    {
        SelectGoods.Clear(this.CompID);
        SelectGoods.OrderDetail(KeyID, this.DisID, this.CompID);
        DataTable dt = Session["GoodsInfo"] as DataTable;

        if (dt != null)
        {
            this.rptgoods.DataSource = dt;
            this.rptgoods.DataBind();
        }
        else
        {
            this.rptgoods.DataSource = "";
            this.rptgoods.DataBind();
        }
        SelectGoods.Clear(this.DisID, this.CompID);
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 绑定订单明细
    /// </summary>
    public void BindOrderDetail(int OrderId, int DisID)
    {
        SelectGoods.Clear();
        SelectGoods.OrderDetail(OrderId, DisID, this.CompID);
        DataTable dt = Session["GoodsInfo"] as DataTable;

        if (dt != null)
        {
            this.rpDtl.DataSource = dt;
            this.rpDtl.DataBind();
        }
        else
        {
            this.rpDtl.DataSource = "";
            this.rpDtl.DataBind();
        }
        SelectGoods.Clear(DisID, this.CompID);
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 绑定产品信息
    /// </summary>
    /// <param name="id"></param>
    public void Bind(int id)//, int goodsInfoId)
    {
        Hi.Model.BD_Goods model = new Hi.BLL.BD_Goods().GetModel(id);
        if (model != null && model.dr == 0 && model.IsEnabled == 1)
        {
            if (goodsInfoId == 0)
            {
                List <Hi.Model.BD_GoodsInfo> l = new Hi.BLL.BD_GoodsInfo().GetList("", "isnull(dr,0)=0 and compid=" + this.CompID + " and goodsid=" + id, "");
                if (l.Count > 0)
                {
                    this.lblCode.InnerText      = l[0].BarCode.Trim();       //商品编号
                    this.lblInventory.InnerText = l[0].Inventory.ToString(); //商品库存.
                    goodsInfoId = l[0].ID;
                }
            }
            else
            {
                Hi.Model.BD_GoodsInfo model2 = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                if (model2 != null)
                {
                    this.lblCode.InnerText      = model2.BarCode.Trim();       //商品编号
                    this.lblInventory.InnerText = model2.Inventory.ToString(); //商品库存.
                }
            }
            Hi.Model.SYS_GType model3 = new Hi.BLL.SYS_GType().GetModel(model.CategoryID);
            if (model3 != null)
            {
                this.lblCategory.InnerText = model3.TypeName.Trim(); //分类
            }
            GetZiDingYi(model);                                      //自定义字段
            // this.divTitle.InnerText = model.GoodsName.Trim();//biaot
            // this.divTitle.InnerHtml = model.GoodsName.Trim() + SelectGoods.ProType(zhek);//商品名称

            string zhek = Cuxiao(goodsInfoId.ToString());
            if (!Util.IsEmpty(zhek))
            {
                this.divTitle.InnerHtml = model.GoodsName + SelectGoods.ProType(zhek);//商品名称
            }
            else
            {
                this.divTitle.InnerHtml = model.GoodsName;
            }
            if (model.IsLS == 1)
            {
                this.isls.Visible         = true;
                this.lbllsprice.InnerText = "¥" + model.LSPrice.ToString("0.00");
            }
            else
            {
                this.isls.Visible = false;
            }
            this.divMemo.InnerHtml      = model.Title.Trim(); //描述
            this.lblHideInfo1.InnerText = model.HideInfo1;
            this.lblHideInfo2.InnerText = model.HideInfo2;    //描述
            this.lblUnit.InnerText      = model.Unit.Trim();  //计量单位
            // this.lblRecommend.InnerText = model.IsRecommended == 2 ? "推荐" : "否";//是否推荐
            if (model.IsRecommended == 2)
            {
                this.lblShow.InnerText      = "显示";
                this.lblRecommend.InnerText = "推荐";
            }
            else if (model.IsRecommended == 1)
            {
                this.lblShow.InnerText      = "显示";
                this.lblRecommend.InnerText = "不推荐";
            }
            else
            {
                this.lblShow.InnerText      = "不显示";
                this.lblRecommend.InnerText = "不推荐";
            }
            if (model.Details == "")
            {
                this.DivShow.InnerHtml = "<p style=\"padding-top: 20px; line-height: 40px; padding-left: 20px\">暂无数据</p>";
            }
            else
            {
                this.DivShow.InnerHtml = model.Details;
            }
            if (!string.IsNullOrEmpty(model.Pic))//有图片
            {
                LoginModel logUser  = HttpContext.Current.Session["UserModel"] as LoginModel;
                string     basePath = Common.GetWebConfigKey("OssImgPath") + "company/" + ((logUser != null) ? logUser.CompID.ToString() : "") + "/";
                string     surfix   = "?x-oss-process=style/resize400";
                this.imgPic.Src  = basePath + model.Pic + surfix;
                this.imgPic2.Src = basePath + model.Pic + surfix;
                this.imgPic.Attributes.Add("jqimg", basePath + model.Pic);
                this.imgPic2.Attributes.Add("bimg", basePath + model.Pic);
            }
            else
            {
                this.imgPic.Src  = "../../images/havenopicmax.gif"; //无图片
                this.imgPic2.Src = "../../images/havenopicmax.gif"; //无图片
                this.imgPic2.Attributes.Add("bimg", "../../images/havenopicmax.gif");
                this.imgPic.Attributes.Add("jqimg", "../../images/havenopicmax.gif");
            }
        }
        else
        {
            JScript.AlertMethod(this, "商品不存在或者已经被删除", JScript.IconOption.错误, "function(){location.href='GoodsInfoList.aspx';}");
            return;
        }
        string html = string.Empty;
        List <Hi.Model.BD_GoodsAttrs> ll = new Hi.BLL.BD_GoodsAttrs().GetList("", "isnull(dr,0)=0 and compId=" + this.CompID + " and goodsId=" + id.ToString(), "");

        if (ll.Count > 0)
        {
            int xy = 0;
            foreach (Hi.Model.BD_GoodsAttrs item in ll)
            {
                List <Hi.Model.BD_GoodsAttrsInfo> lll = new Hi.BLL.BD_GoodsAttrsInfo().GetList("", "isnull(dr,0)=0 and compId=" + this.CompID + " and attrsId=" + item.ID, "");
                if (lll.Count > 0)
                {
                    html += "<div class=\"li\"><i class=\"bt2\" tip=\"" + item.AttrsName + "\">" + item.AttrsName + ":</i><div class=\"fun\" style=\"display: inline;\">";
                    int count = 1;
                    foreach (Hi.Model.BD_GoodsAttrsInfo item2 in lll)
                    {
                        //Hi.Model.BD_GoodsInfo model4 = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                        //if (xy == 0)
                        //{
                        //    html += "<a href=\"javascript:;\" class=\"" + (model4.Value1 == item2.AttrsInfoName.Trim() ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "</a>";
                        //}
                        //else if (xy == 1)
                        //{
                        //    html += "<a href=\"javascript:;\" class=\"" + (model4.Value2 == item2.AttrsInfoName.Trim() ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "</a>";
                        //}
                        //else if (xy == 2)
                        //{
                        //    html += "<a href=\"javascript:;\" class=\"" + (model4.Value3 == item2.AttrsInfoName.Trim() ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "</a>";
                        //}
                        if (count == 1)
                        {
                            html += "<a href=\"javascript:;\" class=\"hover\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "</a>";
                        }
                        else
                        {
                            html += "<a href=\"javascript:;\" class=\"\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "</a>";
                        }
                        count++;
                    }
                    html += "</div></div>";
                }
                xy++;
            }
        }
        litAttrVaue.Text = html;
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 商品信息绑定
    /// </summary>
    public void Bind()
    {
        LoginModel logmodel = HttpContext.Current.Session["UserModel"] as LoginModel;

        Hi.Model.BD_Goods model = new Hi.BLL.BD_Goods().GetModel(goodsId);
        if (model != null)
        {
            GetZiDingYi(model);
            mKeyword.Content = string.IsNullOrWhiteSpace(model.Title) ? model.GoodsName : model.Title;
            string zhek = Cuxiao();
            if (!Util.IsEmpty(zhek))
            {
                this.lblGoodsName.InnerHtml = model.GoodsName + SelectGoods.ProType(zhek); //商品名称
                tiele_name = model.GoodsName;                                              //前台title显示
                if (hidGoodsInfoId.Value != null && hidGoodsInfoId.Value != "")
                {
                    Hi.Model.BD_GoodsInfo godosInfomodel = new Hi.BLL.BD_GoodsInfo().GetModel(Convert.ToInt32(hidGoodsInfoId.Value));
                    //add by hgh 未登录,原价不可见
                    //if (logmodel != null)
                    //{


                    if (Request["Comid"].ToString() == model.CompID.ToString())
                    {
                        this.YuanPrice.InnerHtml = "<s><i>原价:</i><b class=\"red\" id=\"B1\">" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(godosInfomodel.TinkerPrice).ToString())).ToString("#,##0.00") + "</b></s>";
                    }
                    else
                    {
                        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
                        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");
                        if (Sysl.Count > 0)
                        {
                            if (Sysl[0].Value == "1")
                            {
                                this.YuanPrice.InnerHtml = "<s><i>原价:</i><b class=\"red\" id=\"B1\">" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(godosInfomodel.TinkerPrice).ToString())).ToString("#,##0.00") + "</b></s>";
                            }
                        }
                    }
                    //}
                }
            }
            else
            {
                this.lblGoodsName.InnerHtml = model.GoodsName;
                tiele_name = model.GoodsName;//前台title显示
                this.YuanPrice.InnerHtml = "";
            }
            this.lblunit.InnerText       = model.Unit;
            this.lblGoodsTitle.InnerText = model.Title;//商品卖点
            hideInfo1 = model.HideInfo1;
            hideInfo2 = model.HideInfo2;
            if (!Util.IsEmpty(model.Details.Trim()))
            {
                this.lblGoodsDetali.InnerHtml = model.Details.Replace("<pre>", "<p>").Replace("</pre>", "</p>");//商品描述
            }
            if (!Util.IsEmpty(model.registeredCertificate.Trim()))
            {
                string url = Common.GetWebConfigKey("OssImgPath") + "UploadFile/" + model.registeredCertificate;
                this.lblGoodsDetali1.InnerHtml = "<img width=\"600\" src=\"" + url + "\"/>";
            }
            //this.lblPrice.InnerText = "¥" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(model.SalePrice.ToString()).ToString())).ToString("#,##0.00"); ;//商品价格
            if (model != null && !string.IsNullOrEmpty(model.Pic))
            {
                this.imgPic.Src = Common.GetPicURL(model.Pic, "resize400", compId.ToString());
                this.imgPic.Attributes.Add("jqimg", Common.GetPicURL(model.Pic, "", compId.ToString()));
            }
            else
            {
                imgPic.Src = "../images/Goods400x400.jpg";//无图片
                imgPic.Attributes.Add("jqimg", "../images/Goods400x400.jpg");
            }
            string html = string.Empty;
            List <Hi.Model.BD_GoodsAttrs> ll = new Hi.BLL.BD_GoodsAttrs().GetList("", "isnull(dr,0)=0 and compId=" + compId + " and goodsId=" + goodsId.ToString(), "");
            if (ll.Count > 0)
            {
                foreach (Hi.Model.BD_GoodsAttrs item in ll)
                {
                    int xy = 0;
                    List <Hi.Model.BD_GoodsAttrsInfo> lll = new Hi.BLL.BD_GoodsAttrsInfo().GetList("", "isnull(dr,0)=0 and compId=" + compId + " and attrsId=" + item.ID, "");
                    if (lll.Count > 0)
                    {
                        //add by hgh
                        if (item.AttrsName.Length > 4)
                        {
                            item.AttrsName = item.AttrsName.Substring(0, 4);
                        }
                        html += "<div class=\"li\"><div class=\"t\" tip=\"" + item.AttrsName + "\">" + item.AttrsName + ":</div><div class=\"n\">";
                        foreach (Hi.Model.BD_GoodsAttrsInfo item2 in lll)
                        {
                            if (goodsInfoId == 0)
                            {
                                html += "<a href=\"javascript:;\" class=\"" + (xy == 0 ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                            }
                            else
                            {
                                Hi.Model.BD_GoodsInfo model2 = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                                if (model2 != null)
                                {
                                    html += "<a href=\"javascript:;\" class=\"" + (model2.Value1 == item2.AttrsInfoName || model2.Value2 == item2.AttrsInfoName || model2.Value3 == item2.AttrsInfoName ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                                }
                            }
                            xy++;
                        }
                        html += "</div></div>";
                    }
                }
            }
            litAttrVaue.InnerHtml = html;
            if (logmodel != null)
            {
                List <Hi.Model.BD_DisCollect> llll = new Hi.BLL.BD_DisCollect().GetList("", "isnull(dr,0)=0 and comPid=" + model.CompID + " and goodsId=" + goodsId + " and disId=" + logmodel.DisID, "");
                if (llll.Count > 0)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btn .keep\").html('<i class=\"sc-icon\" style=\"background-position:0 -73px;\"></i>取消收藏\');})</script>");
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btn .keep\").html('<i class=\"sc-icon\" ></i>加入收藏\');})</script>");
                }
            }
        }
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 复制订单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnCopy_Click(object sender, EventArgs e)
    {
        decimal TotalAmount = 0;            //订单总价
        string  LogRemark   = string.Empty; //日志备注
        int     Audit       = 0;            //是否审核

        Hi.Model.DIS_Order OrderInfoModel = null;
        try
        {
            OrderInfoModel = OrderBll.GetModel(KeyID);

            if (OrderInfoModel != null)
            {
                String guid = Guid.NewGuid().ToString().Replace("-", "");
                OrderInfoModel.GUID      = guid;
                OrderInfoModel.ReceiptNo = SysCode.GetNewCode("销售单");

                Audit = OrderInfoType.OrderEnAudit((int)Enums.AddType.网页下单, OrderInfoModel.DisID, OrderInfoModel.Otype);
                OrderInfoModel.IsAudit = Audit;

                //收货地址
                Hi.Model.BD_DisAddr DisAddr = new Hi.BLL.BD_DisAddr().GetModel(OrderInfoModel.AddrID);
                if (DisAddr != null)
                {
                    OrderInfoModel.AddrID    = OrderInfoModel.AddrID;
                    OrderInfoModel.Principal = DisAddr.Principal;
                    OrderInfoModel.Phone     = DisAddr.Phone;
                    OrderInfoModel.Address   = DisAddr.Address;
                }

                OrderInfoModel.PayState     = (int)Enums.PayState.未支付;
                OrderInfoModel.OState       = (int)Enums.OrderState.未提交;
                OrderInfoModel.PayedAmount  = 0;
                OrderInfoModel.ReturnState  = 0;
                OrderInfoModel.ArriveDate   = DateTime.MinValue;
                OrderInfoModel.DisUserID    = this.UserID;
                OrderInfoModel.CreateUserID = this.UserID;
                OrderInfoModel.CreateDate   = DateTime.Now;

                OrderInfoModel.AuditUserID       = 0;
                OrderInfoModel.AuditDate         = DateTime.MinValue;
                OrderInfoModel.AuditRemark       = "";
                OrderInfoModel.ReturnMoneyDate   = DateTime.MinValue;
                OrderInfoModel.ReturnMoneyUserId = 0;
                OrderInfoModel.ReturnMoneyUser   = "";
                OrderInfoModel.ts         = DateTime.Now;
                OrderInfoModel.dr         = 0;
                OrderInfoModel.modifyuser = 0;

                //订单商品明细
                List <Hi.Model.DIS_OrderDetail> l = OrderDetailBll.GetList("", " OrderId=" + KeyID, "");

                List <Hi.Model.DIS_OrderDetail> dl = new List <Hi.Model.DIS_OrderDetail>();

                foreach (Hi.Model.DIS_OrderDetail item in l)
                {
                    //获取商品最新价格
                    decimal Price = SelectGoods.GoodsNewPrice(item.GoodsinfoID, this.DisID, CompID);
                    item.Price       = Price;
                    item.AuditAmount = Price;
                    item.sumAmount   = Price * item.GoodsNum;

                    TotalAmount += item.sumAmount;

                    item.ts         = DateTime.Now;
                    item.dr         = 0;
                    item.modifyuser = 0;

                    dl.Add(item);
                }
                OrderInfoModel.TotalAmount = TotalAmount;
                OrderInfoModel.AuditAmount = TotalAmount;
                //OrderInfoModel.OtherAmount = 0;
                LogRemark += " 下单总价:" + TotalAmount.ToString("N");
                int OrderId = OrderInfoType.TansOrder(OrderInfoModel, dl);

                if (OrderId > 0)
                {
                    Utils.AddSysBusinessLog(this.CompID, "Order", OrderId.ToString(), "订单新增", LogRemark);
                    JScript.AlertMethod(this, "复制成功", JScript.IconOption.正确, "function (){ location.replace('" + ("neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(OrderId.ToString(), Common.EncryptKey)) + "'); }");
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 10
0
    //public void Download_Click(object sender, EventArgs e)
    //{
    //    LinkButton bt = sender as LinkButton;
    //    string fileName = bt.Attributes["fileName"];
    //    string filePath = Server.MapPath("../UploadFile/") + fileName;
    //    if (File.Exists(filePath))
    //    {
    //        FileInfo file = new FileInfo(filePath);
    //        Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); //解决中文乱码
    //        Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name.Substring(0, file.Name.LastIndexOf("_")) + Path.GetExtension(file.Name))); //解决中文文件名乱码
    //        Response.AddHeader("Content-length", file.Length.ToString());
    //        Response.ContentType = "appliction/octet-stream";
    //        Response.WriteFile(file.FullName);
    //        Response.Flush();
    //        Response.End();
    //    }
    //    else
    //    {
    //        JScript.AlertMsgOne(this, "附件不存在!", JScript.IconOption.错误);
    //    }
    //}


    /// <summary>
    /// 附件绑定
    /// </summary>
    //public void DataBindLink()
    //{
    //    string goodsId = Request.QueryString["goodsId"];
    //    if (!string.IsNullOrWhiteSpace(goodsId))
    //    {
    //        //string gid = Common.DesDecrypt(Request["goodsId"], Common.EncryptKey);
    //        Hi.Model.BD_Goods model = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(goodsId));
    //        if (model != null && model.CompID == this.CompID)
    //        {
    //            if (!string.IsNullOrEmpty(model.registeredCertificate))
    //            {
    //                LinkButton linkFile = new LinkButton();
    //                linkFile.Click += new EventHandler(Download_Click);

    //                if (model.registeredCertificate.LastIndexOf("_") != -1)
    //                {
    //                    string text = model.registeredCertificate.Substring(0, model.registeredCertificate.LastIndexOf("_")) + Path.GetExtension(model.registeredCertificate);
    //                    if (text.Length < 15)
    //                        linkFile.Text = text;
    //                    else
    //                    {
    //                        linkFile.Text = text.Substring(0, 15) + "...";
    //                    }
    //                    linkFile.Attributes.Add("title", text);
    //                }
    //                else
    //                {
    //                    string text = model.registeredCertificate.Substring(0, model.registeredCertificate.LastIndexOf("-")) + Path.GetExtension(model.registeredCertificate);
    //                    if (text.Length < 15)
    //                        linkFile.Text = text;
    //                    else
    //                    {
    //                        linkFile.Text = text.Substring(0, 15) + "...";
    //                    }
    //                    linkFile.Attributes.Add("title", text);
    //                }
    //                linkFile.Style.Add("text-decoration", "underline");
    //                linkFile.Attributes.Add("fileName", model.registeredCertificate);
    //                HtmlGenericControl div = new HtmlGenericControl("div");
    //                div.Controls.Add(linkFile);
    //                UpFileText2.Controls.Add(div);

    //            }
    //        }

    //    }
    //}



    /// <summary>
    /// 商品信息绑定
    /// </summary>
    public void Bind()
    {
        Hi.Model.BD_Goods model = new Hi.BLL.BD_Goods().GetModel(goodsId);
        if (model != null)
        {
            GetZiDingYi(model);
            string zhek = Cuxiao();
            if (!Util.IsEmpty(zhek))
            {
                this.lblGoodsName.InnerHtml = model.GoodsName + SelectGoods.ProType(zhek); //商品名称
                tiele_name = model.GoodsName;                                              //前台title显示
                Hi.Model.BD_GoodsInfo godosInfomodel = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                if (this.CompID.ToString() == model.CompID.ToString())
                {
                    this.YuanPrice.InnerHtml = "<s><i>原价:</i><b class=\"red\" id=\"B1\">¥" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(godosInfomodel.TinkerPrice).ToString())).ToString("#,##0.00") + "</b></s>";
                }
            }
            else
            {
                this.lblGoodsName.InnerHtml = model.GoodsName;
                tiele_name = model.GoodsName;//前台title显示
                this.YuanPrice.InnerHtml = "";
            }
            this.lblunit.InnerText       = model.Unit;
            this.lblGoodsTitle.InnerText = model.Title;//商品卖点
            hideInfo1 = model.HideInfo1;
            hideInfo2 = model.HideInfo2;
            if (!Util.IsEmpty(model.Details.Trim()))
            {
                this.lblGoodsDetali.InnerHtml = model.Details;//商品描述
            }
            if (!Util.IsEmpty(model.registeredCertificate.Trim()))
            {
                string url = Common.GetWebConfigKey("OssImgPath") + "/UploadFile/" + model.registeredCertificate;
                this.lblGoodsDetali1.InnerHtml = "<img width=\"600\" src=\"" + url + "\"/>";
            }

            if (model != null && !string.IsNullOrEmpty(model.Pic))
            {
                this.imgPic.Src = Common.GetPicURL(model.Pic, "resize400");
                this.imgPic.Attributes.Add("jqimg", Common.GetPicURL(model.Pic));
            }

            //this.lblPrice.InnerText = "¥" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(model.SalePrice.ToString()).ToString())).ToString("#,##0.00"); ;//商品价格

            string html = string.Empty;
            List <Hi.Model.BD_GoodsAttrs> ll = new Hi.BLL.BD_GoodsAttrs().GetList("", "isnull(dr,0)=0 and compId=" + compID + " and goodsId=" + goodsId.ToString(), "");
            if (ll.Count > 0)
            {
                foreach (Hi.Model.BD_GoodsAttrs item in ll)
                {
                    int xy = 0;
                    List <Hi.Model.BD_GoodsAttrsInfo> lll = new Hi.BLL.BD_GoodsAttrsInfo().GetList("", "isnull(dr,0)=0 and compId=" + compID + " and attrsId=" + item.ID, "");
                    if (lll.Count > 0)
                    {
                        html += "<div class=\"li\"><div class=\"t\" tip=\"" + item.AttrsName + "\">" + item.AttrsName + ":</div><div class=\"n\">";
                        foreach (Hi.Model.BD_GoodsAttrsInfo item2 in lll)
                        {
                            if (goodsInfoId == 0)
                            {
                                html += "<a href=\"javascript:;\" class=\"" + (xy == 0 ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                            }
                            else
                            {
                                Hi.Model.BD_GoodsInfo model2 = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                                if (model2 != null)
                                {
                                    html += "<a href=\"javascript:;\" class=\"" + (model2.Value1 == item2.AttrsInfoName || model2.Value2 == item2.AttrsInfoName || model2.Value3 == item2.AttrsInfoName ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                                }
                            }
                            xy++;
                        }
                        html += "</div></div>";
                    }
                }
            }
            litAttrVaue.InnerHtml = html;
            List <Hi.Model.BD_DisCollect> llll = new Hi.BLL.BD_DisCollect().GetList("", "isnull(dr,0)=0 and comPid=" + model.CompID + " and goodsId=" + goodsId + " and disId=" + this.DisID, "");
            if (llll.Count > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btns .keep\").html('<i class=\"sc-icon\" style=\"background-position:0 -73px;\"></i>取消收藏\');})</script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btns .keep\").html('<i class=\"sc-icon\" ></i>加入收藏\');})</script>");
            }
        }
    }