Exemplo n.º 1
0
 protected void btnHelp_Click(object sender, EventArgs e)
 {
     _adminNav = new AdminNavigation
     {
         PageID = "HelpAdmin"
     };
     Response.Redirect(_adminNav.GetNavigationUrl(), true);
 }
Exemplo n.º 2
0
        private void grdReviews_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            ReviewInfo reviewInfo = e.Item.DataItem as ReviewInfo;

            if (reviewInfo != null)
            {
                // Update edit link using this item's ID
                HyperLink linkEdit = (e.Item.FindControl("linkEdit") as HyperLink);
                if (linkEdit != null)
                {
                    StringDictionary replaceParams = new StringDictionary
                    {
                        ["ReviewID"] = reviewInfo.ReviewID.ToString()
                    };
                    linkEdit.NavigateUrl = _nav.GetNavigationUrl(replaceParams);
                }

                // Add rating images
                PlaceHolder phRating = (e.Item.FindControl("phRating") as PlaceHolder);
                if (phRating != null)
                {
                    phRating.Controls.Add(GetRatingImages(reviewInfo.Rating));
                }
            }
        }
Exemplo n.º 3
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     if (tbOrderNumber.Text.Length > 0)
     {
         int orderID = _nav.OrderID;
         if (int.TryParse(tbOrderNumber.Text, out orderID))
         {
             OrderController orderController = new OrderController();
             OrderInfo       orderInfo       = orderController.GetOrder(PortalId, orderID);
             if (orderInfo != null)
             {
                 _nav.CustomerID = orderInfo.CustomerID;
                 _nav.OrderID    = orderID;
                 _nav.StatusID   = Null.NullInteger;
                 Response.Redirect(_nav.GetNavigationUrl(), true);
             }
         }
         lstCustomers.ClearSelection();
         lstOrderStatus.ClearSelection();
         plhOrders.Controls.Clear();
         plhOrders.Visible       = false;
         divNoOrderFound.Visible = true;
     }
 }
Exemplo n.º 4
0
        private void grdProducts_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            ProductInfo productInfo = e.Item.DataItem as ProductInfo;

            if (productInfo != null)
            {
                Label labelArchived = (e.Item.FindControl("labelArchived") as Label);
                if (labelArchived != null)
                {
                    labelArchived.Text = productInfo.Archived ? Localization.GetString("Yes", Localization.SharedResourceFile) : Localization.GetString("No", Localization.SharedResourceFile);
                }

                Label labelFeatured = (e.Item.FindControl("labelFeatured") as Label);
                if (labelFeatured != null)
                {
                    labelFeatured.Text = productInfo.Featured ? Localization.GetString("Yes", Localization.SharedResourceFile) : Localization.GetString("No", Localization.SharedResourceFile);
                }

                HyperLink linkEdit = (e.Item.FindControl("linkEdit") as HyperLink);
                if (linkEdit != null)
                {
                    // Update navURL using this item's ID
                    StringDictionary replaceParams = new StringDictionary
                    {
                        ["ProductID"] = productInfo.ProductID.ToString()
                    };
                    linkEdit.NavigateUrl = _nav.GetNavigationUrl(replaceParams);
                }

                HyperLink linkCopy = (e.Item.FindControl("linkCopy") as HyperLink);
                if (linkCopy != null)
                {
                    // Update navURL using this item's ID
                    StringDictionary replaceParams = new StringDictionary
                    {
                        ["CopyProductID"] = productInfo.ProductID.ToString()
                    };
                    linkCopy.NavigateUrl = _nav.GetNavigationUrl(replaceParams);
                }

                Label labelPrice = (e.Item.FindControl("labelPrice") as Label);
                if (labelPrice != null)
                {
                    labelPrice.Text = productInfo.UnitCost.ToString("C", _localFormat);
                }
            }
        }
Exemplo n.º 5
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();
                }
            }
        }
Exemplo n.º 6
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;
            }
        }
Exemplo n.º 7
0
 private void btnStoreInfo_Click(object sender, EventArgs e)
 {
     adminNav = new AdminNavigation();
     adminNav.PageID = "StoreAdmin";
     Response.Redirect(adminNav.GetNavigationUrl(), false);
 }
Exemplo n.º 8
0
 private void btnCustomers_Click(object sender, EventArgs e)
 {
     adminNav = new AdminNavigation();
     adminNav.PageID = "CustomerAdmin";
     Response.Redirect(adminNav.GetNavigationUrl(), false);
 }
Exemplo n.º 9
0
 private void adminControl_EditComplete(object sender, EventArgs e)
 {
     Response.Redirect(_adminNav.GetNavigationUrl(), true);
 }
Exemplo n.º 10
0
 protected void linkAddNew_Click(object sender, EventArgs e)
 {
     _nav.CouponID = 0;
     Response.Redirect(_nav.GetNavigationUrl());
 }