예제 #1
0
 /// <summary>
 /// 页面加载方法
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         CheckAdminPower("ReadProductType", PowerCheckType.Single);
         BindControl(ProductTypeBLL.ReadList(), RecordList);
     }
 }
예제 #2
0
        /// <summary>
        /// 页面加载方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                FatherID.DataSource     = ProductClassBLL.ReadNamedList();
                FatherID.DataTextField  = "Name";
                FatherID.DataValueField = "ID";
                FatherID.DataBind();
                FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));
                //foreach (ProductClassInfo productClass in ProductClassBLL.ReadNamedList())
                //{
                //    FatherID.Items.Add(new ListItem(productClass.Name, "|" + productClass.Id + "|"));
                //}
                //FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));

                ProductType.DataSource     = ProductTypeBLL.ReadList();
                ProductType.DataTextField  = "Name";
                ProductType.DataValueField = "ID";
                ProductType.DataBind();
                ProductType.Items.Insert(0, new ListItem("请选择类型", "0"));

                int productClassID = RequestHelper.GetQueryString <int>("ID");
                int fatherID       = RequestHelper.GetQueryString <int>("FatherID");
                if (productClassID != int.MinValue)
                {
                    CheckAdminPower("ReadProductClass", PowerCheckType.Single);
                    ProductClassInfo productClass = ProductClassBLL.Read(productClassID);
                    FatherID.Text     = productClass.ParentId.ToString();
                    OrderID.Text      = productClass.OrderId.ToString();
                    ClassName.Text    = productClass.Name;
                    Keywords.Text     = productClass.Keywords;
                    Description.Value = productClass.Remark;
                    Photo.Text        = productClass.Photo;
                    ProductType.Text  = productClass.ProductTypeId.ToString();

                    EnClassName.Text = productClass.EnClassName;
                    PageTitle.Text   = productClass.PageTitle;
                    PageKeyWord.Text = productClass.PageKeyWord;
                    PageSummary.Text = productClass.PageSummary;
                }
                else
                {
                    FatherID.Text = fatherID.ToString();
                }
            }
        }