Beispiel #1
0
        private void BindArticleCategory()
        {
            List <Hidistro.Entities.VShop.ReplyInfo> list = ReplyHelper.GetAllReply().ToList <Hidistro.Entities.VShop.ReplyInfo>().FindAll(a => a.ReplyType < ReplyType.Wheel);

            this.rptList.DataSource = list;
            this.rptList.DataBind();
        }
Beispiel #2
0
        private void BindArticleCategory()
        {
            List <ReplyInfo> list = ReplyHelper.GetAllReply(this.wid).ToList <ReplyInfo>().FindAll(a => a.ReplyType < ReplyType.Wheel);

            this.grdArticleCategories.DataSource = list;
            this.grdArticleCategories.DataBind();
        }
Beispiel #3
0
        protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindType bindType = (BindType)Convert.ToInt32(this.ddlType.SelectedValue);

            switch (bindType)
            {
            case BindType.Url:
                this.liUrl.Visible   = true;
                this.liValue.Visible = false;
                break;

            case BindType.Key:
            case BindType.Topic:
                this.liUrl.Visible   = false;
                this.liValue.Visible = true;
                break;

            default:
                this.liUrl.Visible   = false;
                this.liValue.Visible = false;
                break;
            }
            this.btnAddMenu.Enabled = true;
            switch (bindType)
            {
            case BindType.Key:
                this.liTitle.InnerText   = "选择关键字:";
                this.ddlValue.DataSource = from a in ReplyHelper.GetAllReply()
                                           where !string.IsNullOrWhiteSpace(a.Keys)
                                           select a;
                this.ddlValue.DataTextField  = "Keys";
                this.ddlValue.DataValueField = "Id";
                this.ddlValue.DataBind();
                break;

            case BindType.Topic:
            {
                this.liTitle.InnerText = "选择页面:";
                IList <TopicInfo> list = VShopHelper.Gettopics();
                if (list.Count > 0)
                {
                    this.ddlValue.DataSource     = list;
                    this.ddlValue.DataTextField  = "Title";
                    this.ddlValue.DataValueField = "TopicId";
                    this.ddlValue.DataBind();
                }
                else
                {
                    this.ddlValue.Items.Clear();
                    ListItem listItem = new ListItem();
                    listItem.Text  = "";
                    listItem.Value = "";
                    this.ddlValue.Items.Insert(0, listItem);
                    this.btnAddMenu.Enabled = false;
                }
                break;
            }
            }
        }
Beispiel #4
0
        protected void ddlType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            BindType bindType  = (BindType)System.Convert.ToInt32(this.ddlType.SelectedValue);
            BindType bindType2 = bindType;

            switch (bindType2)
            {
            case BindType.Key:
            case BindType.Topic:
                this.liUrl.Visible   = false;
                this.liValue.Visible = true;
                break;

            default:
                if (bindType2 == BindType.Url)
                {
                    this.liUrl.Visible   = true;
                    this.liValue.Visible = false;
                }
                else
                {
                    this.liUrl.Visible   = false;
                    this.liValue.Visible = false;
                }
                break;
            }
            switch (bindType)
            {
            case BindType.Key:
                this.liTitle.InnerText   = "选择关键字:";
                this.ddlValue.DataSource =
                    from a in ReplyHelper.GetAllReply()
                    where !string.IsNullOrWhiteSpace(a.Keys)
                    select a;
                this.ddlValue.DataTextField  = "Keys";
                this.ddlValue.DataValueField = "Id";
                this.ddlValue.DataBind();
                return;

            case BindType.Topic:
                this.liTitle.InnerText       = "选择专题:";
                this.ddlValue.DataSource     = VShopHelper.Gettopics();
                this.ddlValue.DataTextField  = "Title";
                this.ddlValue.DataValueField = "TopicId";
                this.ddlValue.DataBind();
                return;

            default:
                return;
            }
        }
Beispiel #5
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList()
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            List <ReplyInfo> list = ReplyHelper.GetAllReply().ToList().FindAll((ReplyInfo a) => a.ReplyType < ReplyType.Wheel);

            dataGridViewModel.rows  = new List <Dictionary <string, object> >();
            dataGridViewModel.total = list.Count;
            foreach (ReplyInfo item in list)
            {
                Dictionary <string, object> dictionary = item.ToDictionary();
                dictionary.Add("ReplyTypeName", this.GetReplyTypeName(item.ReplyType));
                dataGridViewModel.rows.Add(dictionary);
            }
            return(dataGridViewModel);
        }
Beispiel #6
0
        protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindType type = (BindType)Convert.ToInt32(this.ddlType.SelectedValue);

            switch (type)
            {
            case BindType.Key:
            case BindType.Topic:
                this.liUrl.Visible   = false;
                this.liValue.Visible = true;
                break;

            case BindType.Url:
                this.liUrl.Visible   = true;
                this.liValue.Visible = false;
                break;

            default:
                this.liUrl.Visible   = false;
                this.liValue.Visible = false;
                break;
            }
            switch (type)
            {
            case BindType.Key:
                this.ddlValue.DataSource = from a in ReplyHelper.GetAllReply(this.wid)
                                           where !string.IsNullOrWhiteSpace(a.Keys)
                                           select a;
                this.ddlValue.DataTextField  = "Keys";
                this.ddlValue.DataValueField = "Id";
                this.ddlValue.DataBind();
                return;

            case BindType.Topic:
                this.ddlValue.DataSource     = VShopHelper.Gettopics();
                this.ddlValue.DataTextField  = "Title";
                this.ddlValue.DataValueField = "TopicId";
                this.ddlValue.DataBind();
                return;
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.btnAddMenu.Click += new System.EventHandler(this.btnAddMenu_Click);
            if (!this.Page.IsPostBack)
            {
                this.liValue.Visible = false;
                this.liUrl.Visible   = false;
                int      urlIntParam = base.GetUrlIntParam("MenuId");
                MenuInfo menu        = VShopHelper.GetMenu(urlIntParam);
                this.txtMenuName.Text = menu.Name;
                if (menu.ParentMenuId == 0)
                {
                    if (VShopHelper.GetMenusByParentId(urlIntParam, ClientType.AliOH).Count > 0)
                    {
                        this.liBind.Visible = false;
                    }
                    this.liParent.Visible = false;
                }
                else
                {
                    this.lblParent.Text = VShopHelper.GetMenu(menu.ParentMenuId).Name;
                }
                this.ddlType.SelectedValue = System.Convert.ToString((int)menu.BindType);
                BindType bindType = menu.BindType;
                switch (bindType)
                {
                case BindType.Key:
                case BindType.Topic:
                    this.liUrl.Visible   = false;
                    this.liValue.Visible = true;
                    break;

                default:
                    if (bindType != BindType.Url)
                    {
                        this.liUrl.Visible   = false;
                        this.liValue.Visible = false;
                    }
                    else
                    {
                        this.liUrl.Visible   = true;
                        this.liValue.Visible = false;
                    }
                    break;
                }
                bindType = menu.BindType;
                switch (bindType)
                {
                case BindType.Key:
                    this.ddlValue.DataSource =
                        from a in ReplyHelper.GetAllReply()
                        where !string.IsNullOrWhiteSpace(a.Keys)
                        select a;
                    this.ddlValue.DataTextField  = "Keys";
                    this.ddlValue.DataValueField = "Id";
                    this.ddlValue.DataBind();
                    this.ddlValue.SelectedValue = menu.ReplyId.ToString();
                    break;

                case BindType.Topic:
                    this.ddlValue.DataSource     = VShopHelper.Gettopics();
                    this.ddlValue.DataTextField  = "Title";
                    this.ddlValue.DataValueField = "TopicId";
                    this.ddlValue.DataBind();
                    this.ddlValue.SelectedValue = menu.Content;
                    break;

                default:
                    if (bindType == BindType.Url)
                    {
                        this.txtUrl.Text = menu.Content;
                    }
                    break;
                }
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.btnAddMenu.Click += new System.EventHandler(this.btnAddMenu_Click);
            if (!this.Page.IsPostBack)
            {
                this.liValue.Visible = false;
                this.liUrl.Visible   = false;
                MenuInfo menuInfo = new MenuInfo();
                if (this.id > 0)
                {
                    menuInfo = VShopHelper.GetMenu(this.id);
                    if (menuInfo != null)
                    {
                        this.txtMenuName.Text = menuInfo.Name;
                        if (menuInfo.ParentMenuId == 0)
                        {
                            System.Collections.Generic.IList <MenuInfo> menusByParentId = VShopHelper.GetMenusByParentId(this.id);
                            if (menusByParentId.Count > 0)
                            {
                                this.liBind.Visible = false;
                                this.iframeHeight  -= this.oneLineHeight;
                            }
                            this.liParent.Visible = false;
                            this.iframeHeight    -= this.oneLineHeight;
                        }
                        else
                        {
                            this.iNameByteWidth = 20;
                            this.lblParent.Text = VShopHelper.GetMenu(menuInfo.ParentMenuId).Name;
                        }
                        this.ddlType.SelectedValue = System.Convert.ToString((int)menuInfo.BindType);
                        BindType bindType = menuInfo.BindType;
                        switch (bindType)
                        {
                        case BindType.Key:
                        case BindType.Topic:
                            this.liUrl.Visible   = false;
                            this.liValue.Visible = true;
                            break;

                        default:
                            if (bindType == BindType.Url)
                            {
                                this.liUrl.Visible   = true;
                                this.liValue.Visible = false;
                            }
                            else
                            {
                                this.liUrl.Visible   = false;
                                this.liValue.Visible = false;
                            }
                            break;
                        }
                        BindType bindType2 = menuInfo.BindType;
                        if (bindType2 != BindType.Key)
                        {
                            if (bindType2 == BindType.Url)
                            {
                                this.txtUrl.Text = menuInfo.Content;
                            }
                        }
                        else
                        {
                            this.ddlValue.DataSource = from a in ReplyHelper.GetAllReply()
                                                       where !string.IsNullOrWhiteSpace(a.Keys)
                                                       select a;
                            this.ddlValue.DataTextField  = "Keys";
                            this.ddlValue.DataValueField = "Id";
                            this.ddlValue.DataBind();
                            this.ddlValue.SelectedValue = menuInfo.ReplyId.ToString();
                        }
                    }
                    else
                    {
                        this.ShowMsgAndReUrl("参数不正确", false, "ManageMenu.aspx", "parent");
                    }
                }
                else if (this.parentid > 0)
                {
                    MenuInfo menu = VShopHelper.GetMenu(this.parentid);
                    if (menuInfo != null)
                    {
                        this.iNameByteWidth = 20;
                        this.lblParent.Text = menu.Name;
                    }
                    else
                    {
                        this.ShowMsgAndReUrl("参数不正确", false, "ManageMenu.aspx", "parent");
                    }
                }
                else
                {
                    this.iframeHeight    -= this.oneLineHeight;
                    this.liParent.Visible = false;
                }
                this.hdfIframeHeight.Value = this.iframeHeight.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.btnAddMenu.Click += new EventHandler(this.btnAddMenu_Click);
            if (!this.Page.IsPostBack)
            {
                this.liValue.Visible = false;
                this.liUrl.Visible   = false;
                MenuInfo info = new MenuInfo();
                if (this.id <= 0)
                {
                    if (this.parentid > 0)
                    {
                        MenuInfo fuwuMenu = VShopHelper.GetFuwuMenu(this.parentid);
                        if (info != null)
                        {
                            this.iNameByteWidth = 20;
                            this.lblParent.Text = fuwuMenu.Name;
                        }
                        else
                        {
                            this.ShowMsgAndReUrl("参数不正确", false, "ManageMenu.aspx", "parent");
                        }
                    }
                    else
                    {
                        this.iframeHeight    -= this.oneLineHeight;
                        this.liParent.Visible = false;
                    }
                }
                else
                {
                    info = VShopHelper.GetFuwuMenu(this.id);
                    if (info == null)
                    {
                        this.ShowMsgAndReUrl("参数不正确", false, "ManageMenu.aspx", "parent");
                    }
                    else
                    {
                        this.txtMenuName.Text = info.Name;
                        if (info.ParentMenuId == 0)
                        {
                            if (VShopHelper.GetFuwuMenusByParentId(this.id).Count > 0)
                            {
                                this.liBind.Visible = false;
                                this.iframeHeight  -= this.oneLineHeight;
                            }
                            this.liParent.Visible = false;
                            this.iframeHeight    -= this.oneLineHeight;
                        }
                        else
                        {
                            this.iNameByteWidth = 20;
                            this.lblParent.Text = VShopHelper.GetFuwuMenu(info.ParentMenuId).Name;
                        }
                        this.ddlType.SelectedValue = Convert.ToString((int)info.BindType);
                        switch (info.BindType)
                        {
                        case BindType.Key:
                        case BindType.Topic:
                            this.liUrl.Visible   = false;
                            this.liValue.Visible = true;
                            break;

                        case BindType.Url:
                            this.liUrl.Visible   = true;
                            this.liValue.Visible = false;
                            break;

                        default:
                            this.liUrl.Visible   = false;
                            this.liValue.Visible = false;
                            break;
                        }
                        switch (info.BindType)
                        {
                        case BindType.Key:
                            this.ddlValue.DataSource = from a in ReplyHelper.GetAllReply()
                                                       where !string.IsNullOrWhiteSpace(a.Keys)
                                                       select a;
                            this.ddlValue.DataTextField  = "Keys";
                            this.ddlValue.DataValueField = "Id";
                            this.ddlValue.DataBind();
                            this.ddlValue.SelectedValue = info.ReplyId.ToString();
                            break;

                        case BindType.Url:
                            this.txtUrl.Text = info.Content;
                            break;
                        }
                    }
                }
                this.hdfIframeHeight.Value = this.iframeHeight.ToString();
            }
        }
        protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindType bindType = (BindType)Convert.ToInt32(this.ddlType.SelectedValue);

            switch (bindType)
            {
            case BindType.Key:
            case BindType.Topic:
                this.liUrl.Visible   = false;
                this.liValue.Visible = true;
                break;

            case BindType.Url:
                this.liUrl.Visible   = true;
                this.liValue.Visible = false;
                break;

            default:
                this.liUrl.Visible   = false;
                this.liValue.Visible = false;
                break;
            }
            if (bindType != BindType.Key)
            {
                return;
            }
            this.ddlValue.DataSource     = (object)Enumerable.Where <ReplyInfo>((IEnumerable <ReplyInfo>)ReplyHelper.GetAllReply(), (Func <ReplyInfo, bool>)(a => !string.IsNullOrWhiteSpace(a.Keys)));
            this.ddlValue.DataTextField  = "Keys";
            this.ddlValue.DataValueField = "Id";
            this.ddlValue.DataBind();
        }
Beispiel #11
0
 private void BindArticleCategory()
 {
     System.Collections.Generic.List <Hidistro.Entities.VShop.ReplyInfo> dataSource = ReplyHelper.GetAllReply().ToList <Hidistro.Entities.VShop.ReplyInfo>().FindAll((Hidistro.Entities.VShop.ReplyInfo a) => a.ReplyType < ReplyType.Wheel);
     this.rptList.DataSource = dataSource;
     this.rptList.DataBind();
 }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.btnAddMenu.Click += this.btnAddMenu_Click;
            if (!this.Page.IsPostBack)
            {
                this.liValue.Visible = false;
                this.liUrl.Visible   = false;
                int      urlIntParam = base.GetUrlIntParam("MenuId");
                MenuInfo menu        = VShopHelper.GetMenu(urlIntParam);
                this.txtMenuName.Text = menu.Name;
                if (menu.ParentMenuId == 0)
                {
                    IList <MenuInfo> menusByParentId = VShopHelper.GetMenusByParentId(urlIntParam, ClientType.VShop);
                    if (menusByParentId.Count > 0)
                    {
                        this.liBind.Visible = false;
                    }
                    this.liParent.Visible = false;
                }
                else
                {
                    this.lblParent.Text = VShopHelper.GetMenu(menu.ParentMenuId).Name;
                }
                this.ddlType.SelectedValue = Convert.ToString((int)menu.BindType);
                switch (menu.BindType)
                {
                case BindType.Url:
                    this.liUrl.Visible   = true;
                    this.liValue.Visible = false;
                    break;

                case BindType.Key:
                case BindType.Topic:
                    this.liUrl.Visible   = false;
                    this.liValue.Visible = true;
                    break;

                default:
                    this.liUrl.Visible   = false;
                    this.liValue.Visible = false;
                    break;
                }
                switch (menu.BindType)
                {
                case BindType.Key:
                    this.liTitle.InnerText   = "选择关键字:";
                    this.ddlValue.DataSource = from a in ReplyHelper.GetAllReply()
                                               where !string.IsNullOrWhiteSpace(a.Keys)
                                               select a;
                    this.ddlValue.DataTextField  = "Keys";
                    this.ddlValue.DataValueField = "ReplyId";
                    this.ddlValue.DataBind();
                    this.ddlValue.SelectedValue = menu.ReplyId.ToString();
                    break;

                case BindType.Topic:
                    this.liTitle.InnerText       = "选择专题:";
                    this.ddlValue.DataSource     = VShopHelper.Gettopics();
                    this.ddlValue.DataTextField  = "Title";
                    this.ddlValue.DataValueField = "TopicId";
                    this.ddlValue.DataBind();
                    this.ddlValue.SelectedValue = menu.Content;
                    break;

                case BindType.Url:
                    this.txtUrl.Text = menu.Content;
                    break;
                }
            }
        }
Beispiel #13
0
 private void BindArticleCategory()
 {
     System.Collections.Generic.List <ReplyInfo> list = ReplyHelper.GetAllReply().ToList <ReplyInfo>().FindAll((ReplyInfo a) => a.ReplyType < ReplyType.Wheel);
     this.grdArticleCategories.DataSource = list;
     this.grdArticleCategories.DataBind();
 }