コード例 #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                //this.ddlCountry.DataBind();
                this.ddListDisplaySequence.DataBind();

                if (int.TryParse(base.Request.QueryString["importSourceId"], out this.importsId))
                {
                    txtImportSourceId.Text = importsId.ToString();

                    ImportSourceTypeInfo ImInfo = ImportSourceTypeHelper.GetImportSourceTypeInfo(importsId);

                    if (ImInfo != null)
                    {
                        txtCnArea.Text = ImInfo.CnArea;
                        txtEnArea.Text = ImInfo.EnArea;
                        txtRemark.Text = ImInfo.Remark;
                        ddListDisplaySequence.SelectedValue = ImInfo.DisplaySequence;
                        uploaderIcon.UploadedImageUrl       = ImInfo.Icon;
                        //txtHSCode.Text = ImInfo.HSCode;
                        if (ImInfo.FavourableFlag)
                        {
                            radFavourableFlagY.Checked = true;
                        }
                        else
                        {
                            radFavourableFlagN.Checked = true;
                        }
                        hidCountryId.Value = ImInfo.HSCode;
                        hidCountry.Value   = ImInfo.StandardCName;
                    }
                }
            }
        }
コード例 #2
0
        private void BindImportSourceTypes()
        {
            this.LoadParameters();
            ImportSourceTypeQuery importSourceTypeQuery = new ImportSourceTypeQuery
            {
                Remark    = this.remark,
                CnArea    = this.cnArea,
                EnArea    = this.enArea,
                PageSize  = this.pager.PageSize,
                PageIndex = this.pager.PageIndex,
                SortOrder = SortAction.Desc,
                SortBy    = "DisplaySequence",
                StartDate = this.startDate,
                EndDate   = this.endDate
            };

            Globals.EntityCoding(importSourceTypeQuery, true);
            DbQueryResult importSourceTypes = ImportSourceTypeHelper.GetImportSourceTypes(importSourceTypeQuery);

            this.grdImportSourceTypes.DataSource = importSourceTypes.Data;
            this.grdImportSourceTypes.DataBind();

            this.txtCnArea.Text = importSourceTypeQuery.CnArea;
            this.txtEnArea.Text = importSourceTypeQuery.EnArea;
            this.txtRemark.Text = importSourceTypeQuery.Remark;

            this.pager1.TotalRecords = (this.pager.TotalRecords = importSourceTypes.TotalRecords);
        }
コード例 #3
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            if (hidCountryId.Value == "")
            {
                this.ShowMsg("请选择国家。", false);
                return;
            }
            ImportSourceTypeInfo importSourceTypeInfo = new ImportSourceTypeInfo
            {
                CnArea          = txtCnArea.Text,
                EnArea          = txtEnArea.Text,
                Remark          = txtRemark.Text,
                Icon            = uploaderIcon.UploadedImageUrl,
                DisplaySequence = ddListDisplaySequence.SelectedValue,
                HSCode          = hidCountryId.Value,
                FavourableFlag  = radFavourableFlagY.Checked,
                StandardCName   = hidCountry.Value
            };

            int importSourceId = ImportSourceTypeHelper.AddImportSourceType(importSourceTypeInfo);

            if (importSourceId > 0)
            {
                HiCache.Remove("DataCache-ImportSourceTypeInfo");
                this.ShowMsg("添加原产地成功", true);
                base.Response.Redirect(Globals.GetAdminAbsolutePath(string.Format("/product/AddImportSourceTypeComplete.aspx?importSourceId={0}", importSourceId)), true);
                return;
            }
            else
            {
                this.ShowMsg("添加原产地失败,未知错误", false);
            }
        }
コード例 #4
0
        public override void DataBind()
        {
            this.Items.Clear();
            this.Items.Add(new ListItem(this.NullToDisplay, string.Empty));
            IList <ImportSourceTypeInfo> mainImportSourceTypes = ImportSourceTypeHelper.GetAllImportSourceTypes();

            foreach (ImportSourceTypeInfo current in mainImportSourceTypes)
            {
                this.Items.Add(new ListItem(Globals.HtmlDecode(current.CnArea), current.ImportSourceId.ToString()));
            }
        }
コード例 #5
0
        private void grdImportSourceTypes_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>();
            string text = this.grdImportSourceTypes.DataKeys[e.RowIndex].Value.ToString();

            if (text != "")
            {
                list.Add(System.Convert.ToInt32(text));
            }
            if (ImportSourceTypeHelper.DeleteImportSourceTypes(text) > 0)
            {
                this.ShowMsg("删除原产地成功", true);
                this.ReloadImportSourceTypes(false);
            }
        }
コード例 #6
0
        private void RendeImportSourceType(StringBuilder sb)//原产地
        {
            IList <ImportSourceTypeInfo> importSourceTypeInfo = ImportSourceTypeHelper.GetAllImportSourceTypes();

            if (importSourceTypeInfo != null)
            {
                sb.AppendLine("<dl class=\"attribute_dl\">");
                sb.AppendLine("<dt class=\"attribute_name\">产地:</dt>");
                sb.AppendLine("<dd class=\"attribute_val\">");
                sb.AppendLine("<a class=\"more-attr\">更多<span></span></a>");
                sb.AppendLine("<div class=\"h_chooselist\">");
                string text = "all";
                if (this.importSourceId == 0)
                {
                    text += " select";
                }
                sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >不限</a>", text, this.CreateUrl("importsourceid", "")).AppendLine();

                #region 过滤原产地


                foreach (ImportSourceTypeInfo item in importSourceTypeInfo)
                {
                    text = string.Empty;
                    if (this.importSourceId == item.ImportSourceId)
                    {
                        text += " select";
                    }
                    if (search_ProducingStr != null)
                    {
                        if (search_ProducingStr.Contains(item.ImportSourceId.ToString()))
                        {
                            sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", text, this.CreateUrl("importsourceid", item.ImportSourceId.ToString()), item.CnArea).AppendLine();
                        }
                    }
                    else
                    {
                        sb.AppendFormat("<a class=\"{0}\" href=\"{1}\" >{2}</a>", text, this.CreateUrl("importsourceid", item.ImportSourceId.ToString()), item.CnArea).AppendLine();
                    }
                }
                #endregion
                sb.AppendLine("</div>");
                sb.AppendLine("</dd>");
                sb.AppendLine("</dl>");
            }
        }
コード例 #7
0
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择要删除的原产地", false);
                return;
            }
            int num = ImportSourceTypeHelper.DeleteImportSourceTypes(text);

            if (num > 0)
            {
                this.ShowMsg("成功删除了选择的原产地", true);
                this.BindImportSourceTypes();
                return;
            }
            this.ShowMsg("删除原产地失败,未知错误", false);
        }
コード例 #8
0
        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat(" <div class=\"brush-list\"  id=\"{0}\">", this.ID);
            //原产地列表
            IList <ImportSourceTypeInfo> importSourceTypelist = ImportSourceTypeHelper.GetAllImportSourceTypes();

            stringBuilder.Append(" <ol class=\"fix\"><h4>地区</h4><div class=\"fix\"><a class=\"selected\">不限</a>");

            if (importSourceTypelist != null)
            {
                foreach (ImportSourceTypeInfo item in importSourceTypelist)
                {
                    stringBuilder.AppendFormat("<a name=\"{0}\">{1}</a>", item.ImportSourceId.ToString(), item.CnArea);
                }
            }

            stringBuilder.AppendFormat("</div></ol>");

            //根据商品分类获取品牌
            DataTable brandCategories = CategoryBrowser.GetBrandCategories(this.categoryId, 1000);

            stringBuilder.Append(" <ol class=\"fix\"><h4>品牌</h4><div class=\"fix\"><a class=\"selected\">不限</a>");

            if (brandCategories != null && brandCategories.Rows.Count > 0)
            {
                foreach (DataRow dataRow in brandCategories.Rows)
                {
                    stringBuilder.AppendFormat("<a name=\"{0}\">{1}</a>", dataRow["BrandId"].ToString(), dataRow["BrandName"]);
                }
            }

            stringBuilder.AppendFormat("</div></ol>");

            stringBuilder.Append("</div>");

            writer.Write(stringBuilder.ToString());
        }
コード例 #9
0
        protected void Restore()
        {
            TplCfgInfo tplCfgById = VShopHelper.GetTplCfgById(this.id);

            this.txtBannerDesc.Text    = tplCfgById.ShortDesc;
            this.ddlType.SelectedValue = tplCfgById.LocationType.ToString();
            this.littlepic.Src         = tplCfgById.ImageUrl;
            this.fmSrc.Value           = tplCfgById.ImageUrl;
            switch (tplCfgById.LocationType)
            {
            case LocationType.Topic:
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.DataSource     = VShopHelper.Gettopics();
                this.ddlSubType.DataTextField  = "Title";
                this.ddlSubType.DataValueField = "TopicId";
                this.ddlSubType.DataBind();
                this.ddlSubType.SelectedValue = tplCfgById.Url;
                break;

            case (LocationType)1:
            case LocationType.Home:
            case LocationType.ShoppingCart:
            case LocationType.OrderCenter:
            case LocationType.VipCard:
            case LocationType.GroupBuy:
                break;

            case LocationType.Brand:
                int BrandId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int.TryParse(tplCfgById.Url, out BrandId);
                }
                this.dropBrandTypes.Attributes.CssStyle.Remove("display");
                this.dropBrandTypes.DataSource     = ControlProvider.Instance().GetBrandCategories();
                this.dropBrandTypes.DataTextField  = "BrandName";
                this.dropBrandTypes.DataValueField = "BrandId";
                this.dropBrandTypes.DataBind();
                if (BrandId > 0)
                {
                    dropBrandTypes.SelectedValue = BrandId;
                }
                break;

            case LocationType.Category:
                int categoryId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out categoryId);
                    //}
                    int.TryParse(tplCfgById.Url, out categoryId);
                }
                this.dropCategories.Attributes.CssStyle.Remove("display");
                this.dropCategories.DataSource     = CatalogHelper.GetMainCategories();
                this.dropCategories.DataTextField  = "Name";
                this.dropCategories.DataValueField = "CategoryId";
                this.dropCategories.DataBind();
                if (categoryId > 0)
                {
                    dropCategories.SelectedValue = categoryId;
                }
                break;

            case LocationType.ImportSourceType:
                int importSourceId = 0;
                if (tplCfgById != null && !string.IsNullOrEmpty(tplCfgById.Url))
                {
                    //string[] str = tplCfgById.Url.Split('?');
                    //if (str.Length > 0)
                    //{
                    //    string[] str1 = (tplCfgById.Url.Split('?')[1]).Split('=');
                    //    int.TryParse(str1[1].ToString(), out importSourceId);
                    //}
                    int.TryParse(tplCfgById.Url, out importSourceId);
                }
                this.dropImportSourceType.Attributes.CssStyle.Remove("display");
                this.dropImportSourceType.DataSource     = ImportSourceTypeHelper.GetAllImportSourceTypes();
                this.dropImportSourceType.DataTextField  = "CnArea";
                this.dropImportSourceType.DataValueField = "ImportSourceId";
                this.dropImportSourceType.DataBind();
                if (importSourceId > 0)
                {
                    dropImportSourceType.SelectedValue = importSourceId;
                }
                break;

            case LocationType.Activity:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                this.ddlSubType.BindEnum <EcShop.Entities.VShop.LocationType>("");       //修改1
                this.ddlSubType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0];
                this.ddlThridType.Attributes.CssStyle.Remove("display");
                LotteryActivityType lotteryActivityType = (LotteryActivityType)System.Enum.Parse(typeof(LotteryActivityType), tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[0]);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    this.ddlThridType.DataSource =
                        from item in VShopHelper.GetAllActivity()
                        select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                }
                else
                {
                    this.ddlThridType.DataSource = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                }
                this.ddlThridType.DataTextField  = "ActivityName";
                this.ddlThridType.DataValueField = "Activityid";
                this.ddlThridType.DataBind();
                this.ddlThridType.SelectedValue = tplCfgById.Url.Split(new char[]
                    {
                        ','
                    })[1];
                return;
            }

            case LocationType.Link:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Phone:
                this.Tburl.Text = tplCfgById.Url;
                this.Tburl.Attributes.CssStyle.Remove("display");
                return;

            case LocationType.Address:
                this.Tburl.Attributes.CssStyle.Remove("display");
                this.navigateDesc.Attributes.CssStyle.Remove("display");
                this.Tburl.Text = tplCfgById.Url;
                return;

            case LocationType.Article:
            {
                this.ddlSubType.Attributes.CssStyle.Remove("display");
                System.Collections.Generic.IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                this.ddlSubType.Items.Clear();
                int num  = 0;
                int num2 = 0;
                if (!string.IsNullOrEmpty(tplCfgById.Url))
                {
                    int num3 = tplCfgById.Url.LastIndexOf('=');
                    int.TryParse(tplCfgById.Url.Substring(num3 + 1), out num);
                }
                if (num > 0)
                {
                    ArticleInfo article = CommentBrowser.GetArticle(num);
                    if (article != null)
                    {
                        num2 = article.CategoryId;
                    }
                }
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    foreach (ArticleCategoryInfo current in articleMainCategories)
                    {
                        this.ddlSubType.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.CategoryId.ToString()));
                    }
                    if (num2 > 0)
                    {
                        this.ddlSubType.SelectedValue = num2.ToString();
                    }
                }
                if (num > 0)
                {
                    this.ddlThridType.Attributes.CssStyle.Remove("display");
                    System.Collections.Generic.IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num2, 1000);
                    foreach (ArticleInfo current2 in articleList)
                    {
                        this.ddlThridType.Items.Add(new System.Web.UI.WebControls.ListItem(current2.Title, current2.ArticleId.ToString()));
                    }
                    this.ddlThridType.SelectedValue = num.ToString();
                    return;
                }
                break;
            }

            case LocationType.Product:

                this.linkSelectProduct.Attributes.CssStyle.Remove("display");
                this.productName.Attributes.CssStyle.Remove("display");
                this.productid.Value = tplCfgById.Url;
                int result;
                if (int.TryParse(tplCfgById.Url, out result))
                {
                    this.productName.InnerText = ProductHelper.GetProductDetails(result).ProductName;
                }


                break;

            default:
                return;
            }
        }