示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         FatherID.DataSource     = ArticleClassBLL.ReadNamedList();
         FatherID.DataTextField  = "Name";
         FatherID.DataValueField = "Id";
         FatherID.DataBind();
         FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));
         int ArticleClassID = RequestHelper.GetQueryString <int>("ID");
         int fatherID       = RequestHelper.GetQueryString <int>("FatherID");
         if (ArticleClassID != int.MinValue)
         {
             CheckAdminPower("ReadArticleClass", PowerCheckType.Single);
             ArticleClassInfo articleClass = ArticleClassBLL.Read(ArticleClassID);
             FatherID.Text     = articleClass.ParentId.ToString();
             OrderID.Text      = articleClass.OrderId.ToString();
             ClassName.Text    = articleClass.Name;
             Description.Text  = articleClass.Description;
             AddCol2.InnerText = articleClass.AddCol2;
             Photo.Text        = articleClass.Photo;
             EnClassName.Text  = articleClass.EnName;
             ShowType.Text     = articleClass.ShowType.ToString();
             ShowTerminal.Text = articleClass.ShowTerminal.ToString();
             ImageWidth.Text   = articleClass.ImageWidth.ToString();
             ImageHeight.Text  = articleClass.ImageHeight.ToString();
         }
         else
         {
             FatherID.Text = fatherID.ToString();
         }
     }
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadArticle", PowerCheckType.Single);
                foreach (ArticleClassInfo articleClass in ArticleClassBLL.ReadNamedList())
                {
                    ArticleClassID.Items.Add(new ListItem(articleClass.Name, "|" + articleClass.Id + "|"));
                }
                ArticleClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));
                Title.Text          = RequestHelper.GetQueryString <string>("Title");
                ArticleClassID.Text = RequestHelper.GetQueryString <string>("ClassID");
                IsTop.Text          = RequestHelper.GetQueryString <string>("IsTop");
                //页签的判断
                classID = RequestHelper.GetQueryString <string>("ClassID");
                if (classID != string.Empty)
                {
                    classID = ArticleClassBLL.ReadFullParentId(Convert.ToInt32(classID.Replace("|", string.Empty)));
                    classID = classID.Substring(1, classID.Length - 2);
                    if (classID.IndexOf('|') > -1)
                    {
                        classID = classID.Substring(0, classID.IndexOf('|'));
                    }
                }

                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.Title   = RequestHelper.GetQueryString <string>("Title");
                articleSearch.ClassId = RequestHelper.GetQueryString <string>("ClassID");
                articleSearch.IsTop   = RequestHelper.GetQueryString <int>("IsTop");

                BindControl(ArticleBLL.SearchList(CurrentPage, PageSize, articleSearch, ref Count), RecordList, MyPager);
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 获取当前分类
            if (RequestHelper.GetQueryString <string>("Action") == "GetThisClass")
            {
                GetthisClass();
            }
            #endregion


            if (!Page.IsPostBack)
            {
                foreach (ArticleClassInfo articleClass in ArticleClassBLL.ReadNamedList())
                {
                    ClassID.Items.Add(new ListItem(articleClass.Name, articleClass.Id.ToString()));
                }
                RealDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
                int articleID = RequestHelper.GetQueryString <int>("ID");
                if (articleID != int.MinValue)
                {
                    productPhotoList = ProductPhotoBLL.ReadList(articleID, 1);
                    CheckAdminPower("ReadArticle", PowerCheckType.Single);
                    ArticleInfo article = ArticleBLL.Read(articleID);
                    Title.Text = article.Title;
                    string classID = article.ClassId;
                    if (classID != string.Empty)
                    {
                        classID = classID.Substring(1, classID.Length - 2);
                        if (classID.IndexOf('|') > -1)
                        {
                            classID = classID.Substring(classID.LastIndexOf('|') + 1);
                        }
                    }
                    ClassID.Text = classID;

                    int thisClassID = 0;
                    int.TryParse(classID, out thisClassID);
                    thisClass = ArticleClassBLL.Read(thisClassID);

                    IsTop.Text           = article.IsTop.ToString();
                    Author.Text          = article.Author;
                    Resource.Text        = article.Resource;
                    Keywords.Text        = article.Keywords;
                    Url.Text             = article.Url;
                    Photo.Text           = article.Photo;
                    Summary.Text         = article.Summary;
                    Content.Value        = article.Content;
                    MobileContent.Value  = article.AddCol2;
                    RealDate.Text        = article.RealDate.ToString();
                    OrderID.Text         = article.OrderId.ToString();
                    FilePath.Text        = article.FilePath;
                    Content1.Value       = article.Content1;
                    MobileContent1.Value = article.Mobilecontent1;
                    Content2.Value       = article.Content2;
                    MobileContent2.Value = article.Mobilecontent2;
                    //Content3.Value = article.AddCol3;
                }
            }
        }
示例#4
0
        /// <summary>
        /// 绑定商品分类,品牌,商品类型,规格
        /// </summary>
        protected void BindClassBrandAttributeClassStandardType()
        {
            List <ProductClassInfo> productClassList = ProductClassBLL.ReadNamedList();

            foreach (ProductClassInfo productClass in productClassList)
            {
                RelationClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
            }
            RelationClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));

            foreach (ProductClassInfo productClass in productClassList)
            {
                AccessoryClassID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
            }
            AccessoryClassID.Items.Insert(0, new ListItem("所有分类", string.Empty));


            foreach (ArticleClassInfo articleClass in ArticleClassBLL.ReadNamedList())
            {
                ArticleClassID.Items.Add(new ListItem(articleClass.Name, "|" + articleClass.Id + "|"));
            }
            ArticleClassID.Items.Insert(0, new ListItem("请选择", string.Empty));
        }