/// <summary>
    /// Loads all Used Book list for a specific ProductID.
    /// </summary>
    /// <param name="intProductID"></param>
    /// <param name="intCountryID"></param>
    /// <param name="intCategoryID"></param>
    /// <param name="intSubcategoryID"></param>
    /// <param name="intSecondSubcatID"></param>
    private void Load_BookList_UsedSeller(int intProductID, int intCountryID, int intCategoryID, int intSubcategoryID, int intSecondSubcatID)
    {
        dtUsedBookList = new DataTable();
        AjaxControlToolkit.TabPanel tp = (AjaxControlToolkit.TabPanel)TabContainer.FindControl("tpUsedItems");
        try
        {
            using (BC_Book bcBook = new BC_Book())
            {
                dtUsedBookList = bcBook.Load_BookList_UsedSeller(intProductID, intCountryID, intCategoryID, intSubcategoryID, intSecondSubcatID);
                if (dtUsedBookList.Rows.Count > 0)
                {
                    this.grvUsedBookList.DataSource = dtUsedBookList;
                    this.grvUsedBookList.DataBind();

                    tp.HeaderText  = "<span style=\"font-family:verdana; font-weight:bold;font-size:14px\">Used </span>(";
                    tp.HeaderText += dtUsedBookList.Rows.Count + " from " + dtUsedBookList.Rows[0]["Price"].ToString();
                    tp.HeaderText += " " + dtUsedBookList.Rows[0]["Currency"].ToString() + ")";
                }
                else
                {
                    this.grvUsedBookList.DataSource = null;
                    this.grvUsedBookList.DataBind();

                    tp.HeaderText = "<span style=\"font-family:verdana; font-weight:bold;font-size:14px\">Used </span>(0 item)";
                }
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = ex.Message;
        }
    }
        protected void SelectTab(TabContainer tabContainer, string tabId)
        {
            if (tabContainer == null)
            {
                throw new ArgumentNullException("tabContainer");
            }

            if (!String.IsNullOrEmpty(tabId))
            {
                AjaxControlToolkit.TabPanel tab = tabContainer.FindControl(tabId) as AjaxControlToolkit.TabPanel;
                if (tab != null)
                {
                    tabContainer.ActiveTab = tab;
                }
            }
        }
Example #3
0
        // The Designer will call us back on this for each EditableDesignerRegion that we created.
        // In this we return the markup that we want displayed in the editable region.
        public override string GetEditableDesignerRegionContent(EditableDesignerRegion region)
        {
            if (region == null)
            {
                throw new ArgumentNullException("region");
            }

            Debug.Assert(region.Name[0] == 'c' || region.Name[0] == 'h', "Expected regionName to start with c or h, not " + region.Name);

            // is it a content template or a header?
            //
            var content    = region.Name[0] == 'c';
            var regionName = region.Name.Substring(1);

            var activeTab = (TabPanel)TabContainer.FindControl(regionName);

            Debug.Assert(activeTab != null, "Couldn't find tab " + regionName);

            return(GetTabContent(activeTab, content));
        }
Example #4
0
        // After a editable region is edited, the designer calls back with the updated markup so we can
        // stuff it into the right tab.
        public override void SetEditableDesignerRegionContent(EditableDesignerRegion region, string content)
        {
            if (region == null)
            {
                throw new ArgumentNullException("region");
            }

            Debug.Assert(region.Name[0] == 'c' || region.Name[0] == 'h', "Expected regionName to start with c or h, not " + region.Name);

            var setTabContent = region.Name[0] == 'c';
            var regionName    = region.Name.Substring(1);

            // figure out which tab we have.
            var activeTab = (TabPanel)TabContainer.FindControl(regionName);

            Debug.Assert(activeTab != null, "Couldn't find tab " + regionName);

            var host = (IDesignerHost)GetService(typeof(IDesignerHost));

            Debug.Assert(host != null, "Failed to get IDesignerHost?!?");

            // push the content into the right template
            PersistTemplateContent(activeTab, host, content, (setTabContent ? "ContentTemplate" : "HeaderTemplate"));
        }