Exemple #1
0
        protected override IEnumerable <ScriptReference> GetScriptReferences()
        {
            ScriptReference reference = new ScriptReference();

            reference.Path = CommerceHelper.GetAbsolutePath("~/Apps/Core/Layout/Scripts/WsLayoutExtender.js");

            return(new ScriptReference[] { reference });
        }
Exemple #2
0
        /// <summary>
        /// During page load, the required JS files are loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Page.IsPostBack)
            {
            }
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "NWTD_jquery_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery-1.3.2.min.js"));
            string scriptText = "NWTD.CartList.controlIDs.push('" + this.udpCartViewer.UniqueID + "')";

            Page.ClientScript.RegisterClientScriptInclude("NWTD_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/NWTD.js"));
            Page.ClientScript.RegisterClientScriptInclude("CartList_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/CartList.js"));
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "CartPage", scriptText, true);
        }
        private DataTable GenerateTemplatesDataSource()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("Id", typeof(string)));
            dt.Columns.Add(new DataColumn("Title", typeof(string)));
            dt.Columns.Add(new DataColumn("Description", typeof(string)));
            dt.Columns.Add(new DataColumn("ImageUrl", typeof(string)));

            foreach (WorkspaceTemplateInfo wti in WorkspaceTemplateFactory.GetTemplateInfos())
            {
                DataRow row = dt.NewRow();
                row["Id"]          = wti.Uid;
                row["Title"]       = UtilHelper.GetResFileString(wti.Title);
                row["Description"] = UtilHelper.GetResFileString(wti.Description);
                row["ImageUrl"]    = CommerceHelper.GetAbsolutePath(wti.ImageUrl);

                dt.Rows.Add(row);
            }

            return(dt);
        }
        /// <summary>
        /// During page load, get all the required JS loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "DistrictSelector_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/DistrictSelector.js"));

            if (this.Page.IsPostBack)
            {
                return;
            }
            this.ddlState.DataSource = this.States;
            this.ddlState.DataBind();
        }
Exemple #5
0
        /// <summary>
        /// During page load, the required JS files are loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "ManageCarts_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/ManageCarts.js"));

            OakTree.Web.UI.ControlHelper.RegisterControlInClientScript(Page.ClientScript, this, "ManageCarts", "{updatePanelID:'" + this.udpUserCarts.ClientID + "', cartGridID:'" + this.gvUserCarts.ClientID + "'}");
        }
Exemple #6
0
        /// <summary>
        /// During page load, various scripts are loaded, and the last column of the search results grid for Nevada is shown if the current user is from Nevada
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            OakTree.Web.UI.ControlHelper.RegisterControlInClientScript(this.Page.ClientScript, this, "SearchResults", string.Empty);

            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryValidate_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.validate.js"));

            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "SearchResults_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/SearchResults.js"));

            if (this.Page.Request.QueryString.Count == 0)
            {
                this.pnlSearchResults.Visible = false;
            }

            //do a few special things if the user is from nevada
            this.gvSearchResults.Columns[this.gvSearchResults.Columns.Count - 1].Visible = this.IsNevadaUser;
            if (this.IsNevadaUser)
            {
                this.pnlResultsWrapper.CssClass = "results-wrapper-nv";
            }

            if (Request.IsAuthenticated)
            {
                global::NWTD.Profile.EnsureCustomerCart();
            }

            //set up the stuff in the cart selector modal
            if (global::NWTD.Orders.Cart.Reminder)
            {
                this.pnlSelectCart.Visible = true;
                List <Mediachase.Commerce.Orders.Cart> carts = global::NWTD.Orders.Cart.CurrentCustomerCarts;

                this.ddlCarts.DataSource = carts;
                this.ddlCarts.DataBind();

                foreach (ListItem item in this.ddlCarts.Items)
                {
                    if (item.Value.Equals(global::NWTD.Profile.ActiveCart))
                    {
                        item.Selected = true;
                        break;
                    }
                }
            }
        }
Exemple #7
0
        /// <summary>
        /// Binds the toolbar.
        /// </summary>
        public void BindToolbar()
        {
            LanguageBar.Rows.Clear();
            TableRow newRow1 = new TableRow();
            TableRow newRow2 = new TableRow();


            using (IDataReader reader = mc.Language.GetAllLanguages())
            {
                while (reader.Read())
                {
                    TableCell newCell1 = new TableCell();
                    TableCell newCell2 = new TableCell();
                    newCell1.Text    = reader["LangId"].ToString();
                    newCell1.Visible = false;
                    newRow1.Cells.Add(newCell1);
                    ImageButton imgBtn  = new ImageButton();
                    CultureInfo culture = CultureInfo.CreateSpecificCulture(reader["LangName"].ToString());
                    if (DisableUnavaliable)
                    {
                        if (AvaliableLanguage != null)
                        {
                            if (AvaliableLanguage.Contains(reader["LangId"]))
                            {
                                imgBtn.ImageUrl = CommonHelper.GetFlagIcon(culture);//CommerceHelper.GetAbsolutePath("~/images/flags/" + reader["LangName"].ToString().Substring(0, 2) + ".gif");
                            }
                            else
                            {
                                imgBtn.ImageUrl = CommerceHelper.GetAbsolutePath("~/images/flags/" + reader["LangName"].ToString().Substring(0, 2) + "_gray.gif");
                            }
                        }
                        else
                        {
                            imgBtn.ImageUrl = CommerceHelper.GetAbsolutePath("~/images/flags/" + reader["LangName"].ToString().Substring(0, 2) + "_gray.gif");
                        }

                        //imgBtn.ImageUrl = CommonHelper.GetFlagIcon(culture);
                    }
                    else
                    {
                        //imgBtn.ImageUrl = CommonHelper.GetFlagIcon(culture);
                        imgBtn.ImageUrl = CommonHelper.GetFlagIcon(CultureInfo.CreateSpecificCulture(reader["LangName"].ToString())); // CommerceHelper.GetAbsolutePath("~/images/flags/" + reader["LangName"].ToString().Substring(0, 2) + ".gif");
                    }

                    imgBtn.AlternateText = culture.DisplayName;

                    imgBtn.Height = 12;
                    imgBtn.Width  = 18;

                    if ((int)reader["LangId"] == CurrentLanguageId)
                    {
                        imgBtn.BorderWidth = 2;
                        imgBtn.BorderColor = System.Drawing.Color.Gold;
                    }
                    else
                    {
                        imgBtn.BorderWidth = 1;
                        imgBtn.BorderColor = System.Drawing.Color.Black;
                    }

                    imgBtn.CommandArgument  = reader["LangId"].ToString();
                    imgBtn.Click           += new ImageClickEventHandler(imgBtn_Click);
                    imgBtn.CausesValidation = false;
                    newCell2.Controls.Add(imgBtn);
                    newRow2.Cells.Add(newCell2);
                }

                reader.Close();
            }
            LanguageBar.Rows.Add(newRow1);
            LanguageBar.Rows.Add(newRow2);
            //HighlightCurrentLanguage();
        }
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CompareProducts_js", CommerceHelper.GetAbsolutePath("/Scripts/CompareProducts.js"));
        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "CompareViewPageUrl", String.Format("CSCompareProducts.CompareViewPageUrl = \"{0}\";", CMSContext.Current.ResolveUrl("~/compare.aspx")), true);

        //if (!IsPostBack)
        {
            if (!String.IsNullOrEmpty(CurrentMetaClassName) && ProductsToCompare != null)
            {
                hfCurrentComparisonGroup.Value = CurrentMetaClassName;
                BindData();
                pnlCompareProducts.Visible = true;
                ClearCompareButton.Text    = RM.GetString("COMPAREPRODUCTSMODULE_CLEAR");
            }
            else
            {
                pnlCompareProducts.Visible = false;
            }
        }
    }
        /// <summary>
        /// When the page loads, we have to bind all the existing information about the cart to the edit fields in the wizard
        /// We also need to do some branching for Level A and B users, showing and hiding the appropriate controls.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.OrderMessage.Text = string.Empty;

            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CheckoutSummary_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/CheckoutSummary.js"));

            if (this.CheckoutCart == null)
            {
                this.OrderMessage.Text         = "You are trying to view the summary for a cart that does not exist;";
                this.pnlOrderSubmitted.Visible = false;
                this.pnlOrderSummary.Visible   = false;
                return;
            }


            CMSContext.Current.OverrideAccess = true;

            if (this.CheckoutCart.Status == NWTD.Orders.Cart.CART_STATUS.SUBMITTED.ToString())
            {
                this.ShowOrderComplete();


                //Response.Redirect(NavigationManager.GetUrl("ManageCarts"));
            }

            global::NWTD.Profile.SetSaleInformation();

            btnSubmitCart.Visible = this.UserIsLevelA;


            //populate the shiping and billing address fields
            if (this.UserIsLevelA)
            {
                //Level A Address Binding

                this.pnlShippingAndTax.Visible = true;
                //this.lblTitle.Text = "Order Summary";

                //The following adds the WebConfirmationNumber to the form header/title of the OrderSummary PDF (Heath Gardner 08/19/13)
                string webConf = this.CheckoutCart.GetString("WebConfirmation").ToString();
                if (!String.IsNullOrEmpty(webConf))
                {
                    //Create the form header/title text
                    string fullTitle = string.Format("Submitted Order -- Confirmation # {0}", webConf);
                    //Set the form header/title equal to the formatted text
                    this.lblTitle.Text = fullTitle;
                }
                else //deal with any NULL confirmation number
                {
                    this.lblTitle.Text = "Submitted Order -- Confirmation";
                }
                ////
                this.pnlLevelANotifications.Visible     = true;
                this.pnlLevelBNotifications.Visible     = false;
                this.btnPrintFooter.Visible             = false;
                this.btnPrintHeader.Visible             = true;
                this.lblRequisitionNotSubmitted.Visible = false;
            }

            //set the grid to have the line items as its data source
            this.gvCart.DataSource = this.CheckoutCartHelper.LineItems;
            this.gvCart.DataBind();
        }
Exemple #10
0
 /// <summary>
 /// During page load, add all the necessary JavaScript files
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "NewCart_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/NewCart.js"));
 }
Exemple #11
0
        /// <summary>
        /// When the page loads, we'll get the hyperlinks set up, and make sure the js for this control is present
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            global::NWTD.Profile.SetSaleInformation();

            if (!NWTD.Orders.Cart.CartCanBeEdited(this.SelectedCartHelper.Cart))
            {
                this.hlISBNQuickEntryBottom.Visible = false;
                this.hlISBNQuickEntryTop.Visible    = false;
                this.btnDeleteSelected.Visible      = false;
                this.btnDeleteSelectedTop.Visible   = false;
                this.btnSaveChanges.Visible         = false;
                this.btnSubmitTop.Visible           = false;
                this.btnSubmit.Visible = false;
            }

            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "Cart_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/Cart.js"));
            OakTree.Web.UI.ControlHelper.RegisterControlInClientScript(Page.ClientScript, this, "Carts", "{updatePanelID:'" + this.udpViewCart.ClientID + "'}");

            string quickISBNUrl = NavigationManager.GetUrl("QuickISBN", new object[] { "cart", this.SelectedCartName });

            this.hlISBNQuickEntryBottom.NavigateUrl = quickISBNUrl;
            this.hlISBNQuickEntryTop.NavigateUrl    = quickISBNUrl;
        }
Exemple #12
0
        //TODO: these should be resources living in THIS project
        /// <summary>
        /// Adds all the required client script to a page at runtime
        /// </summary>
        /// <param name="Page"></param>
        public static void AddRequiredScripts(System.Web.UI.Page Page)
        {
            string script = "var NWTD = NWTD||{};";

            script += string.Format("NWTD.BaseURL='{0}';", System.Web.HttpUtility.UrlEncode(Page.ResolveUrl("~/")));
            script += string.Format("NWTD.CurrentUserID='{0}';", Mediachase.Commerce.Profile.ProfileContext.Current.UserId.ToString());

            Page.ClientScript.RegisterClientScriptResource(typeof(OakTree.Web.UI.ControlResources), OakTree.Web.UI.ControlResources.JQUERY_JS);
            Page.ClientScript.RegisterClientScriptResource(typeof(OakTree.Web.UI.ControlResources), OakTree.Web.UI.ControlResources.OAKTREE_UTILITIES_JS);
            Page.ClientScript.RegisterClientScriptResource(typeof(OakTree.Web.UI.ControlResources), OakTree.Web.UI.ControlResources.OAKTREE_WEB_UI_COOKIE);
            Page.ClientScript.RegisterClientScriptResource(typeof(OakTree.Web.UI.ControlResources), OakTree.Web.UI.ControlResources.OAKTREE_WEB_UI_WEBCONTROLS_JS);

            Page.ClientScript.RegisterClientScriptInclude(typeof(OakTree.Web.UI.ControlResources), "NWTD_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/NWTD.js"));
            Page.ClientScript.RegisterClientScriptBlock(typeof(OakTree.Web.UI.ControlResources), "NWTD_global_js", script, true);
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "Search_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/Search.js"));

            FacetGroup[] facets = SearchFilterHelper.Current.GetFacets(false, new TimeSpan());


            foreach (FacetGroup facetgroup in facets)
            {
                switch (facetgroup.FieldName)
                {
                case "Grade":
                    ddlGrades.DataSource = facetgroup.Facets;
                    ddlGrades.DataBind();
                    ddlGrades.Items.Insert(0, new ListItem(facetgroup.Name, string.Empty));
                    break;

                case "Publisher":
                    ddlPublisher.DataSource = facetgroup.Facets;
                    ddlPublisher.DataBind();
                    ddlPublisher.Items.Insert(0, new ListItem(facetgroup.Name, string.Empty));
                    break;

                case "Year":
                    ddlYear.DataSource = facetgroup.Facets;
                    ddlYear.DataBind();
                    ddlYear.Items.Insert(0, new ListItem(facetgroup.Name, string.Empty));
                    break;

                case "Subject":
                    ddlSubject.DataSource = facetgroup.Facets;
                    ddlSubject.DataBind();
                    ddlSubject.Items.Insert(0, new ListItem(facetgroup.Name, string.Empty));
                    break;

                case "Type":
                    ddlType.DataSource = facetgroup.Facets;
                    ddlType.DataBind();
                    ddlType.Items.Insert(0, new ListItem(facetgroup.Name, string.Empty));
                    break;
                }
            }
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "AddToCartButton_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/AddToCartButton.js"));

            global::NWTD.Profile.EnsureCustomerCart();


            if (global::NWTD.Orders.Cart.Reminder)
            {
                this.pnlSelectCart.Visible = true;
                List <Mediachase.Commerce.Orders.Cart> carts = global::NWTD.Orders.Cart.CurrentCustomerCarts;

                this.ddlCarts.DataSource = carts;
                this.ddlCarts.DataBind();

                foreach (ListItem item in this.ddlCarts.Items)
                {
                    if (item.Value.Equals(global::NWTD.Profile.ActiveCart))
                    {
                        item.Selected = true;
                        break;
                    }
                }
            }
        }
Exemple #15
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "checkout_js", CommerceHelper.GetAbsolutePath("Scripts/checkout.js"));
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "jquery_js", CommerceHelper.GetAbsolutePath("Scripts/jquery.js"));
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "thickbox_js", CommerceHelper.GetAbsolutePath("Scripts/thickbox.js"));
     Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "thickbox_js_imgLoader", String.Format("var tb_pathToImage = '{0}';", CommerceHelper.GetAbsolutePath("App_Themes/Everything/images/loading_rss.gif")), true);
 }
        /// <summary>
        /// During page load, we use lucene search API to get a list of publishers. This information comes from the cache for performance.
        /// That information is bound to the search dropdown.
        /// Also, rebinds the freetext search to the search box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (NWTD.Profile.CurrentUserLevel.Equals(NWTD.UserLevel.ANONYMOUS))
            {
                this.pnlSearchByPublisher.Visible = false; return;
            }

            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "Search_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/Search.js"));
            this.btnSubmitSearch.Text = this.ButtonText;

            //it would be weird to show the facet if it's already there
            //if (!CMSContext.Current.CurrentUrl.Contains("/catalog/searchresults.aspx")) {
            this.ddlPublisher.Visible = true;

            //The key used for retrieving cache data
            string cacheKey = Mediachase.Commerce.Catalog.CatalogCache.CreateCacheKey("search-publisher-names");

            FacetGroup publisherfacet;

            // check cache first
            object cachedObject = Mediachase.Commerce.Catalog.CatalogCache.Get(cacheKey);

            if (cachedObject != null)
            {
                publisherfacet = (FacetGroup)cachedObject;
            }
            else
            {
                //So far, this seems like the best way to ennumerate the existing Publishers
                //Although, it does seem kind of convoluted.
                //Anyway, get the list using search and then cache it
                Mediachase.Search.Extensions.CatalogEntrySearchCriteria criteria = new Mediachase.Search.Extensions.CatalogEntrySearchCriteria();

                if (!string.IsNullOrEmpty(global::NWTD.Catalog.UserStateAvailablityField))
                {
                    //Incorporate the state availablity flag
                    criteria.Add(
                        global::NWTD.Catalog.UserStateAvailablityField,
                        new SimpleValue()
                    {
                        key          = string.Empty,
                        value        = "y",
                        locale       = "en-us",
                        Descriptions = new Descriptions()
                        {
                            defaultLocale = "en-us"
                        }
                    });
                }

                //Create a search criteria object
                criteria.Add(SearchFilterHelper.Current.SearchConfig.SearchFilters.SingleOrDefault(filter => filter.field == "Publisher"));
                var manager = new SearchManager(Mediachase.Commerce.Core.AppContext.Current.ApplicationName);

                //conduct the search
                Mediachase.Search.SearchResults results = manager.Search(criteria);

                //get the results
                FacetGroup[] facets = results.FacetGroups;

                //get the publisher field
                publisherfacet = facets.SingleOrDefault(facet => facet.FieldName == "Publisher");


                //cache the results for five minutes for faster future loads
                TimeSpan cacheTimeout = new TimeSpan(0, 5, 00);
                Mediachase.Commerce.Catalog.CatalogCache.Insert(cacheKey, publisherfacet, cacheTimeout);
            }


            //Bind the publisehrs to the dropdown
            this.ddlPublisher.DataSource = publisherfacet.Facets;
            this.ddlPublisher.DataBind();

            //Add an empty item for searching all publishers
            this.ddlPublisher.Items.Insert(0, new ListItem("All Publishers"));

            //select the currently selected publisehr
            foreach (ListItem item in ddlPublisher.Items)
            {
                if (item.Value == this.SelectedPublisher)
                {
                    item.Selected = true;
                }
            }

            //Re-do the keyword in the textbox as well
            this.tbKeyWord.Text = string.IsNullOrEmpty(this.KeyWords) ?this.DefaultSearchText : this.KeyWords;
            //this.ddlPublisher.SelectedValue = this.Publisher;
        }
Exemple #17
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, System.EventArgs e)
 {
     global::NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "SideMenuControl_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/SideMenuControl.js"));
 }
Exemple #18
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, System.EventArgs e)
 {
     DataBind();
     Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CompareProducts_js", CommerceHelper.GetAbsolutePath("/Scripts/CompareProducts.js"));
     Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "CompareViewPageUrl", String.Format("CSCompareProducts.CompareViewPageUrl = \"{0}\";", CMSContext.Current.ResolveUrl("~/compare.aspx")), true);
 }
Exemple #19
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CompareProducts_js", CommerceHelper.GetAbsolutePath("/Scripts/CompareProducts.js"));
        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "CompareViewPageUrl", String.Format("CSCompareProducts.CompareViewPageUrl = \"{0}\";", CMSContext.Current.ResolveUrl("~/compare.aspx")), true);

        if (Product != null)
        {
            string cbReference    = Page.ClientScript.GetCallbackEventReference(this, "arg", "CSCompareProducts.ReceiveServerData", "context");
            String callbackScript = "function CallServer" + Product.CatalogEntryId + "(arg, context) { " + cbReference + ";}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), this.UniqueID, callbackScript, true);
        }
    }
Exemple #20
0
        /// <summary>
        /// When the page loads, we have to bind all the existing information about the cart to the edit fields in the wizard
        /// We also need to do some branching for Level A and B users, showing and hiding the appropriate controls.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.OrderMessage.Text = string.Empty;

            NWTD.Web.UI.ClientScript.AddRequiredScripts(this.Page);
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "JqueryModal_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/jquery.modal.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CheckoutSummary_js", CommerceHelper.GetAbsolutePath("Structure/User/NWTDControls/Scripts/CheckoutSummary.js"));

            if (this.CheckoutCart == null)
            {
                this.OrderMessage.Text         = "You are trying to view the summary for a cart that does not exist;";
                this.pnlOrderSubmitted.Visible = false;
                this.pnlOrderSummary.Visible   = false;
                return;
            }

            if (this.CheckoutCart.Status == NWTD.Orders.Cart.CART_STATUS.SUBMITTED.ToString())
            {
                this.ShowOrderComplete();


                //Response.Redirect(NavigationManager.GetUrl("ManageCarts"));
            }

            global::NWTD.Profile.SetSaleInformation();

            btnSubmitCart.Visible = this.UserIsLevelA;

            //Hide/Show fields based on user level
            if (this.UserIsLevelA)
            {
                //Level A field settings
                this.pnlShippingAndTax.Visible          = true;
                this.lblTitle.Text                      = "Order Summary";
                this.pnlLevelANotifications.Visible     = true;
                this.pnlLevelBNotifications.Visible     = false;
                this.btnPrintFooter.Visible             = false;
                this.btnPrintHeader.Visible             = true;
                this.lblRequisitionNotSubmitted.Visible = false;
            }
            else
            {
                //Level B field settings

                //Populate WishList Name & ID# for Requisitions (Heath Gardner 08/19/13)
                //Get the necessary values
                string wishListName   = this.CheckoutCart.Name.ToString();
                string wishListNumber = this.CheckoutCart.OrderGroupId.ToString();
                //Build the text to return
                // On 08/02/17, Heath moved the WishList Name & ID to the form title per Scott S. & Customer Service request.
                //  I also reorganized the Wish List string below to display the WL Name and then Number. This change was
                //  made to keep the look here similiar to how it is displayed on the Cart/WishList view printouts (hdg)
                //this.wishListID.Text = string.Format("Wish List #{0} ({1})",wishListNumber, wishListName);
                this.lblTitle.Text = string.Format("Requisition Summary<br>{0} (#{1})", wishListName, wishListNumber);
            }

            //set the grid to have the line items as its data source
            this.gvCart.DataSource = this.CheckoutCartHelper.LineItems;
            this.gvCart.DataBind();
        }