private void ItemList_DataBind()
        {
            if (!DataEval.IsEmptyQuery(_category_selected))
            {
                RadTabStrip_Commands.Visible = true;

                Lib.ScriptMgr myScriptMgr = new Lib.ScriptMgr();
                ListView_ItemList.DataSource   = myScriptMgr.Get_Scripts(_category_selected, null);
                ListView_ItemList.DataKeyNames = new string[] { "ScriptID" };
                ListView_ItemList.DataBind();

                CheckBox chk_SelectAll = (CheckBox)ListView_ItemList.FindControl("chk_SelectAll");
                if (chk_SelectAll != null)
                {
                    chk_SelectAll.Checked = false;
                }
            }
        }
示例#2
0
        private void ItemList_DataBind()
        {
            if (!DataEval.IsEmptyQuery(_category_selected))
            {
                RadTabStrip_Commands.Visible = true;

                PhotoMgr myPhotoMgr = new PhotoMgr();
                ListView_ItemList.DataSource   = myPhotoMgr.Get_Photos(DataEval.QuoteText(_category_selected), "Photo_Title", "ASC");
                ListView_ItemList.DataKeyNames = new string[] { "PhotoID" };
                ListView_ItemList.DataBind();

                CheckBox chk_SelectAll = (CheckBox)ListView_ItemList.FindControl("chk_SelectAll");
                if (chk_SelectAll != null)
                {
                    chk_SelectAll.Checked = false;
                }
            }
        }
        private void Control_Init()
        {
            // Enable Photo Manger
            if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page))
            {
                hlink_Edit_Item.Visible = true;

                hlink_Edit_Item.Attributes["href"]    = "#";
                hlink_Edit_Item.Attributes["onclick"] = string.Format(
                    "return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}');",
                    "4979A4B0-3F09-4579-9520-90AC64257116"
                    );
            }
            else
            {
                hlink_Edit_Item.Visible = false;
            }

            // Init Control
            if (!DataEval.IsEmptyQuery(_photo_itemlistid))
            {
                if (Request.QueryString["PageLink"] == "Disable")
                {
                    ListView_ItemList.Enabled = false;
                    hlink_Edit_Item.Enabled   = false;
                }

                // Init List View
                Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr();


                ListView_ItemList.DataSource = myPhotoMgr.Get_Photos(_categoryid,
                                                                     _sortorder,
                                                                     _orientation,
                                                                     true.ToString(),
                                                                     _totalnumber,
                                                                     _photo_itemdetailurl,
                                                                     _displayid);

                ListView_ItemList.DataKeyNames = new string[] { "PhotoID" };

                Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates();

                switch (_itemtemplate)
                {
                case "Default":
                    myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx";
                    break;

                case "Custom":
                    myItemTemplate.ItemTemplatePath = _itemtemplateurl;
                    break;

                default:
                    myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx";
                    break;
                }

                myItemTemplate.Set_DataEmpty("");

                ListView_ItemList.ItemTemplate            = Page.LoadTemplate(myItemTemplate.ItemTemplatePath);
                ListView_ItemList.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath);

                if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty))
                {
                    ListView_ItemList.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty);
                }

                try
                {
                    ListView_ItemList.DataBind();
                }
                catch
                {
                    // Load Template Failed
                }

                DataPager_ItemList.PageSize = _numberperpage;
                DataPager_ItemList.Visible  = _enable_pager;
            }
        }