Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int fatherID = 0;
                fatherID = RequestHelper.GetQueryString <int>("FatherID");
                if (fatherID == int.MinValue)
                {
                    fatherID = 1;
                }
                MenuInfo fatherMenu = MenuBLL.ReadMenuCache(fatherID);
                FatherID.DataSource     = MenuBLL.ReadMenuAllNamedChildList(fatherID);
                FatherID.DataTextField  = "MenuName";
                FatherID.DataValueField = "ID";
                FatherID.DataBind();
                FatherID.Items.Insert(0, new ListItem(fatherMenu.MenuName, fatherMenu.ID.ToString()));
                for (int i = 1; i <= 60; i++)
                {
                    MenuImage.Items.Add(new ListItem("<img src=\"/Admin/Style/Icon/" + i + "-icon.gif\"/>", i.ToString()));
                }
                MenuImage.SelectedIndex = 0;

                int menuID = RequestHelper.GetQueryString <int>("ID");
                if (menuID != int.MinValue)
                {
                    CheckAdminPower("ReadMenu", PowerCheckType.Single);
                    MenuInfo menu = MenuBLL.ReadMenuCache(menuID);
                    FatherID.Text           = menu.FatherID.ToString();
                    OrderID.Text            = menu.OrderID.ToString();
                    MenuName.Text           = menu.MenuName;
                    MenuImage.SelectedValue = menu.MenuImage.ToString();
                    URL.Text = menu.URL;
                }
            }
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         FatherID.DataSource     = WechatMenuBLL.ReadRootList();
         FatherID.DataTextField  = "Name";
         FatherID.DataValueField = "Id";
         FatherID.DataBind();
         FatherID.Items.Insert(0, new ListItem("作为一级菜单", "0"));
         OrderID.Text = WechatMenuBLL.MaxOrderId("WechatMenu").ToString();
         int menuID = RequestHelper.GetQueryString <int>("ID");
         if (menuID > 0)
         {
             var theMenu = WechatMenuBLL.Read(menuID);
             FatherID.Text = theMenu.FatherId.ToString();
             Name.Text     = theMenu.Name;
             MenuType.Text = theMenu.Type;
             OrderID.Text  = theMenu.OrderId.ToString();
             if (theMenu.Type == "click")
             {
                 MenuKey.Text = theMenu.Key;
             }
             else
             {
                 MenuKey.Text = theMenu.Url;
             }
         }
     }
 }
Example #3
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();
         }
     }
 }
        /// <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();
                }
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int      voteID = RequestHelper.GetQueryString <int>("ID");
                VoteInfo vote   = VoteBLL.ReadVote(voteID);
                FatherID.DataSource     = VoteBLL.ReadNamedList().Where(k => k.ID != voteID);
                FatherID.DataTextField  = "Title";
                FatherID.DataValueField = "ID";
                FatherID.DataBind();
                FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));

                if (voteID != int.MinValue)
                {
                    CheckAdminPower("ReadVote", PowerCheckType.Single);

                    FatherID.Text = vote.FatherID.ToString();
                    Title.Text    = vote.Title;
                    OrderID.Text  = vote.OrderID.ToString();
                    Note.Text     = vote.Note;
                }
            }
        }