Example #1
0
 protected void btnHelp_Click(object sender, EventArgs e)
 {
     _adminNav = new AdminNavigation
     {
         PageID = "HelpAdmin"
     };
     Response.Redirect(_adminNav.GetNavigationUrl(), true);
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            try
            {
                // Get the Review ID
                ReviewInfo review = new ReviewInfo();

                if (!Page.IsPostBack)
                {
                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    if (_nav.ReviewID != Null.NullInteger)
                    {
                        ReviewController controller = new ReviewController();
                        review = controller.GetReview(PortalId, _nav.ReviewID);
                        if (review != null)
                        {
                            cmdDelete.Visible       = true;
                            divApproval.Visible     = true;
                            cmbRating.SelectedValue = review.Rating.ToString();
                            txtComments.Text        = review.Comments;
                            chkAuthorized.Checked   = review.Authorized;
                            txtUserName.Text        = review.UserName;
                        }
                        else
                        {
                            if (UserId != -1)
                            {
                                txtUserName.Text = UserInfo.DisplayName;
                            }
                            else
                            {
                                txtUserName.Text = Localization.GetString("Anonymous.Text", LocalResourceFile);
                            }
                        }
                    }
                }

                // Which controls do we display?
                if (CanManageReviews())
                {
                    txtUserName.Enabled   = false;
                    cmbRating.Enabled     = false;
                    divAuthorized.Visible = true;
                    divApproval.Visible   = false;
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Example #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            if (_nav.CategoryID != Null.NullInteger)
            {
                plhGrid.Visible = false;
                plhForm.Visible = true;

                if (_nav.CategoryID == 0)
                {
                    lblEditTitle.Text = Localization.GetString("AddCategory", this.LocalResourceFile);
                    loadEditControl("CategoryEdit.ascx", _nav.CategoryID);
                }
                else
                {
                    lblEditTitle.Text = Localization.GetString("EditCategory", this.LocalResourceFile);
                    loadEditControl("CategoryEdit.ascx", _nav.CategoryID);
                }
            }
            else
            {
                plhGrid.Visible = true;
                plhForm.Visible = false;

                CategoryController categoryController = new CategoryController();
                ArrayList categoryList = categoryController.GetCategoriesPath(PortalId, false, -1);

                if (categoryList.Count > 0)
                {
                    // Has page index been initialized?
                    if (_nav.PageIndex == Null.NullInteger)
                    {
                        _nav.PageIndex = 0;
                    }

                    // Update the grid
                    grdCategories.PageSize = 20;
                    grdCategories.AllowPaging = true;
                    grdCategories.DataSource = categoryList;
                    grdCategories.CurrentPageIndex = _nav.PageIndex;
                    grdCategories.DataBind();
                }
            }
        }
Example #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            try
            {
                // Get the Review ID
                ReviewInfo review = new ReviewInfo();

                if (!Page.IsPostBack)
                {
                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    if (!Null.IsNull(_nav.ReviewID))
                    {
                        ReviewController controller = new ReviewController();
                        review = controller.GetReview(_nav.ReviewID);
                        if (review != null)
                        {
                            cmdDelete.Visible = true;
                            txtUserName.Text			= review.UserName;
                            cmbRating.SelectedValue		= review.Rating.ToString();
                            txtComments.Text			= review.Comments;
                            chkAuthorized.Checked		= review.Authorized;
                        }
                    }

                    plhRating.Controls.Clear();
                    plhRating.Controls.Add(GetRatingImages(int.Parse(cmbRating.SelectedValue)));
                }

                // Which controls do we display?
                if (string.Compare(_nav.PageID, "ReviewAdmin", true) == 0)
                {
                    txtUserName.Enabled = false;
                    cmbRating.Enabled = false;
                    labelAuthorized.Visible = true;
                    chkAuthorized.Visible = true;
                }
            }
            catch(Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (StoreSettings.CurrencySymbol != string.Empty)
            {
                _localFormat.CurrencySymbol = StoreSettings.CurrencySymbol;
            }

            _nav = new AdminNavigation(Request.QueryString);

            // Do we show list or edit view?
            if (_nav.ProductID != Null.NullInteger || _nav.CopyProductID != Null.NullInteger)
            {
                ShowEditControl();
            }
            else
            {
                ShowProductList();
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            // Do we show list or edit view?
            if (_nav.ReviewID != Null.NullInteger)
            {
                ShowEditControl();
            }
            else
            {
                if (!IsPostBack)
                {
                    FillStatusCombo();
                    FillCategoryCombo();
                    FillProductCombo();
                    FillReviewGrid();
                }
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);
            if (_nav.CouponID != Null.NullInteger)
            {
                plhGrid.Visible = false;
                plhForm.Visible = true;

                if (_nav.CategoryID == 0)
                {
                    lblEditTitle.Text = Localization.GetString("AddCoupon", LocalResourceFile);
                    LoadEditControl(Null.NullInteger);
                }
                else
                {
                    lblEditTitle.Text = Localization.GetString("EditCoupon", LocalResourceFile);
                    LoadEditControl(_nav.CouponID);
                }
            }
            else
            {
                plhGrid.Visible = true;
                plhForm.Visible = false;

                StringDictionary replaceParams = new StringDictionary
                {
                    ["CouponID"] = "{0}"
                };
                _navigateUrl = _nav.GetNavigationUrl(replaceParams);

                if (IsPostBack == false)
                {
                    Localization.LocalizeGridView(ref gvCoupons, LocalResourceFile);
                    SortAndBind();
                }
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            if (!IsPostBack)
            {
                OrderController orderController = new OrderController();
                lstCustomers.DataTextField  = "FullName";
                lstCustomers.DataValueField = "UserID";
                lstCustomers.DataSource     = orderController.GetCustomers(PortalId);
                lstCustomers.DataBind();
                lstCustomers.Items.Insert(0, new ListItem(Localization.GetString("Select", LocalResourceFile), ""));

                lstOrderStatus.DataTextField  = "OrderStatusText";
                lstOrderStatus.DataValueField = "OrderStatusID";
                lstOrderStatus.DataSource     = orderController.GetOrderStatuses();
                lstOrderStatus.DataBind();
                lstOrderStatus.Items.Insert(0, new ListItem(Localization.GetString("Select", LocalResourceFile), ""));
            }

            if (_nav.CustomerID != Null.NullInteger || _nav.StatusID != Null.NullInteger || _nav.OrderID != Null.NullInteger)
            {
                CustomerOrders ordersControl = (CustomerOrders)LoadControl(ControlPath + "CustomerOrders.ascx");
                ordersControl.ModuleConfiguration = ModuleConfiguration;
                ordersControl.StoreSettings       = StoreSettings;
                ordersControl.ID = "CustomerOrders";

                if (_nav.CustomerID != Null.NullInteger)
                {
                    try
                    {
                        lstCustomers.SelectedValue       = _nav.CustomerID.ToString();
                        ordersControl.ShowOrdersInStatus = false;
                        ordersControl.OrderStatusID      = Null.NullInteger;
                    }
                    catch
                    {
                        // This occurs when an order has been selected by is number
                        // and the user account was deleted.
                        // Because we can't show the user's orders when the back button is cliqued,
                        // we return to the orders admin start page.
                        _nav = new AdminNavigation
                        {
                            PageID = "CustomerAdmin"
                        };
                        Response.Redirect(_nav.GetNavigationUrl(), true);
                    }
                }

                if (_nav.StatusID != Null.NullInteger)
                {
                    lstOrderStatus.SelectedValue     = _nav.StatusID.ToString();
                    ordersControl.ShowOrdersInStatus = true;
                    ordersControl.OrderStatusID      = _nav.StatusID;
                }

                if (_nav.OrderID != Null.NullInteger)
                {
                    tbOrderNumber.Text = _nav.OrderID.ToString();
                }

                plhOrders.Controls.Clear();
                plhOrders.Controls.Add(ordersControl);
                plhOrders.Visible = true;
            }
            else
            {
                tbOrderNumber.Text = "";
                lstCustomers.ClearSelection();
                lstOrderStatus.ClearSelection();
                plhOrders.Controls.Clear();
                plhOrders.Visible = false;
            }
        }
Example #9
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            StoreController storeController = new StoreController();
            storeInfo = storeController.GetStoreInfo(PortalId);

            if (storeInfo == null)
            {
                CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
            }
            else
            {
                if (storeInfo.PortalTemplates)
                {
                    CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                }
                else
                {
                    CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                }
            }

            adminNav = new AdminNavigation(Request.QueryString);

            lblParentTitle.Text = parentTitle;

            // canadean changed
            if(!PortalSecurity.IsInRole("Administrators"))
            {
                btnStoreInfo.Visible = false;
                lblSpacer1.Visible = false;
                //Response.Write("Not Administrator");
            }
            //else
            //    Response.Write("Administrator");

            if (adminNav.PageID == Null.NullString)
            {
                // Load the default control
                adminNav = new AdminNavigation();
                adminNav.PageID = "StoreAdmin";

                // canadean changed
                adminNav.PageID = "StoreAdmin";
                if (!PortalSecurity.IsInRole("Administrators"))
                    adminNav.PageID = "CustomerAdmin";

                loadAdminControl();
            }
            else
            {
                loadAdminControl();
            }
        }
Example #10
0
 private void btnStoreInfo_Click(object sender, EventArgs e)
 {
     adminNav = new AdminNavigation();
     adminNav.PageID = "StoreAdmin";
     Response.Redirect(adminNav.GetNavigationUrl(), false);
 }
Example #11
0
 private void btnCustomers_Click(object sender, EventArgs e)
 {
     adminNav = new AdminNavigation();
     adminNav.PageID = "CustomerAdmin";
     Response.Redirect(adminNav.GetNavigationUrl(), false);
 }
Example #12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (storeInfo == null)
            {
                StoreController storeController = new StoreController();
                storeInfo = storeController.GetStoreInfo(PortalId);
            }

            if (storeInfo.CurrencySymbol != string.Empty)
            {
                LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
            }

            _nav = new AdminNavigation(Request.QueryString);
            // Do we show list or edit view?
            if (_nav.ProductID != Null.NullInteger)
            {
                ShowEditControl();
            }
            /*
            // canadean changed: Now we do it only on the PreRender, to allow filtering by the text entered
            else
            {
                ShowProductList();
            }*/

            //Response.Write("<br>Page_load: " + this.tbProductFilter.Text + " - " + _nav.ProductID);
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (StoreSettings == null)
            {
                string templatePath = CssTools.GetTemplatePath(this, false);
                CssTools.AddCss(Page, templatePath, "Template.css");
            }
            else
            {
                string templatePath = CssTools.GetTemplatePath(this, StoreSettings.PortalTemplates);
                CssTools.AddCss(Page, templatePath, StoreSettings.StyleSheet);
            }

            CheckUserRoles();

            _adminNav = new AdminNavigation(Request.QueryString);
            if (_adminNav.PageID == Null.NullString)
            {
                // Define the default control
                _adminNav = new AdminNavigation();
                if (_canManageStore)
                {
                    _adminNav.PageID = "StoreAdmin";
                }
                else if (_canManageOrders)
                {
                    _adminNav.PageID = "CustomerAdmin";
                }
                else if (_canManageCatalog)
                {
                    _adminNav.PageID = "CategoryAdmin";
                }
            }
            else
            {
                switch (_adminNav.PageID.ToLower())
                {
                case "storeadmin":
                    if (!_canManageStore)
                    {
                        _adminNav.PageID = "";
                    }
                    break;

                case "customeradmin":
                    if (!_canManageOrders)
                    {
                        _adminNav.PageID = "";
                    }
                    break;

                case "categoryadmin":
                case "productadmin":
                case "reviewadmin":
                case "couponadmin":
                    if (!_canManageCatalog)
                    {
                        _adminNav.PageID = "";
                    }
                    break;

                default:
                    _adminNav.PageID = "";
                    break;
                }
            }

            LoadAdminControl();
        }
Example #14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            if (!IsPostBack)
            {
                OrderController orderController = new OrderController();
                lstCustomers.DataTextField = "Username";
                lstCustomers.DataValueField = "UserID";
                lstCustomers.DataSource = orderController.GetCustomers(PortalId);
                lstCustomers.DataBind();

                lstCustomers.Items.Insert(0, new ListItem("--- " + Localization.GetString("Select", this.LocalResourceFile) + " ---", ""));

                lstOrderStatus.DataTextField = "OrderStatusText";
                lstOrderStatus.DataValueField = "OrderStatusID";
                lstOrderStatus.DataSource = orderController.GetOrderStatuses();
                lstOrderStatus.DataBind();

                lstOrderStatus.Items.Insert(0, new ListItem("--- " + Localization.GetString("Select", this.LocalResourceFile) + " ---", ""));
            }

            if (_nav.CustomerID != Null.NullInteger)
            {
                lstCustomers.SelectedValue = _nav.CustomerID.ToString();

                StoreControlBase ordersControl = (StoreControlBase)LoadControl(ModulePath + "CustomerOrders.ascx");
                ordersControl.ParentControl = this.ParentControl;
                ((CustomerOrders)ordersControl).ShowOrdersInStatus = false;
                ((CustomerOrders)ordersControl).OrderStatusID = Null.NullInteger;

                plhOrders.Controls.Clear();
                plhOrders.Controls.Add(ordersControl);
                plhOrders.Visible = true;
            }

            if (_nav.OrderID != Null.NullInteger)
            {
                tbOrderNumber.Text = _nav.OrderID.ToString();
            }
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            // Do we show list or edit view?
            if (_nav.ReviewID != Null.NullInteger)
            {
                ShowEditControl();
            }
            else
            {
                if (!IsPostBack)
                {
                    FillStatusCombo();
                    FillCategoryCombo();
                    FillProductCombo();
                    FillReviewGrid();
                }
            }
        }