Ejemplo n.º 1
0
        protected void btnChangeGroup_Click(object sender, EventArgs e)
        {
            int?groupId = hfgroupId.Value.TryParseInt() != 0
                                ? hfgroupId.Value.TryParseInt()
                                : default(int?);

            if ((_selectionFilter != null) && (_selectionFilter.Values != null))
            {
                if (!_inverseSelection)
                {
                    foreach (var id in _selectionFilter.Values)
                    {
                        PropertyService.UpdateGroup(Convert.ToInt32(id), groupId);
                    }
                }
                else
                {
                    var itemsIds = _paging.ItemsIds <int>("PropertyID as ID");
                    foreach (var id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString())))
                    {
                        PropertyService.UpdateGroup(id, groupId);
                    }
                }

                _selectionFilter = null;
                hfgroupId.Value  = "";

                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _paging = new SqlPaging {
                TableName = "[Customers].[Customer]"
            };

            _paging.AddFieldsRange(new List <Field>
            {
                new Field {
                    Name = "CustomerID as ID", IsDistinct = true
                },
                new Field {
                    Name = "EMail"
                },
                new Field {
                    Name = "FirstName"
                },
                new Field {
                    Name = "LastName"
                },
                new Field {
                    Name = "CustomerRole"
                },
            });
        }
Ejemplo n.º 3
0
        protected void LoadOrders(int orderStatusId = 0, int page = 1)
        {
            lvOrderStatuses.DataBind();

            _paging = new SqlPaging
            {
                TableName = "[Order].[Order] " +
                            "INNER JOIN [Order].[OrderCustomer] ON [Order].[OrderID] = [OrderCustomer].[OrderID] " +
                            "INNER JOIN [Order].[OrderCurrency] ON [Order].[OrderID] = [OrderCurrency].[OrderID] " +
                            "INNER JOIN [Order].[OrderStatus] ON [Order].[OrderStatusID] = [OrderStatus].[OrderStatusID]"
            };

            _paging.AddFieldsRange(new Field[]
            {
                new Field {
                    Name = "[Order].[OrderID]"
                },
                new Field {
                    Name = "[Order].[OrderStatusID]"
                },
                new Field {
                    Name = "LastName + ' ' +  FirstName as CustomerName"
                },
                new Field {
                    Name = "[Order].[OrderDate]", Sorting = SortDirection.Descending
                },
                new Field {
                    Name = "[Order].[Sum]"
                },
                new Field {
                    Name = "[Order].[PaymentDate]"
                },
                new Field {
                    Name = "[OrderCurrency].[CurrencyCode]"
                },
                new Field {
                    Name = "[OrderCurrency].[CurrencyValue]"
                },
                new Field {
                    Name = "[OrderStatus].[Color]"
                }
            });

            if (orderStatusId != 0)
            {
                _paging.Fields["[Order].[OrderStatusID]"].Filter = new EqualFieldFilter {
                    ParamName = "@OrderStatusID", Value = orderStatusId.ToString()
                };
            }

            _paging.ItemsPerPage     = 10;
            _paging.CurrentPageIndex = page;

            pageNumberer.PageCount        = _paging.PageCount;
            pageNumberer.CurrentPageIndex = _paging.CurrentPageIndex;
            ViewState["Paging"]           = _paging;
        }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_OfferLists_Header);

        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "[Catalog].[OffersList]", ItemsPerPage = 10
            };
            _paging.AddFieldsRange(new[]
            {
                new Field
                {
                    Name = "OfferListID as ID", IsDistinct = true, Filter = _selectionFilter
                },
                new Field {
                    Name = "Name", Sorting = SortDirection.Ascending
                }
            });

            grid.ChangeHeaderImageUrl("arrowName", "~/admin/images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];

            if (!string.IsNullOrEmpty(strIds))
            {
                List <string> arrids = strIds.Trim().Split(' ').ToList();
                if (arrids.Contains("-1"))
                {
                    _inverseSelection = true;
                    arrids.Remove("-1");
                }
                int t;
                _selectionFilter = new InSetFieldFilter
                {
                    IncludeValues = !_inverseSelection,
                    Values        = arrids.Where(id => int.TryParse(id, out t)).ToArray()
                };
            }
        }
    }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     StatusId = Request["orderstatusid"].TryParseInt();
     if (!IsPostBack)
     {
         LoadOrders(StatusId, Request["page"].TryParseInt(1));
         lblTotalOrdersCount.Text = StatisticService.GetOrdersCount().ToString();
     }
     else
     {
         _paging = (SqlPaging)(ViewState["Paging"]);
     }
 }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _paging = new SqlPaging {TableName = "[Customers].[Customer]"};

            _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "CustomerID as ID", IsDistinct = true},
                    new Field {Name = "EMail"},
                    new Field {Name = "FirstName"},
                    new Field {Name = "LastName"},
                    new Field {Name = "CustomerRole"},
                });
        }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // load modalpopup for contact
            _paging = new SqlPaging {
                TableName = "[Catalog].[Category]", ItemsPerPage = 10
            };

            var f = new Field {
                Name = "CategoryID", IsDistinct = true
            };

            _paging.AddField(f);

            f = new Field {
                Name = "Name", Sorting = SortDirection.Ascending
            };

            _paging.AddField(f);

            f = new Field {
                Name = "Products_Count"
            };
            _paging.AddField(f);

            agvCategory.ChangeHeaderImageUrl("arrowName", "../images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
            ViewState["Show"]             = false;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }
        }
    }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _paging = new SqlPaging {
                    TableName = "[Catalog].[Brand]", ItemsPerPage = 10
                };

                var f = new Field {
                    Name = "BrandID", IsDistinct = true
                };

                _paging.AddField(f);

                f = new Field {
                    Name = "BrandName", Sorting = SortDirection.Ascending
                };

                _paging.AddField(f);

                f = new Field {
                    Name = "(Select Count(ProductID) from Catalog.Product Where Product.BrandID=Brand.BrandID) as ProductsCount"
                };
                _paging.AddField(f);

                agvBrand.ChangeHeaderImageUrl("arrowBrandName", "../images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
                ViewState["Show"]             = false;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // load modalpopup for contact
                _paging = new SqlPaging {
                    TableName = "[Settings].[News]", ItemsPerPage = 10
                };

                var f = new Field {
                    Name = "NewsID", IsDistinct = true
                };

                _paging.AddField(f);

                f = new Field {
                    Name = "Title"
                };

                _paging.AddField(f);

                f = new Field {
                    Name = "AddingDate", Sorting = SortDirection.Descending
                };
                _paging.AddField(f);

                agvNews.ChangeHeaderImageUrl("arrowAddingDate", "../images/arrowdown.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 10
0
        protected void LoadOrders(int orderStatusId = 0, int page = 1)
        {
            lvOrderStatuses.DataBind();

            _paging = new SqlPaging
                {
                    TableName =
                        @"[Order].[Order]
                INNER JOIN [Order].[OrderCustomer] ON [Order].[OrderID] = [OrderCustomer].[OrderID]
                INNER JOIN [Order].[OrderCurrency] ON [Order].[OrderID] = [OrderCurrency].[OrderID]
                INNER JOIN [Order].[OrderStatus] ON [Order].[OrderStatusID] = [OrderStatus].[OrderStatusID]"
                };

            var f = new Field { Name = "[Order].[OrderID]" };
            _paging.AddField(f);
            f = new Field { Name = "LastName + ' ' +  FirstName as CustomerName" };
            _paging.AddField(f);
            f = new Field { Name = "[Order].[OrderStatusID]" };
            if (orderStatusId != 0)
            {
                f.Filter = new EqualFieldFilter { ParamName = "@OrderStatusID", Value = orderStatusId.ToString() };
            }
            _paging.AddField(f);
            f = new Field { Name = "[Order].[OrderDate]", Sorting = SortDirection.Descending };
            _paging.AddField(f);
            f = new Field { Name = "[Order].[Sum]" };
            _paging.AddField(f);
            f = new Field { Name = "[Order].[PaymentDate]" };
            _paging.AddField(f);
            f = new Field { Name = "[OrderCurrency].[CurrencyCode]" };
            _paging.AddField(f);
            f = new Field { Name = "[OrderCurrency].[CurrencyValue]" };
            _paging.AddField(f);
            f = new Field { Name = "[OrderStatus].[Color]" };
            _paging.AddField(f);

            _paging.ItemsPerPage = 10;
            _paging.CurrentPageIndex = page;

            pageNumberer.PageCount = _paging.PageCount;
            pageNumberer.CurrentPageIndex = _paging.CurrentPageIndex;
            ViewState["Paging"] = _paging;
        }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_MasterPageAdmin_SEO_redirects);

        if (!IsPostBack)
        {
            _Paging = new SqlPaging
            {
                TableName    = "[Settings].[Redirect]",
                ItemsPerPage = 1000
            };

            _Paging.AddFieldsRange(
                new List <Field>
            {
                new Field {
                    Name = "ID", IsDistinct = true
                },
                new Field {
                    Name = "RedirectFrom"
                },
                new Field {
                    Name = "RedirectTo"
                }
            });

            _Paging.ItemsPerPage = 1000;

            _Paging.CurrentPageIndex = 1;
            ViewState["Paging"]      = _Paging;
        }
        else
        {
            _Paging = (SqlPaging)(ViewState["Paging"]);
            _Paging.ItemsPerPage = 1000;

            if (_Paging == null)
            {
                throw (new Exception("Paging lost"));
            }
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_MasterPageAdmin_SEO_redirects);

        if (!IsPostBack)
        {
            _Paging = new SqlPaging
                          {
                              TableName = "[Settings].[Redirect]",
                              ItemsPerPage = 1000
                          };

            _Paging.AddFieldsRange(
                new List<Field>
                    {
                        new Field {Name = "ID", IsDistinct = true},
                        new Field {Name = "RedirectFrom"},
                        new Field {Name = "RedirectTo"}
                    });

            _Paging.ItemsPerPage = 1000;

            _Paging.CurrentPageIndex = 1;
            ViewState["Paging"] = _Paging;
        }
        else
        {
            _Paging = (SqlPaging)(ViewState["Paging"]);
            _Paging.ItemsPerPage = 1000;

            if (_Paging == null)
            {
                throw (new Exception("Paging lost"));
            }
        }
    }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = @"[Order].[Order]
                            INNER JOIN [Order].[OrderStatus] ON [Order].[OrderStatusID] = [OrderStatus].[OrderStatusID]
                            INNER JOIN [Order].[OrderCurrency] ON [Order].[OrderID] = [OrderCurrency].[OrderID]
                            INNER JOIN [Order].[OrderCustomer] ON [Order].[OrderID] = [OrderCustomer].[OrderID]
                            INNER JOIN [Order].[ShippingMethod] ON [Order].[ShippingMethodID] = [ShippingMethod].[ShippingMethodID]
                            INNER JOIN [Order].[PaymentMethod] ON [Order].[PaymentMethodID] = [PaymentMethod].[PaymentMethodID]",
                        ItemsPerPage = 10,
                        CurrentPageIndex = 1
                    };

                _paging.AddFieldsRange(new[]
                    {
                        new Field {Name = "[Order].OrderID", Sorting=SortDirection.Ascending  },
                        new Field {Name = "[Order].OrderDiscount"},
                        new Field {Name = "[OrderStatus].StatusName"},
                        new Field {Name = "[OrderStatus].OrderStatusID"}, // , NotInQuery =true
                        new Field {Name = "[Order].Sum"},
                        new Field {Name = "[Order].OrderDate"},
                        new Field {Name = "[Order].ShippingMethod.Name as ShippingMethod"},
                        new Field {Name = "[Order].PaymentMethod.Name as PaymentMethod"},
                        new Field {Name = "[OrderCustomer].FirstName"},
                        new Field {Name = "[OrderCustomer].LastName"},
                        new Field {Name = "[OrderCustomer].CustomerID"},
                        new Field {Name = "[OrderCurrency].CurrencyCode"},
                        new Field {Name = "[OrderCurrency].CurrencyValue"}
                    });

                _paging.Fields["[OrderCustomer].CustomerID"].Filter = string.IsNullOrEmpty(Request["customerid"]) ? null : new CompareFieldFilter { Expression = Request["customerid"], ParamName = "@CustomerID" };
                //grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");
                pageNumberer.CurrentPageIndex = 1;
                ViewState["CustomerOrderHistoryAdminPaging"] = _paging;

                ddlOrderStatus.Items.Clear();
                ddlOrderStatus.Items.Add(new ListItem(Resource.Admin_Catalog_Any, "-1"));
                foreach (var status in OrderService.GetOrderStatuses())
                {
                    ddlOrderStatus.Items.Add(status.StatusName);
                }
            }
            else
            {
                _paging = (SqlPaging)(ViewState["CustomerOrderHistoryAdminPaging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Message.Visible = false;
            MsgErr(true);

            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resource.Admin_Discount_PriceRange_SubHeader));

            if (!IsPostBack)
            {
                chkModuleEnabled.Checked = AdvantShop.Configuration.SettingsOrderConfirmation.EnableDiscountModule;
            }

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Order].[OrderPriceDiscount]", ItemsPerPage = 10 };

                var f = new Field { Name = "OrderPriceDiscountID as ID" };

                //f.IsDistinct = True
                _paging.AddField(f);

                f = new Field { Name = "PriceRange", Sorting = SortDirection.Ascending };
                _paging.AddField(f);

                f = new Field { Name = "PercentDiscount" };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowPriceRange", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)ViewState["Paging"];
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw new Exception("Paging lost");
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        string t = arrids[idx];
                        if (t != "-1")
                        {
                            ids[idx] = t;
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MsgErr(true);

            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_CustomerSearch_SubHeader));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = "[Customers].[Customer]", ItemsPerPage = 10
                    };

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field { Name = "CustomerID as ID", IsDistinct = true },
                        new Field { Name = "Email" },
                        new Field { Name = "Firstname", Sorting = SortDirection.Ascending },
                        new Field { Name = "Lastname" },
                        new Field { Name = "CustomerGroupId" },
                        new Field { Name = "RegistrationDateTime" },
                        new Field { Name = "CustomerRole" },
                        new Field { Name = "PriceType" }
                    });

                if (CustomerSession.CurrentCustomer.CustomerRole == Role.Moderator)
                {
                    _paging.Fields["CustomerRole"].Filter = new EqualFieldFilter { ParamName = "@CustomerRole", Value = ((int)Role.User).ToString() };
                }

                advCustomers.ChangeHeaderImageUrl("arrowFirstname", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;

                if (Request["search"].IsNotEmpty())
                {
                    var customer = CustomerService.GetCustomerByEmail(Request["search"]);
                    if (customer != null)
                    {
                        Response.Redirect("ViewCustomer.aspx?customerID=" + customer.Id);
                        return;
                    }

                    if (Request["search"].Contains("@"))
                    {
                        txtSearchEmail.Text = Request["search"];
                    }
                    else
                    {
                        txtSearchLastname.Text = Request["search"];
                    }

                    btnFilter_Click(null, null);
                }

            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                var strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length ];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        var t = arrids[idx];
                        if (t != "-1")
                        {
                            ids[idx] = t;
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblError.Text = string.Empty;
            lblError.Visible = false;

            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Properties_ListPropreties));

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Settings].[NewsCategory]" };

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field {Name = "NewsCategoryID as ID", IsDistinct = true},
                        new Field {Name = "Name"},
                        new Field {Name = "SortOrder", Sorting = SortDirection.Ascending},
                        new Field {Name = "UrlPath"},
                    });
                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }
                    _selectionFilter.Values = ids;
                    //_InverseSelection = If(ids(0) = -1, True, False)
                }
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Currencies_Header));

            if (!IsPostBack)
            {
                chkAutoUpdateEnabled.Checked = SettingsMain.EnableAutoUpdateCurrencies;

                _paging = new SqlPaging {
                    TableName = "[Catalog].[Currency]", ItemsPerPage = 10
                };

                var f = new Field {
                    Name = "CurrencyID as ID", IsDistinct = true, Filter = _selectionFilter
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "Name", Sorting = SortDirection.Ascending
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "Code"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "CurrencyValue"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "CurrencyISO3"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "CurrencyNumIso3"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "IsCodeBefore"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "PriceFormat"
                };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowName", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];


                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter {
                        IncludeValues = true
                    };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                    //_InverseSelection = If(ids(0) = -1, True, False)
                }
            }
        }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MsgErr(true);
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_OrderSearch_SubHeader);

        if (!IsPostBack)
        {
            FillStatusFilter();
            FillPaymentMethodFilter();
            FillShippingMethodFilter();

            _paging = new SqlPaging
            {
                TableName =
                    @"[Order].[Order] 
                                        JOIN [Order].[OrderCustomer] ON [Order].[OrderID]=[OrderCustomer].[OrderID] 
                                        LEFT JOIN [Order].[OrderStatus] ON [OrderStatus].[OrderStatusID]=[Order].[OrderStatusID] 
                                        JOIN [Order].[OrderCurrency] ON [Order].[OrderID] = [OrderCurrency].[OrderID]
                                        JOIN [Order].[OrderContact] ON [Order].[BillingContactID] = [OrderContact].[OrderContactID]
                                        LEFT JOIN [Order].[PaymentMethod] ON [Order].[PaymentMethodID] = [Order].[PaymentMethod].[PaymentMethodID]
                                        LEFT JOIN [Order].[ShippingMethod] ON [Order].[ShippingMethodID] = [Order].[ShippingMethod].ShippingMethodID",
                ItemsPerPage = 10
            };

            _paging.AddFieldsRange(
                new Field("[Order].OrderID as ID")
            {
                IsDistinct = true, Sorting = SortDirection.Descending
            },
                new Field("StatusName"),
                new Field("PaymentDate"),
                new Field("PaymentMethodName"),
                new Field("ShippingMethodName"),
                new Field("FirstName + ' ' + LastName as BuyerName"),
                new Field("OrderContact.Name as BillingName"),
                new Field("PaymentMethod.Name as PaymentMethod"),
                new Field("ShippingMethod.Name as ShippingMethod"),
                new Field("Sum"),
                new Field("OrderDate"),
                new Field("CurrencyValue"),
                new Field("CurrencyCode"),
                new Field("CustomerID"));


            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;

            grid.ChangeHeaderImageUrl("arrowOrderID", "images/arrowdown.gif");

            if (Request["filter"] != null)
            {
                if (Request["filter"] == "lastmonth")
                {
                    txtDateFrom.Text = DateTime.Now.Date.AddDays(-1).ToString("dd.MM.yyyy");
                    txtDateTo.Text   = DateTime.Now.Date.AddMonths(1).ToString("dd.MM.yyyy");
                }
                if (Request["filter"] == "today")
                {
                    txtDateFrom.Text = DateTime.Now.Date.ToString("dd.MM.yyyy");
                    txtDateTo.Text   = DateTime.Now.Date.ToString("dd.MM.yyyy");
                }
                if (Request["filter"] == "yesterday")
                {
                    txtDateFrom.Text = DateTime.Now.Date.AddDays(-1).ToString("dd.MM.yyyy");
                    txtDateTo.Text   = DateTime.Now.Date.AddDays(-1).ToString("dd.MM.yyyy");
                }
                btnFilter_Click(sender, e);
            }

            ddlStatus.DataBind();
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];

            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                var arrids = strIds.Split(' ');

                var ids = new string[arrids.Length];

                _selectionFilter = new InSetFieldFilter {
                    IncludeValues = true
                };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    var t = arrids[idx];
                    if (t.Replace(" ", "") != "-1")
                    {
                        ids[idx] = t;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                }

                _selectionFilter.Values = ids;
            }
        }

        if (!IsPostBack && !string.IsNullOrEmpty(Request["status"]))
        {
            ddlStatusName.SelectedValue = Request["status"].ToLower();
            btnFilter_Click(new object(), new EventArgs());
        }
    }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resources.Resource.Admin_Regions_Header));
            if (string.IsNullOrEmpty(Request["countryid"]))
            {
                Response.Redirect("Country.aspx");
            }

            Country country = CountryService.GetCountry(SQLDataHelper.GetInt(CountryID));
            if (country == null)
                Response.Redirect("Country.aspx");
            else
            {
                lblHead.Text = country.Name;
                hlBack.NavigateUrl = "Country.aspx";
                hlBack.Text = Resources.Resource.Admin_Cities_BackToCoutries;
            }

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Customers].[Region]", ItemsPerPage = 20 };

                var f = new Field { Name = "RegionID as ID", IsDistinct = true };
                _paging.AddField(f);

                f = new Field { Name = "RegionName", Sorting = SortDirection.Ascending };
                _paging.AddField(f);

                f = new Field { Name = "RegionCode" };
                _paging.AddField(f);

                f = new Field { Name = "RegionSort" };
                _paging.AddField(f);

                f = new Field() { Name = "CountryID", Filter = new EqualFieldFilter() { ParamName = "@CounrtyID", Value = CountryID.ToString() } };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowRegionName", "images/arrowup.gif");

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;

            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length ];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString(CultureInfo.InvariantCulture);
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }
                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_PageParts_StaticBlocks));
            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName    = "[CMS].[StaticBlock]",
                    ItemsPerPage = 50
                };

                _paging.AddFieldsRange(new List <Field>
                {
                    new Field {
                        Name = "StaticBlockID as ID", IsDistinct = true
                    },
                    new Field {
                        Name = "[Key]", Sorting = SortDirection.Ascending
                    },
                    new Field {
                        Name = "InnerName"
                    },
                    new Field {
                        Name = "Added"
                    },
                    new Field {
                        Name = "Modified"
                    },
                    new Field {
                        Name = "Enabled"
                    }
                });

                grid.ChangeHeaderImageUrl("arrowKey", "images/arrowup.gif");

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["statusFilters"] = OrderService.GetOrderStatuses(false).Keys.ToList <string>();
            var paging = new SqlPaging
            {
                TableName =
                    "[Order].[Order] left join [Order].[OrderCustomer] on [Order].[OrderID] = [OrderCustomer].[OrderID] inner join [Order].[OrderCurrency] on [Order].[OrderID] = [OrderCurrency].[OrderID]"
            };

            var f = new Field {
                Name = "[Order].[OrderID]"
            };
            paging.AddField(f);
            f = new Field {
                Name = "LastName + ' ' +  FirstName as CustomerName"
            };
            paging.AddField(f);
            f = new Field {
                Name = "OrderStatusID", Sorting = SortDirection.Ascending
            };
            paging.AddField(f);
            f = new Field {
                Name = "OrderDate", Sorting = SortDirection.Descending
            };
            paging.AddField(f);

            f = new Field {
                Name = "Sum"
            };
            paging.AddField(f);
            f = new Field {
                Name = "TaxCost"
            };
            paging.AddField(f);
            f = new Field {
                Name = "ShippingCost"
            };
            paging.AddField(f);
            f = new Field {
                Name = "OrderDiscount"
            };
            paging.AddField(f);
            f = new Field {
                Name = "CurrencyCode"
            };
            paging.AddField(f);
            f = new Field {
                Name = "CurrencyValue"
            };
            paging.AddField(f);

            paging.ItemsPerPage     = RowsPerPage;
            paging.CurrentPageIndex = 1;
            lbPagePrev.Enabled      = false;
            var pageCount = paging.PageCount;
            lbPageNext.Enabled = paging.CurrentPageIndex != pageCount;
            for (int i = 1; i <= pageCount; i++)
            {
                ddlPage.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }

            Paging = paging;
        }
        else
        {
            CalendarExtender1.SelectedDate = null;
            CalendarExtender2.SelectedDate = null;
        }
    }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName        = @"[Order].[Order] 
                            INNER JOIN [Order].[OrderStatus] ON [Order].[OrderStatusID] = [OrderStatus].[OrderStatusID] 
                            INNER JOIN [Order].[OrderCurrency] ON [Order].[OrderID] = [OrderCurrency].[OrderID] 
                            INNER JOIN [Order].[OrderCustomer] ON [Order].[OrderID] = [OrderCustomer].[OrderID] 
                            LEFT JOIN [Order].[ShippingMethod] ON [Order].[ShippingMethodID] = [ShippingMethod].[ShippingMethodID] 
                            LEFT JOIN [Order].[PaymentMethod] ON [Order].[PaymentMethodID] = [PaymentMethod].[PaymentMethodID]",
                    ItemsPerPage     = 10,
                    CurrentPageIndex = 1
                };

                _paging.AddFieldsRange(new[]
                {
                    new Field {
                        Name = "[Order].OrderID", Sorting = SortDirection.Ascending
                    },
                    new Field {
                        Name = "[Order].OrderDiscount"
                    },
                    new Field {
                        Name = "[OrderStatus].StatusName"
                    },
                    new Field {
                        Name = "[OrderStatus].OrderStatusID"
                    },                                                    // , NotInQuery =true
                    new Field {
                        Name = "[Order].Sum"
                    },
                    new Field {
                        Name = "[Order].OrderDate", Sorting = SortDirection.Descending
                    },
                    new Field {
                        Name = "[Order].ShippingMethod.Name as ShippingMethod"
                    },
                    new Field {
                        Name = "[Order].PaymentMethod.Name as PaymentMethod"
                    },
                    new Field {
                        Name = "[OrderCustomer].FirstName"
                    },
                    new Field {
                        Name = "[OrderCustomer].LastName"
                    },
                    new Field {
                        Name = "[OrderCustomer].CustomerID"
                    },
                    new Field {
                        Name = "[OrderCurrency].CurrencyCode"
                    },
                    new Field {
                        Name = "[OrderCurrency].CurrencyValue"
                    }
                });

                _paging.Fields["[OrderCustomer].CustomerID"].Filter = string.IsNullOrEmpty(Request["customerid"]) ? null : new CompareFieldFilter {
                    Expression = Request["customerid"], ParamName = "@CustomerID"
                };
                //grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");
                pageNumberer.CurrentPageIndex = 1;
                ViewState["CustomerOrderHistoryAdminPaging"] = _paging;

                ddlOrderStatus.Items.Clear();
                ddlOrderStatus.Items.Add(new ListItem(Resource.Admin_Catalog_Any, "-1"));
                foreach (var status in OrderService.GetOrderStatuses())
                {
                    ddlOrderStatus.Items.Add(status.StatusName);
                }
            }
            else
            {
                _paging = (SqlPaging)(ViewState["CustomerOrderHistoryAdminPaging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Catalog].[Brand]", ItemsPerPage = 10 };

                var f = new Field { Name = "BrandID", IsDistinct = true };

                _paging.AddField(f);

                f = new Field { Name = "BrandName", Sorting = SortDirection.Ascending };

                _paging.AddField(f);

                f = new Field { Name = "(Select Count(ProductID) from Catalog.Product Where Product.BrandID=Brand.BrandID) as ProductsCount" };
                _paging.AddField(f);

                agvBrand.ChangeHeaderImageUrl("arrowBrandName", "../images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
                ViewState["Show"] = false;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _priceField = CustomerSession.CurrentCustomer.PriceType.ToString();

            _paging = new SqlPaging
                {
                    TableName =
                        "[Catalog].[Product] " +
                        "LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] AND [Offer].[Main] = 1 " +
                        "LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId] and Type='product' and Photo.Main=1 " +
                        "inner join Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] " +
                        "LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferID] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId " +
                        "Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId " +
                        "LEFT JOIN [Customers].[LastPrice] ON [LastPrice].[ProductId] = [Product].[ProductId] AND [LastPrice].[CustomerId] = @CustomerId"
                };

            _paging.AddFieldsRange(
            new List<Field>
                {
                    new Field {Name = "[Product].[ProductID]", IsDistinct = true},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"},
                    new Field {Name = "[ProductCategories].[CategoryID]", NotInQuery=true},
                    new Field {Name = "BriefDescription"},
                    new Field {Name = "Product.ArtNo"},
                    new Field {Name = "Name"},

                    new Field {Name = "Recomended"},
                    new Field {Name = "Bestseller"},
                    new Field {Name = "New"},
                    new Field {Name = "OnSale"},
                    new Field {Name = "Discount"},
                    new Field {Name = "Offer.Main", NotInQuery=true},
                    new Field {Name = "Offer.OfferID"},
                    new Field {Name = "Offer.Amount"},
                    new Field {Name = "(CASE WHEN Offer.Amount=0 OR Offer.Amount < IsNull(MinAmount,0) THEN 0 ELSE 1 END) as TempAmountSort", Sorting=SortDirection.Descending},
                    new Field {Name = "MinAmount"},
                    new Field {Name = "MaxAmount"},
                    new Field {Name = "Multiplicity"},
                    new Field {Name = "Enabled"},
                    new Field {Name = "AllowPreOrder"},
                    new Field {Name = "Ratio"},
                    new Field {Name = "RatioID"},
                    new Field {Name = "DateModified"},
                    new Field {Name = "ShoppingCartItemId"},
                    new Field {Name = "UrlPath"},

                    new Field {Name = "[ShoppingCart].[CustomerID]", NotInQuery=true},
                    new Field {Name = "BrandID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Size_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Color_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Price_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ColorID"},
                    new Field {Name = "CategoryEnabled", NotInQuery=true},
                    new Field {Name = "null as AdditionalPhoto"}
                });

            if (SettingsCatalog.ComplexFilter)
            {
                _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"},
                    new Field {Name = string.Format("(select max ({0}) - min ({0}) from catalog.offer where offer.productid=product.productid) as MultiPrices", _priceField)},
                    new Field {Name = string.Format("(select min ({0}) from catalog.offer where offer.productid=product.productid) as Price", _priceField)},
                });
            }
            else
            {
                _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "null as Colors"},
                    new Field {Name = "0 as MultiPrices"},
                    new Field
                    {
                        Name = SettingsCatalog.UseLastPrice
                            ? string.Format("(CASE WHEN ProductPrice IS NULL THEN {0} ELSE ProductPrice END) as Price", _priceField)
                            : string.Format("{0} as Price", _priceField)
                    },
                });
            }
            _paging.AddParam(new SqlParam { ParameterName = "@CustomerId", Value = CustomerSession.CustomerId.ToString() });
            _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.Product.ToString() });

            BuildSorting();
            BuildFilter();

            var nmeta = new MetaInfo(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Client_Search_AdvancedSearch));
            SetMeta(nmeta, string.Empty, page:paging.CurrentPage);
            txtName.Focus();
        }
Ejemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_MenuManager_TopMenu));

            Int32.TryParse(Request["menuid"], out _menuId);
            _needReloadTree = SQLDataHelper.GetBoolean(ViewState["updateTree"]);

            hlEditCategory.Visible = _menuId > 0;
            lblSeparator.Visible = _menuId > 0;
            hlDeleteCategory.Visible = _menuId > 0;

            if (!string.IsNullOrWhiteSpace(Request["type"]))
                Enum.TryParse(Request["type"], true, out _menuType);

            var menuitem = new AdvMenuItem();
            switch (_menuType)
            {
                case MenuService.EMenuType.Top:
                    menuitem = MenuService.GetMenuItemById(_menuId, _menuType);

                    lblHead.Text = menuitem == null
                                       ? Resource.Admin_MenuManager_TopMenu
                                       : string.Format("{0} - {1}", Resource.Admin_MenuManager_TopMenu, menuitem.MenuItemName);
                    lblSubHead.Text = Resource.Admin_MenuManager_SubHeaderTop;

                    Page.Title = menuitem == null
                                     ? Resource.Admin_MenuManager_TopMenu
                                     : string.Format("{0} - {1}", Resource.Admin_MenuManager_TopMenu, menuitem.MenuItemName);

                    break;
                case MenuService.EMenuType.Bottom:
                    menuitem = MenuService.GetMenuItemById(_menuId, _menuType);

                    lblHead.Text = menuitem == null
                                       ? Resource.Admin_MenuManager_BottomMenu
                                       : string.Format("{0} - {1}", Resource.Admin_MenuManager_BottomMenu, menuitem.MenuItemName);
                    lblSubHead.Text = Resource.Admin_MenuManager_SubHeaderBottom;

                    Page.Title = menuitem == null
                                     ? Resource.Admin_MenuManager_BottomMenu
                                     : string.Format("{0} - {1}", Resource.Admin_MenuManager_BottomMenu, menuitem.MenuItemName);
                    break;
            }

            btnAdd.OnClientClick = "open_window('m_Menu.aspx?MenuID=" + _menuId + "&mode=create&type=" + _menuType + "', 750, 640);return false;";
            hlEditCategory.NavigateUrl = "javascript:open_window(\'m_Menu.aspx?MenuID=" + _menuId + "&mode=edit&type=" + _menuType + "\', 750, 640)";
            ConfirmButtonExtenderCategory.ConfirmText =
                string.Format(Resource.Admin_MasterPageAdminCatalog_MenuConfirmation, menuitem != null ? menuitem.MenuItemName : string.Empty);

            if (!IsPostBack)
            {
                switch (_menuType)
                {
                    case MenuService.EMenuType.Top:
                        _paging = new SqlPaging
                            {
                                TableName = "[CMS].[MainMenu]",
                                ItemsPerPage = 10
                            };
                        break;
                    case MenuService.EMenuType.Bottom:
                        _paging = new SqlPaging
                            {
                                TableName = "[CMS].[BottomMenu]",
                                ItemsPerPage = 10
                            };
                        break;
                }

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field
                            {
                                Name = "MenuItemID as ID",
                                IsDistinct = true
                            },
                        new Field {Name = "MenuItemParentID" },
                        new Field {Name = "MenuItemName"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "Blank"},
                        new Field {Name = "SortOrder",Sorting = SortDirection.Ascending}
                    });

                if (_menuId != 0)
                {
                    var filter = new EqualFieldFilter { ParamName = "@MenuItemParentID", Value = _menuId.ToString() };
                    _paging.Fields["MenuItemParentID"].Filter = filter;
                }
                else
                {
                    var filter = new NullFieldFilter { ParamName = "@MenuItemParentID", Null = true };
                    _paging.Fields["MenuItemParentID"].Filter = filter;
                }

                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["theme"] == null)
        {
            Response.Redirect("Voting.aspx");
        }
        lblHead.Text = VoiceService.GetVotingName(ThemeId);
        Page.Title   = string.Format("{0} - {1} - {2}", SettingsMain.ShopName, lblHead.Text, lblSubHead.Text);

        if (!IsPostBack)
        {
            _paging = new SqlPaging
            {
                TableName    = "[Voice].[Answer]",
                ItemsPerPage = 10
            };

            _paging.AddFieldsRange(new List <Field>
            {
                new Field {
                    Name = "AnswerID as ID", IsDistinct = true
                },
                new Field {
                    Name = "Name"
                },
                new Field {
                    Name = "CountVoice"
                },
                new Field {
                    Name = "Sort", Sorting = SortDirection.Ascending
                },
                new Field {
                    Name = "IsVisible"
                },
                new Field {
                    Name = "DateAdded"
                },
                new Field {
                    Name = "DateModify"
                },
                new Field
                {
                    Name   = "FKIDTheme",
                    Filter = new EqualFieldFilter {
                        ParamName = "@Theme", Value = ThemeId.ToString()
                    }
                }
            });

            grid.ChangeHeaderImageUrl("arrowSort", "images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];

            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                string[] arrids = strIds.Split(' ');

                _selectionFilter = new InSetFieldFilter();
                if (arrids.Contains("-1"))
                {
                    _selectionFilter.IncludeValues = false;
                    _inverseSelection = true;
                }
                else
                {
                    _selectionFilter.IncludeValues = true;
                }
                _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
            }
        }
    }
Ejemplo n.º 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName = "[Catalog].[ShoppingCart] as sc " +
                                "Inner Join [Customers].[Customer] On sc.[CustomerId] = [Customer].[CustomerID] ",
                    ItemsPerPage = 30,
                };

                _paging.AddFieldsRange(new List <Field>
                {
                    new Field {
                        Name = "sc.[CustomerId]", IsDistinct = true
                    },
                    new Field {
                        Name = "ShoppingCartType"
                    },
                    new Field
                    {
                        Name = "(Select top(1) Email From [Customers].[Customer] " +
                               "Where [Customer].[CustomerID] = sc.CustomerId) as Email"
                    },
                    new Field
                    {
                        Name = "(Select top(1) UpdatedOn From [Catalog].[ShoppingCart] " +
                               "Where [ShoppingCart].[CustomerID] = sc.CustomerId and ShoppingCartType = @CartType Order By UpdatedOn Desc) as LastUpdate",
                        Sorting = SortDirection.Descending
                    },
                    new Field
                    {
                        Name = "(Select SUM(Price * [ShoppingCart].[Amount]) " +
                               "From [Catalog].[ShoppingCart] " +
                               "Inner Join [Catalog].[Offer] On [Offer].[OfferID] = [ShoppingCart].[OfferId] " +
                               "Where [ShoppingCart].[CustomerID] = sc.CustomerId and ShoppingCartType = @CartType) As Sum"
                    },
                    new Field
                    {
                        Name = "(Select Count(*) From [Module].[AbandonedCartLetter] " +
                               "Where AbandonedCartLetter.CustomerId = sc.CustomerId) as SendingCount"
                    },
                    new Field
                    {
                        Name = "(Select Top(1)SendingDate From [Module].[AbandonedCartLetter] " +
                               "Where AbandonedCartLetter.CustomerId = sc.CustomerId Order By SendingDate Desc) as SendingDate"
                    },
                });

                _paging.Fields["ShoppingCartType"].Filter = new EqualFieldFilter()
                {
                    ParamName = "@CartType",
                    Value     = ((int)ShoppingCartType.ShoppingCart).ToString()
                };

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }


            if (!IsPostBack)
            {
                ddlTemplate.Items.Clear();
                ddlTemplate.Items.Add(new ListItem("не выбран", "-1"));
                foreach (var template in AbandonedCartsService.GetTemplates())
                {
                    ddlTemplate.Items.Add(new ListItem(template.Name, template.Id.ToString()));
                }
            }
        }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resources.Resource.Admin_Taxes_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Catalog].[Tax] JOIN [Customers].[Country] ON [Tax].[CountryID] = [Country].[CountryID]", ItemsPerPage = 10 };

                var f = new Field { Name = "TaxID as ID", IsDistinct = true };
                _paging.AddField(f);

                f = new Field { Name = "Name", Sorting = SortDirection.Ascending };
                _paging.AddField(f);

                f = new Field { Name = "RegNumber" };
                _paging.AddField(f);

                f = new Field { Name = "Enabled" };
                _paging.AddField(f);

                f = new Field { Name = "[Tax].CountryID" };
                _paging.AddField(f);

                f = new Field { Name = "CountryName" };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowName", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;

            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString(CultureInfo.InvariantCulture);
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }

            }
        }
Ejemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_SizesDictionary_Header));

            MsgError();

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = "[Catalog].[Size]",
                        ItemsPerPage = 20,
                        CurrentPageIndex = 1
                    };

                _paging.AddFieldsRange(new[]
                    {
                        new Field {Name = "SizeID as ID", IsDistinct = true},
                        new Field {Name = "SizeName"},
                        new Field {Name = "SortOrder", Sorting = SortDirection.Ascending}
                    });
                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");
                pageNumberer.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString(CultureInfo.InvariantCulture);
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }
                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Coupons_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = "[Catalog].[Coupon]",
                        ItemsPerPage = 10
                    };

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field
                            {
                                Name = "CouponID as ID",
                                IsDistinct = true
                            },
                        new Field {Name = "Code"},
                        new Field {Name = "Type"},
                        new Field {Name = "Value"},
                        new Field {Name = "AddingDate", Sorting = SortDirection.Descending},
                        new Field {Name = "ExpirationDate"},
                        new Field {Name = "PossibleUses"},
                        new Field {Name = "ActualUses"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "MinimalOrderPrice"},
                    });

                grid.ChangeHeaderImageUrl("arrowAddingDate", "images/arrowdown.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request["type"]))
            {
                if (!string.IsNullOrEmpty(Request["type"]))
                {
                    Enum.TryParse(Request["type"], true, out _typeFlag);
                }
            }

            switch (_typeFlag)
            {
                case ProductOnMain.TypeFlag.Bestseller:
                    lblHead.Text = Resource.Admin_UserControls_MainPageProduct_Bestseller;
                    break;
                case ProductOnMain.TypeFlag.New:
                    lblHead.Text = Resource.Admin_UserControls_MainPageProduct_New;
                    break;
                case ProductOnMain.TypeFlag.Discount:
                    lblHead.Text = Resource.Admin_UserControls_MainPageProduct_Discount;
                    break;
            }

            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, lblHead.Text));

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Catalog].[Product]", ItemsPerPage = 20 };

                var f = new Field { Name = "Product.ProductId as ID" };
                _paging.AddField(f);

                f = new Field { Name = "ArtNo" };
                _paging.AddField(f);

                f = new Field { Name = "Name" };
                _paging.AddField(f);

                if (_typeFlag == ProductOnMain.TypeFlag.Bestseller)
                {
                    f = new Field { Name = "Bestseller" };
                    var filterB = new EqualFieldFilter { ParamName = "@Bestseller", Value = "1" };
                    f.Filter = filterB;
                    _paging.AddField(f);

                    _paging.AddField(new Field { Name = "SortBestseller as Sort", Sorting = SortDirection.Ascending });
                }

                if (_typeFlag == ProductOnMain.TypeFlag.New)
                {
                    f = new Field { Name = "New" };
                    var filterN = new EqualFieldFilter { ParamName = "@New", Value = "1" };
                    f.Filter = filterN;
                    _paging.AddField(f);

                    _paging.AddField(new Field { Name = "SortNew as Sort", Sorting = SortDirection.Ascending });
                }

                if (_typeFlag == ProductOnMain.TypeFlag.Discount)
                {
                    f = new Field { Name = "Discount" };
                    var filterN = new NotEqualFieldFilter() { ParamName = "@Discount", Value = "0" };
                    f.Filter = filterN;
                    _paging.AddField(f);

                    _paging.AddField(new Field { Name = "SortDiscount as Sort", Sorting = SortDirection.Ascending });
                    btnAddProduct.Visible = false;
                }

                grid.ChangeHeaderImageUrl("arrowSort", "images/arrowup.gif");

                _paging.ItemsPerPage = 20;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;

            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length ];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }
                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 32
0
        protected void btnDownload_Click(object sender, EventArgs e)
        {
            if (CommonStatistic.IsRun)
            {
                lError.Visible = true;
                lError.Text    = Resource.Admin_Restrict_Action_In_demo;
                return;
            }
            var paging = new SqlPaging
            {
                TableName = "[Order].[Order]"
            };

            paging.AddField(new Field {
                Name = "*"
            });

            if (chkStatus.Checked)
            {
                paging.AddField(new Field
                {
                    Name       = "OrderStatusID",
                    NotInQuery = true,
                    Filter     = new EqualFieldFilter {
                        ParamName = "@OrderStatusID", Value = ddlStatus.SelectedValue
                    }
                });
            }

            if (chkDate.Checked)
            {
                var filter = new DateTimeRangeFieldFilter {
                    ParamName = "@RDate"
                };
                var dateFrom = txtDateFrom.Text.TryParseDateTime();
                filter.From = dateFrom != DateTime.MinValue ? dateFrom : new DateTime(2000, 1, 1);

                var dateTo = txtDateTo.Text.TryParseDateTime();
                filter.To = dateTo != DateTime.MinValue ? dateTo.AddDays(1) : new DateTime(3000, 1, 1);
                paging.AddField(new Field {
                    Name = "OrderDate", NotInQuery = true, Filter = filter
                });
            }
            var ordersCount = paging.TotalRowsCount;

            if (ordersCount == 0)
            {
                return;
            }
            CommonStatistic.Init();
            CommonStatistic.IsRun              = true;
            CommonStatistic.CurrentProcess     = Request.Url.PathAndQuery;
            CommonStatistic.CurrentProcessName = Resource.Admin_ExportOrdersExcel_DownloadOrders;
            CommonStatistic.TotalRow           = ordersCount;

            linkCancel.Visible  = true;
            OutDiv.Visible      = true;
            btnDownload.Visible = false;
            pnSearch.Visible    = false;
            try
            {
                // Directory
                if (!Directory.Exists(_strFilePath))
                {
                    Directory.CreateDirectory(_strFilePath);
                }

                CommonStatistic.StartNew(() => Save(paging));
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                lError.Text           = ex.Message;
                lError.Visible        = true;
                CommonStatistic.IsRun = false;
            }
        }
Ejemplo n.º 33
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_StaticPage_lblSubMain));

            int.TryParse(Request["parentid"], out _parentPageId);
            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName    = "[CMS].[StaticPage]",
                    ItemsPerPage = 10
                };

                _paging.AddFieldsRange(new List <Field>
                {
                    new Field {
                        Name = "StaticPageID as ID", IsDistinct = true
                    },
                    new Field {
                        Name = "PageName"
                    },
                    new Field {
                        Name = "Enabled"
                    },
                    new Field {
                        Name = "ParentID"
                    },
                    new Field {
                        Name = "SortOrder", Sorting = SortDirection.Ascending
                    },
                    new Field {
                        Name = "ModifyDate"
                    }
                });


                if (_parentPageId != 0)
                {
                    var ef = new EqualFieldFilter()
                    {
                        ParamName = "@ParentID",
                        Value     = _parentPageId.ToString(CultureInfo.InvariantCulture)
                    };

                    _paging.Fields["ParentID"].Filter = ef;
                }
                else
                {
                    var nf = new NullFieldFilter()
                    {
                        ParamName = "@ParentID",
                        Null      = true
                    };

                    _paging.Fields["ParentID"].Filter = nf;
                }



                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["theme"] == null)
            {
                Response.Redirect("Voting.aspx");
            }
            lblHead.Text = VoiceService.GetVotingName(ThemeId);
            SetMeta(string.Format("{0} - {1} - {2}", SettingsMain.ShopName, lblHead.Text, lblSubHead.Text));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = "[Voice].[Answer]",
                        ItemsPerPage = 10
                    };

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field {Name = "AnswerID as ID", IsDistinct = true},
                        new Field {Name = "Name"},
                        new Field {Name = "CountVoice"},
                        new Field {Name = "Sort", Sorting = SortDirection.Ascending},
                        new Field {Name = "IsVisible"},
                        new Field {Name = "DateAdded"},
                        new Field {Name = "DateModify"},
                        new Field
                            {
                                Name = "FKIDTheme",
                                Filter = new EqualFieldFilter {ParamName = "@Theme", Value = ThemeId.ToString()}
                            }
                    });

                grid.ChangeHeaderImageUrl("arrowSort", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 35
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // load modalpopup for contact
                _paging = new SqlPaging { TableName = "[Catalog].[Product]", ItemsPerPage = 10 };

                var f = new Field { Name = "ProductID", IsDistinct = true };

                _paging.AddField(f);

                f = new Field { Name = "ArtNo" , Sorting=SortDirection.Ascending };

                _paging.AddField(f);

                f = new Field { Name = "Name" };
                _paging.AddField(f);

                agvProducts.ChangeHeaderImageUrl("arrowArtNo", "../images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Message.Visible = false;
            MsgErr(true);

            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resource.Admin_Discount_PriceRange_SubHeader));

            if (!IsPostBack)
            {
                chkModuleEnabled.Checked = AdvantShop.Configuration.SettingsOrderConfirmation.EnableDiscountModule;
            }


            if (!IsPostBack)
            {
                _paging = new SqlPaging {
                    TableName = "[Order].[OrderPriceDiscount]", ItemsPerPage = 10
                };

                var f = new Field {
                    Name = "OrderPriceDiscountID as ID"
                };

                //f.IsDistinct = True
                _paging.AddField(f);

                f = new Field {
                    Name = "PriceRange", Sorting = SortDirection.Ascending
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "PercentDiscount"
                };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowPriceRange", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)ViewState["Paging"];
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw new Exception("Paging lost");
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter {
                        IncludeValues = true
                    };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        string t = arrids[idx];
                        if (t != "-1")
                        {
                            ids[idx] = t;
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }
            }
        }
Ejemplo n.º 37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_CustomerGroup_Header);

        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "[Customers].[CustomerGroup]", ItemsPerPage = 10
            };

            var f = new Field {
                Name = "CustomerGroupId as ID", IsDistinct = true, Filter = _selectionFilter
            };
            _paging.AddField(f);

            f = new Field {
                Name = "GroupName", Sorting = SortDirection.Ascending
            };
            _paging.AddField(f);

            f = new Field {
                Name = "GroupDiscount"
            };
            _paging.AddField(f);

            grid.ChangeHeaderImageUrl("arrowGroupName", "images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];


            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                string[] arrids = strIds.Split(' ');

                var ids = new string[arrids.Length];
                _selectionFilter = new InSetFieldFilter {
                    IncludeValues = true
                };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    int t = int.Parse(arrids[idx]);
                    if (t != -1)
                    {
                        ids[idx] = t.ToString();
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                }

                _selectionFilter.Values = ids;
                //_InverseSelection = If(ids(0) = -1, True, False)
            }
        }
    }
Ejemplo n.º 38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Taxes_Header));

            var cats = new List<Category> { CategoryService.GetCategory(0) };
            Category[] rootCategories = cats.ToArray();
            CatalogDataTreeViewForTaxes.RootCategories = rootCategories;

            var taxIdStr = Request["taxid"];
            if (string.IsNullOrEmpty(taxIdStr))
            {
                Response.Redirect("Taxes.aspx", true);
                return;
            }
            int taxId;
            if (!Int32.TryParse(taxIdStr, out taxId))
            {
                Response.Redirect("Taxes.aspx", true);
                return;
            }

            CurrentTax = TaxServices.GetTax(taxId);

            Title = CurrentTax.Name;

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Catalog].[TaxRegionRate] JOIN [Customers].[Region] ON [TaxRegionRate].[RegionID] = [Region].[RegionID]", ItemsPerPage = 10 };

                var f = new Field { Name = "TaxID" };
                var ff = new EqualFieldFilter { ParamName = "@TaxID", Value = CurrentTax.TaxId.ToString(CultureInfo.InvariantCulture) };
                f.Filter = ff;

                _paging.AddField(f);

                f = new Field { Name = "RegionName", Sorting = SortDirection.Ascending };
                _paging.AddField(f);
                grid.ChangeHeaderImageUrl("arrowName", f.Sorting == SortDirection.Ascending ? "images/arrowup.gif" : "images/arrowdown.gif");

                f = new Field { Name = "RegionRate" };
                _paging.AddField(f);

                f = new Field { Name = "[Catalog].[TaxRegionRate].RegionID as RegionID" };
                _paging.AddField(f);

                _paging.CurrentPageIndex = 1;

                ViewState["Paging"] = _paging;

                ddlDependsOnAddress.Items.Add(new ListItem(Resources.Resource.Admin_Taxes_DefaultAddress, ((int)TypeRateDepends.Default).ToString(CultureInfo.InvariantCulture)));
                ddlDependsOnAddress.Items.Add(new ListItem(Resources.Resource.Admin_Taxes_ShippingAddress, ((int)TypeRateDepends.ByShippingAddress).ToString(CultureInfo.InvariantCulture)));
                ddlDependsOnAddress.Items.Add(new ListItem(Resources.Resource.Admin_Taxes_BillingAddress, ((int)TypeRateDepends.ByBillingAddress).ToString(CultureInfo.InvariantCulture)));
                ddlDependsOnAddress.SelectedValue = ((int)CurrentTax.DependsOnAddress).ToString(CultureInfo.InvariantCulture);

                ddlRateType.Items.Add(new ListItem(Resources.Resource.Admin_Taxes_Fixed, ((int)RateType.LumpSum).ToString(CultureInfo.InvariantCulture)));
                ddlRateType.Items.Add(new ListItem(Resources.Resource.Admin_Taxes_Proportional, ((int)RateType.Proportional).ToString(CultureInfo.InvariantCulture)));
                ddlRateType.SelectedValue = ((int)CurrentTax.Type).ToString(CultureInfo.InvariantCulture);

                ddlCountry.DataSource = CountryService.GetAllCountries();
                DataBind();

                ddlCountry.SelectedValue = CurrentTax.CountryID.ToString(CultureInfo.InvariantCulture);
                ddlCountry_SelectedIndexChanged(ddlCountry, e);
                chkEnabled.Checked = CurrentTax.Enabled;
            }
            else
            {
                _paging = (SqlPaging)ViewState["Paging"];
            }
        }
Ejemplo n.º 39
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_MasterPageAdminCatalog_Catalog));

            Category cat = null;

            if (!string.IsNullOrEmpty(Request["categoryid"]))
            {
                if (Request["categoryid"].ToLower().Equals("WithoutCategory".ToLower()))
                {
                    ShowMethod = EShowMethod.OnlyWithoutCategories;
                }
                else if (Request["categoryid"].ToLower().Equals("InCategories".ToLower()))
                {
                    ShowMethod = EShowMethod.OnlyInCategories;
                }
                else if (Request["categoryid"].ToLower().Equals("AllProducts".ToLower()))
                {
                    ShowMethod = EShowMethod.AllProducts;
                }
                else
                {
                    ShowMethod = EShowMethod.Normal;
                    int.TryParse(Request["categoryid"], out CategoryId);
                    cat = CategoryService.GetCategory(CategoryId);
                    adminCategoryView.CategoryID = CategoryId;
                }
            }
            else
            {
                CategoryId = 0;
                ShowMethod = EShowMethod.Normal;
            }

            if (cat == null)
            {
                CategoryId = 0;
                if (ShowMethod == EShowMethod.Normal)
                {
                    ShowMethod = EShowMethod.AllProducts;
                    ShowMethod = EShowMethod.Normal;
                }
            }
            else
            {
                CategoryId = cat.CategoryId;
                lblCategoryName.Text = cat.Name;
                ConfirmButtonExtenderCategory.ConfirmText =
                    string.Format(Resource.Admin_MasterPageAdminCatalog_Confirmation, cat.Name);
            }

            hlEditCategory.NavigateUrl = "javascript:open_window(\'m_Category.aspx?CategoryID=" + CategoryId + "&mode=edit\', 750, 640)";

            if (!IsPostBack)
            {
                var node2 = new TreeNode { Text = Resource.Admin_m_Category_Root, Value = "0", Selected = true };
                tree2.Nodes.Add(node2);

                LoadChildCategories2(tree2.Nodes[0]);

                _paging = new SqlPaging()
                    {
                        ItemsPerPage = 10,
                    };

                switch (ShowMethod)
                {
                    case EShowMethod.AllProducts:
                        lblCategoryName.Text = Resource.Admin_Catalog_AllProducts;
                        _paging.TableName =
                            "[Catalog].[Product] left JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] and [Offer].[Main] = 1 LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId]  and Type='Product' AND [Photo].[Main] = 1 LEFT JOIN [Catalog].[ProductCategories] ON [Catalog].[ProductCategories].[ProductID] = [Product].[ProductID]";
                        break;

                    case EShowMethod.OnlyInCategories:
                        lblCategoryName.Text = Resource.Admin_Catalog_AllProductsInCategories;
                        _paging.TableName =
                            "[Catalog].[Product] left JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] and [Offer].[Main] = 1 LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId] and Type='Product' AND [Photo].[Main] = 1 inner JOIN [Catalog].[ProductCategories] ON [Catalog].[ProductCategories].[ProductID] = [Product].[ProductID]";
                        break;

                    case EShowMethod.OnlyWithoutCategories:
                        lblCategoryName.Text = Resource.Admin_Catalog_AllProductsWithoutCategories;
                        _paging.TableName =
                            "[Catalog].[Product] inner join (select ProductId from Catalog.Product where ProductId not in(Select ProductId from Catalog.ProductCategories)) as tmp on tmp.ProductId=[Product].[ProductID] Left JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId]  and Type='Product' AND [Photo].[Main] = 1";
                        break;

                    case EShowMethod.Normal:
                        _paging.TableName =
                            "[Catalog].[Product] left JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] and [Offer].[Main] = 1 LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId] and Type='Product' AND [Photo].[Main] = 1 INNER JOIN Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID]";
                        break;
                }

                _paging.AddFieldsRange(new List<Field>()
                    {
                        new Field {Name = "Product.ProductID as ID", IsDistinct = true},

                        new Field {Name = "Product.ArtNo", Sorting = ShowMethod!= EShowMethod.Normal ? SortDirection.Ascending : (SortDirection?)null},
                        new Field {Name = "PhotoName"},
                        new Field {Name = "(Select Count(ProductID) From Catalog.ProductCategories Where ProductID=Product.ProductID) as ProductCategoriesCount"},
                        new Field {Name = "BriefDescription"},
                        new Field {Name = "Name"},
                        new Field {Name = "Price"},
                        new Field {Name = "(Select sum (Amount) from catalog.Offer where Offer.ProductID=Product.productID) as Amount"},
                        new Field {Name = "Enabled"},
                        new Field
                            {
                                Name = ShowMethod == EShowMethod.Normal ? "ProductCategories.SortOrder" : "-1 as SortOrder",
                                Sorting = SortDirection.Ascending
                            },
                        new Field {Name = "Offer.ColorID", NotInQuery = true},
                        new Field {Name = "Offer.SizeID", NotInQuery = true}
                    });

                if (ShowMethod == EShowMethod.Normal)
                {
                    _paging.AddField(new Field
                        {
                            Name = "ProductCategories.CategoryID",
                            NotInQuery = true,
                            Filter = new EqualFieldFilter
                                {
                                    Value = CategoryId.ToString(),
                                    ParamName = "@CategoryID"
                                }
                        });

                    grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");
                }
                else
                {
                    grid.ChangeHeaderImageUrl("arrowArtNo", "images/arrowup.gif");
                }

                pageNumberer.CurrentPageIndex = 1;
                pnlProducts.Visible = CategoryId != 0 || ShowMethod != EShowMethod.Normal;
                productsHeader.Visible = ShowMethod == EShowMethod.Normal;
                adminCategoryView.Visible = ShowMethod == EShowMethod.Normal;
                grid.Columns[9].Visible = ShowMethod == EShowMethod.Normal;

                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;

                if (Request["search"].IsNotEmpty())
                {
                    var product = ProductService.GetProduct(Request["search"]);
                    if (product != null)
                    {
                        Response.Redirect("Product.aspx?productID=" + product.ID);
                        return;
                    }

                    if (
                        ProductService.GetProductsCount("where name like '%' + @search + '%'",
                                                        new SqlParameter("@search", Request["search"])) >
                        ProductService.GetProductsCount("where artno like '%' + @search + '%'",
                                                        new SqlParameter("@search", Request["search"])))
                    {
                        txtName.Text = Request["search"];
                    }
                    else
                    {
                        txtArtNo.Text = Request["search"];
                    }
                    btnFilter_Click(null, null);
                }

                if (Request["colorId"].IsNotEmpty())
                {
                    var color = ColorService.GetColor(Request["colorId"].TryParseInt());
                    if (color != null)
                    {
                        lblCategoryName.Text += string.Format(" {0}: {1}", Resource.Admin_Catalog_Color, color.ColorName);
                        _paging.Fields["Offer.ColorID"].Filter = new EqualFieldFilter { ParamName = "@colorId", Value = Request["colorId"] };
                    }
                }

                if (Request["sizeid"].IsNotEmpty())
                {
                    var size = SizeService.GetSize(Request["sizeid"].TryParseInt());
                    if (size != null)
                    {
                        lblCategoryName.Text += string.Format(" {0}: {1}", Resource.Admin_Catalog_Size, size.SizeName);
                        _paging.Fields["Offer.SizeID"].Filter = new EqualFieldFilter { ParamName = "@sizeId", Value = Request["sizeId"] };
                    }
                }
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    var arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    _selectionFilterCategories = new InSetFieldFilter { IncludeValues = true };

                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        string t = arrids[idx];
                        var idParts = t.Split('_');
                        switch (idParts[0])
                        {
                            case "Product":
                                if (idParts[1] != "-1")
                                {
                                    ids[idx] = idParts[1];
                                }
                                else
                                {
                                    _selectionFilter.IncludeValues = false;
                                    _inverseSelection = true;
                                }
                                break;
                            case "Category":
                                if (idParts[1] != "-1")
                                {
                                    _selectedCategories.Add(idParts[1]);
                                }
                                else
                                {
                                    _selectionFilterCategories.IncludeValues = false;
                                    _inverseSelection = true;
                                }
                                break;
                            default:
                                _inverseSelection = true;
                                break;
                        }
                    }
                    _selectionFilter.Values = ids.Distinct().Where(item => item != null).ToArray();
                    _selectionFilterCategories.Values = _selectedCategories.ToArray();
                }
            }
        }
Ejemplo n.º 40
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _paging = new SqlPaging
                {
                    TableName =
                        "[Catalog].[Product] LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] inner join Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] Left JOIN [Catalog].[ProductPropertyValue] ON [Product].[ProductID] = [ProductPropertyValue].[ProductID] LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferID] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId"
                };
            _paging.AddFieldsRange(
                new List<Field>
                    {
                        new Field {Name = "[Product].[ProductID]", IsDistinct = true},
                        //new Field {Name = "PhotoName AS Photo"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"},

                        new Field {Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"},
                        //new Field {Name = "[Photo].[Description] AS PhotoDesc"},
                        new Field {Name = "[ProductCategories].[CategoryID]", NotInQuery=true},
                        new Field {Name = "BriefDescription"},
                        new Field {Name = "Product.ArtNo"},
                        new Field {Name = "Name"},
                        new Field {Name = "(CASE WHEN Price=0 THEN 0 ELSE 1 END) as TempSort", Sorting=SortDirection.Descending},
                        new Field {Name = "Recomended"},
                        new Field {Name = "Bestseller"},
                        new Field {Name = "New"},
                        new Field {Name = "OnSale"},
                        new Field {Name = "Discount"},
                        new Field {Name = "Offer.Main", NotInQuery=true},
                        new Field {Name = "Offer.OfferID"},
                        new Field {Name = "Offer.Amount"},
                        new Field {Name = "(CASE WHEN Offer.Amount=0 OR Offer.Amount < IsNull(MinAmount,0) THEN 0 ELSE 1 END) as TempAmountSort", Sorting=SortDirection.Descending},
                        new Field {Name = "MinAmount"},
                        new Field {Name = "MaxAmount"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "AllowPreOrder"},
                        new Field {Name = "Ratio"},
                        new Field {Name = "RatioID"},
                        new Field {Name = "DateModified"},
                        new Field {Name = "ShoppingCartItemId"},
                        new Field {Name = "UrlPath"},
                        new Field {Name = "[ProductCategories].[SortOrder]"},
                        new Field {Name = "[ShoppingCart].[CustomerID]", NotInQuery=true},
                        new Field {Name = "BrandID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Size_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Color_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Price_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ColorID"},
                        new Field {Name = "CategoryEnabled", NotInQuery=true},
                    });

            if (SettingsCatalog.ComplexFilter)
            {
                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field {Name = "(select max (price) - min (price) from catalog.offer where offer.productid=product.productid) as MultiPrices"},
                        new Field {Name = "(select min (price) from catalog.offer where offer.productid=product.productid) as Price"},
                    });
            }
            else
            {
                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field {Name = "0 as MultiPrices"},
                        new Field {Name = "Price"},
                    });
            }

            _paging.AddParam(new SqlParam { ParameterName = "@CustomerId", Value = CustomerSession.CustomerId.ToString() });
            _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.Product.ToString() });

            if (string.IsNullOrEmpty(Request["categoryid"]) || !Int32.TryParse(Request["categoryid"], out _categoryId))
            {
                _categoryId = 0;

                var sbMainPage = StaticBlockService.GetPagePartByKeyWithCache("MainPageSocial");
                if (sbMainPage != null && sbMainPage.Enabled)
                    MainPageText = sbMainPage.Content;
            }

            if (!string.IsNullOrEmpty(MainPageText))
            {
                SetMeta(null, string.Empty);
                return;
            }

            category = CategoryService.GetCategory(_categoryId);
            if (category == null || category.Enabled == false || category.ParentsEnabled == false)
            {
                Error404();
                return;
            }

            ProductsCount = category.GetProductCount();

            categoryView.CategoryID = _categoryId;
            categoryView.Visible = true;
            pnlSort.Visible = ProductsCount > 0;
            productView.Visible = ProductsCount > 0;

            lblCategoryName.Text = _categoryId != 0 ? category.Name : Resource.Client_MasterPage_Catalog;
            //lblCategoryDescription.Text = category.Description;

            //imgCategoryImage.ImageUrl = string.IsNullOrEmpty(category.Picture) ? "" : string.Format("{0}", ImageFolders.GetImageCategoryPath(false, category.Picture));

            breadCrumbs.Items =
                CategoryService.GetParentCategories(_categoryId).Select(parent => new BreadCrumbs
                    {
                        Name = parent.Name,
                        Url = "social/catalogsocial.aspx?categoryid=" + parent.CategoryId
                    }).Reverse().ToList();
            breadCrumbs.Items.Insert(0, new BreadCrumbs
                {
                    Name = Resource.Client_MasterPage_MainPage,
                    Url = UrlService.GetAbsoluteLink("social/catalogsocial.aspx")
                });

            SetMeta(category.Meta, category.Name);

            if (category.DisplayChildProducts)
            {
                var cfilter = new InChildCategoriesFieldFilter
                    {
                        CategoryId = _categoryId.ToString(),
                        ParamName = "@CategoryID"
                    };
                _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
            }
            else
            {
                var cfilter = new EqualFieldFilter { Value = _categoryId.ToString(), ParamName = "@catalog" };
                _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
            }

            _paging.Fields["Enabled"].Filter = new EqualFieldFilter { Value = "1", ParamName = "@enabled" }; ;
            _paging.Fields["CategoryEnabled"].Filter = new EqualFieldFilter { Value = "1", ParamName = "@CategoryEnabled" };

            var logicalFilter = new LogicalFilter { ParamName = "@Main", HideInCustomData = true };
            logicalFilter.AddFilter(new EqualFieldFilter { Value = "1", ParamName = "@Main1", HideInCustomData = true });
            logicalFilter.AddLogicalOperation("OR");
            logicalFilter.AddFilter(new NullFieldFilter { Null = true, ParamName = "@Main2", HideInCustomData = true });
            _paging.Fields["Offer.Main"].Filter = logicalFilter;

            BuildSorting();
        }
Ejemplo n.º 41
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Subscription_Header);

        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "[dbo].[SubscribeDeactivateReason]", ItemsPerPage = 10
            };

            var f = new Field {
                Name = "ID", IsDistinct = true, Filter = _selectionFilter
            };
            _paging.AddField(f);


            f = new Field {
                Name = "MessageText"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "AddDate", Sorting = SortDirection.Descending
            };
            _paging.AddField(f);

            grid.ChangeHeaderImageUrl("arrowAddDate", "images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            var strIds = Request.Form["SelectedIds"];

            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                var arrids = strIds.Split(' ');

                var ids = new string[arrids.Length];
                _selectionFilter = new InSetFieldFilter {
                    IncludeValues = true
                };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    int t = int.Parse(arrids[idx]);
                    if (t != -1)
                    {
                        ids[idx] = t.ToString(CultureInfo.InvariantCulture);
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                }

                _selectionFilter.Values = ids;
            }
        }
    }
Ejemplo n.º 42
0
    protected void btnDownload_Click(object sender, EventArgs e)
    {
        if (CommonStatistic.IsRun)
        {
            lError.Visible = true;
            lError.Text = Resource.Admin_Restrict_Action_In_demo;
            return;
        }
        var paging = new SqlPaging
            {
                TableName = "[Order].[Order]"
            };
        paging.AddField(new Field { Name = "*" });

        if (chkStatus.Checked)
        {
            paging.AddField(new Field { Name = "OrderStatusID", NotInQuery = true, Filter = new EqualFieldFilter { ParamName = "@OrderStatusID", Value = ddlStatus.SelectedValue } });
        }

        if (chkDate.Checked)
        {
            var filter = new DateTimeRangeFieldFilter { ParamName = "@RDate" };
            var dateFrom = txtDateFrom.Text.TryParseDateTime();

            if (dateFrom != DateTime.MinValue)
                filter.From = dateFrom;

            var dateTo = txtDateTo.Text.TryParseDateTime();
            if (dateTo != DateTime.MinValue)
                filter.To = dateTo.AddDays(1) ;
            paging.AddField(new Field { Name = "OrderDate", NotInQuery = true, Filter = filter });
        }
        var ordersCount = paging.TotalRowsCount;

        if (ordersCount == 0) return;
        CommonStatistic.Init();
        CommonStatistic.IsRun = true;
        CommonStatistic.CurrentProcess = Request.Url.PathAndQuery;
        CommonStatistic.CurrentProcessName = Resource.Admin_ExportOrdersExcel_DownloadOrders;
        CommonStatistic.TotalRow = ordersCount;

        linkCancel.Visible = true;
        OutDiv.Visible = true;
        btnDownload.Visible = false;
        pnSearch.Visible = false;
        try
        {
            // Directory
            if (!Directory.Exists(_strFilePath))
                Directory.CreateDirectory(_strFilePath);

            var tr = new Thread(Save);
            CommonStatistic.ThreadImport = tr;
            tr.Start(paging);
        }
        catch (Exception ex)
        {
            //Debug.LogError(ex, sender, e);
            Debug.LogError(ex);
            lError.Text = ex.Message;
            lError.Visible = true;
            CommonStatistic.IsRun = false;
        }
    }
Ejemplo n.º 43
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resources.Resource.Admin_Brands_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                    {
                        TableName = "[Catalog].[Brand] left join Catalog.Photo on Photo.ObjId = Brand.BrandID and Type = @Type ",
                        ItemsPerPage = 10
                    };

                _paging.AddFieldsRange(new List<Field>
                    {
                        new Field
                            {
                                Name = "BrandID as ID",
                                IsDistinct = true
                            },
                        new Field {Name = "ProductsCount", SelectExpression="(Select Count(ProductID) from Catalog.Product Where Product.BrandID=Brand.BrandID) as ProductsCount"},
                        new Field {Name = "PhotoName as BrandLogo"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "SortOrder", Sorting = SortDirection.Ascending},
                        new Field {Name = "BrandName", Sorting=SortDirection.Ascending}
                    });
                _paging.AddParam(new SqlParam { Value = PhotoType.Brand.ToString(), ParameterName = "@Type" });
                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 44
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Carousels_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging {
                    TableName = "[CMS].[Carousel] left join Catalog.Photo on Photo.ObjId=Carousel.CarouselID and Type=@Type", ItemsPerPage = 10
                };

                var f = new Field {
                    Name = "CarouselID as ID", IsDistinct = true, Filter = _selectionFilter
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "URL"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "SortOrder", Sorting = SortDirection.Ascending
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "Enabled"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "PhotoName"
                };
                _paging.AddField(f);

                f = new Field {
                    Name = "Description"
                };
                _paging.AddField(f);

                _paging.AddParam(new SqlParam {
                    ParameterName = "@Type", Value = PhotoType.Carousel.ToString()
                });

                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;

                txtSortedCarousel.Text = CarouselService.GetMaxSortOrder().ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];


                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length];
                    _selectionFilter = new InSetFieldFilter {
                        IncludeValues = true
                    };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                    //_InverseSelection = If(ids(0) = -1, True, False)
                }
            }
        }
Ejemplo n.º 45
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["type"]))
        {
            if (!string.IsNullOrEmpty(Request["type"]))
            {
                Enum.TryParse(Request["type"], true, out _typeFlag);
                //_typeFlag = (ProductOnMain.TypeFlag)Enum.Parse(typeof(ProductOnMain.TypeFlag), Request["type"], true);
            }
        }

        switch (_typeFlag)
        {
        case ProductOnMain.TypeFlag.Bestseller:
            lblHead.Text = Resources.Resource.Admin_UserControls_MainPageProduct_Bestseller;
            break;

        case ProductOnMain.TypeFlag.New:
            lblHead.Text = Resources.Resource.Admin_UserControls_MainPageProduct_New;
            break;

        case ProductOnMain.TypeFlag.Discount:
            lblHead.Text = Resources.Resource.Admin_UserControls_MainPageProduct_Discount;
            break;
        }

        MainPageProductNew.LoadData();
        MainPageProductOnSale.LoadData();
        MainPageProductBestseller.LoadData();


        Page.Title = string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, "None");

        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "[Catalog].[Product]", ItemsPerPage = 20
            };

            var f = new Field {
                Name = "Product.ProductId as ID"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "ArtNo"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "Name"
            };
            _paging.AddField(f);

            if (_typeFlag == ProductOnMain.TypeFlag.Bestseller)
            {
                f = new Field {
                    Name = "Bestseller"
                };
                var filterB = new EqualFieldFilter {
                    ParamName = "@Bestseller", Value = "1"
                };
                f.Filter = filterB;
                _paging.AddField(f);

                _paging.AddField(new Field {
                    Name = "SortBestseller as Sort", Sorting = SortDirection.Ascending
                });
            }

            if (_typeFlag == ProductOnMain.TypeFlag.New)
            {
                f = new Field {
                    Name = "New"
                };
                var filterN = new EqualFieldFilter {
                    ParamName = "@New", Value = "1"
                };
                f.Filter = filterN;
                _paging.AddField(f);

                _paging.AddField(new Field {
                    Name = "SortNew as Sort", Sorting = SortDirection.Ascending
                });
            }

            if (_typeFlag == ProductOnMain.TypeFlag.Discount)
            {
                f = new Field {
                    Name = "Discount"
                };
                var filterN = new NotEqualFieldFilter()
                {
                    ParamName = "@Discount", Value = "0"
                };
                f.Filter = filterN;
                _paging.AddField(f);

                _paging.AddField(new Field {
                    Name = "SortDiscount as Sort", Sorting = SortDirection.Ascending
                });
                btnAddProduct.Visible = false;
            }

            grid.ChangeHeaderImageUrl("arrowSort", "images/arrowup.gif");

            _paging.ItemsPerPage = 20;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];


            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                string[] arrids = strIds.Split(' ');

                var ids = new string[arrids.Length];
                _selectionFilter = new InSetFieldFilter {
                    IncludeValues = true
                };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    int t = int.Parse(arrids[idx]);
                    if (t != -1)
                    {
                        ids[idx] = t.ToString();
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                }
                _selectionFilter.Values = ids;
            }
        }
    }
Ejemplo n.º 46
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _paging = new SqlPaging
                {
                    TableName =
                        "[Catalog].[Product] LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] LEFT JOIN [Catalog].[Photo] ON [Product].[ProductID] = [Photo].[ObjId] and Type='Product' AND Photo.[Main] = 1 inner join Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] Left JOIN [Catalog].[ProductPropertyValue] ON [Product].[ProductID] = [ProductPropertyValue].[ProductID] LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferId] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId"
                };
            _paging.AddParam(new SqlParam { ParameterName = "@CustomerId", Value = CustomerSession.CustomerId.ToString() });
            _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.Product.ToString() });

            _paging.AddFieldsRange(
                new List<Field>
                    {
                       new Field {Name = "[Product].[ProductID]", IsDistinct = true},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"},
                        new Field {Name = "[ProductCategories].[CategoryID]", NotInQuery=true},
                        new Field {Name = "BriefDescription"},
                        new Field {Name = "Product.ArtNo"},
                        new Field {Name = "Name"},

                        new Field {Name = "Recomended"},
                        new Field {Name = "Bestseller"},
                        new Field {Name = "New"},
                        new Field {Name = "OnSale"},
                        new Field {Name = "Discount"},
                        new Field {Name = "Offer.Main", NotInQuery=true},
                        new Field {Name = "Offer.OfferID"},
                        new Field {Name = "Offer.Amount"},
                        new Field {Name = "(CASE WHEN Offer.Amount=0 OR Offer.Amount < IsNull(MinAmount,0) THEN 0 ELSE 1 END) as TempAmountSort", Sorting=SortDirection.Descending},
                        new Field {Name = "MinAmount"},
                        new Field {Name = "MaxAmount"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "AllowPreOrder"},
                        new Field {Name = "Ratio"},
                        new Field {Name = "RatioID"},
                        new Field {Name = "DateModified"},
                        new Field {Name = "ShoppingCartItemId"},
                        new Field {Name = "UrlPath"},

                        new Field {Name = "[ShoppingCart].[CustomerID]", NotInQuery=true},
                        new Field {Name = "BrandID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Size_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Color_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ProductID as Price_ProductID", NotInQuery=true},
                        new Field {Name = "Offer.ColorID"},
                        new Field {Name = "CategoryEnabled", NotInQuery=true},
                        new Field {Name = "null as AdditionalPhoto"}
                    });

            if (SettingsCatalog.ComplexFilter)
            {
                _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"},
                    new Field {Name = "(select max (price) - min (price) from catalog.offer where offer.productid=product.productid) as MultiPrices"},
                    new Field {Name = "(select min (price) from catalog.offer where offer.productid=product.productid) as Price"},
                });
            }
            else
            {
                _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "null as Colors"},
                    new Field {Name = "0 as MultiPrices"},
                    new Field {Name = "Price"},
                });
            }

            _paging.Fields["[Product].[ProductID]"].Filter = new CountProductInCategory();
            _paging.Fields["Enabled"].Filter = new EqualFieldFilter { ParamName = "@enabled", Value = "1" };
            _paging.Fields["CategoryEnabled"].Filter = new EqualFieldFilter { ParamName = "@CategoryEnabled", Value = "1" };

            BuildSorting();
            BuildFilter();

            SetMeta(null, string.Empty);
            txtName.Focus();
        }
Ejemplo n.º 47
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_Coupons_Header);

        if (!IsPostBack)
        {
            _paging = new SqlPaging
            {
                TableName    = "[Catalog].[Coupon]",
                ItemsPerPage = 10
            };

            _paging.AddFieldsRange(new List <Field>
            {
                new Field
                {
                    Name       = "CouponID as ID",
                    IsDistinct = true
                },
                new Field {
                    Name = "Code"
                },
                new Field {
                    Name = "Type"
                },
                new Field {
                    Name = "Value"
                },
                new Field {
                    Name = "AddingDate", Sorting = SortDirection.Descending
                },
                new Field {
                    Name = "ExpirationDate"
                },
                new Field {
                    Name = "PossibleUses"
                },
                new Field {
                    Name = "ActualUses"
                },
                new Field {
                    Name = "Enabled"
                },
                new Field {
                    Name = "MinimalOrderPrice"
                },
            });

            grid.ChangeHeaderImageUrl("arrowAddingDate", "images/arrowdown.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];

            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                string[] arrids = strIds.Split(' ');

                _selectionFilter = new InSetFieldFilter();
                if (arrids.Contains("-1"))
                {
                    _selectionFilter.IncludeValues = false;
                    _inverseSelection = true;
                }
                else
                {
                    _selectionFilter.IncludeValues = true;
                }
                _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
            }
        }
    }
Ejemplo n.º 48
0
 protected void Page_Load(object sender, EventArgs e)
 {
     StatusId = Request["orderstatusid"].TryParseInt();
     if (!IsPostBack)
     {
         LoadOrders(StatusId, Request["page"].TryParseInt(1));
         lblTotalOrdersCount.Text = StatisticService.GetOrdersCount().ToString();
     }
     else
     {
         _paging = (SqlPaging) (ViewState["Paging"]);
     }
 }
Ejemplo n.º 49
0
    protected void Page_Load(object sender, EventArgs e)
    {
        divSave.Visible = false;
        grid.ResetToDefaultValueOnRowEditCancel = false;

        Page.Title = string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_m_CategorySortOrder_Title);

        if (!IsPostBack)
        {
            var root = new TreeNode {
                Text = Resource.Admin_m_CategorySortOrder_Root, Value = @"0", Selected = true
            };
            tree.Nodes.Add(root);
            LoadChildCategories(tree.Nodes[0]);
        }

        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "Catalog.Category"
            };

            var f = new Field {
                Name = "CategoryID", IsDistinct = true
            };
            var ifilter = new NotEqualFieldFilter {
                Value = "0", ParamName = "@id"
            };
            f.Filter = ifilter;
            _paging.AddField(f);


            f = new Field {
                Name = "Name"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "SortOrder", Sorting = SortDirection.Ascending
            };
            _paging.AddField(f);

            f = new Field {
                Name = "ParentCategory"
            };
            var pfilter = new EqualFieldFilter {
                Value = hfParent.Value, ParamName = "@CategoryID"
            };
            f.Filter = pfilter;
            _paging.AddField(f);
            grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);

            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);


            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            string strIds = String.Empty;
            if(!Page.IsPostBack)
            {
                if (SelectedProducts != null && SelectedProducts.Count != 0)
                {
                    prevSelected =
                        SelectedProducts.Select(s => s.ToString()).Aggregate(
                            (prev, next) => prev.ToString() + " " + next.ToString());
                    strIds = prevSelected;
                }
            }
            else
            {
                strIds = Request.Form["SelectedIds"];
            }

            string[] ids;

            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                var arrids = strIds.Split(' ');

                ids = new string[arrids.Length ];
                _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    var t = arrids[idx];
                    if (t != "-1")
                    {
                        ids[idx] = t;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                    }
                }

                _selectionFilter.Values = ids;
            }

            if (!IsPostBack)
            {
                // load modalpopup for contact
                _paging = new SqlPaging { TableName = "[Catalog].[Product]", ItemsPerPage = 10 };

                var f = new Field { Name = "ProductID", IsDistinct = true };

                _paging.AddField(f);

                f = new Field { Name = "ArtNo", Sorting = SortDirection.Ascending};

                _paging.AddField(f);

                f = new Field { Name = "Name" };
                _paging.AddField(f);

                agvProducts.ChangeHeaderImageUrl("arrowArtNo", "../images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }
            }
        }
Ejemplo n.º 51
0
    //public event Action<object, PhotoMessageEventArgs> PhotoMessage;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            _paging = new SqlPaging {
                TableName = "[Catalog].[Photo]", ItemsPerPage = 10
            };

            var f = new Field {
                Name = "PhotoID as ID", IsDistinct = true, Filter = _selectionFilter
            };
            _paging.AddField(f);

            f = new Field
            {
                Name   = "ObjId",
                Filter = new EqualFieldFilter
                {
                    ParamName = "@ObjId",
                    Value     = ProductID.ToString()
                }
            };
            _paging.AddField(f);


            f = new Field {
                Name = "PhotoName"
            };
            _paging.AddField(f);


            f = new Field {
                Name = "Description"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "PhotoSortOrder", Sorting = SortDirection.Ascending
            };
            _paging.AddField(f);

            f = new Field {
                Name = "Main"
            };
            _paging.AddField(f);

            f = new Field {
                Name = "Type", NotInQuery = true, Filter = new EqualFieldFilter {
                    ParamName = "@Type", Value = PhotoType.Product.ToString()
                }
            };
            _paging.AddField(f);

            grid.ChangeHeaderImageUrl("arrowPhotoSortOrder", "~/admin/images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);
            _paging.ItemsPerPage = Convert.ToInt32(ddRowsPerPage.SelectedValue);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }

            string strIds = Request.Form["SelectedIds"];


            if (!string.IsNullOrEmpty(strIds))
            {
                strIds = strIds.Trim();
                string[] arrids = strIds.Split(' ');

                var ids = new string[arrids.Length];
                _selectionFilter = new InSetFieldFilter {
                    IncludeValues = true
                };
                for (int idx = 0; idx <= ids.Length - 1; idx++)
                {
                    int t = int.Parse(arrids[idx]);
                    if (t != -1)
                    {
                        ids[idx] = t.ToString();
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                }

                _selectionFilter.Values = ids;
                //_InverseSelection = If(ids(0) = -1, True, False)
            }
        }
    }
Ejemplo n.º 52
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_CustomerGroup_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Customers].[CustomerGroup]", ItemsPerPage = 10 };

                var f = new Field { Name = "CustomerGroupId as ID", IsDistinct = true, Filter = _selectionFilter };
                _paging.AddField(f);

                f = new Field { Name = "GroupName", Sorting = SortDirection.Ascending };
                _paging.AddField(f);

                f = new Field { Name = "GroupDiscount" };
                _paging.AddField(f);

                grid.ChangeHeaderImageUrl("arrowGroupName", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length ];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                    //_InverseSelection = If(ids(0) = -1, True, False)
                }
            }
        }
Ejemplo n.º 53
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_NewsAdmin_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName    = "[Settings].[News]",
                    ItemsPerPage = 20
                };

                _paging.AddFieldsRange(new List <Field>
                {
                    new Field
                    {
                        Name       = "NewsID as ID",
                        IsDistinct = true
                    },
                    new Field {
                        Name = "Title"
                    },
                    new Field {
                        Name = "ShowOnMainPage"
                    },
                    new Field {
                        Name = "NewsCategoryID"
                    },
                    new Field {
                        Name = "AddingDate", Sorting = SortDirection.Descending
                    }
                });

                grid.ChangeHeaderImageUrl("arrowAddingDate", "images/arrowdown.gif");

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }


            var modules = AttachedModules.GetModules <ISendMails>();


            foreach (var moduleType in modules)
            {
                var moduleObject = (ISendMails)Activator.CreateInstance(moduleType, null);
                if (ModulesRepository.IsActiveModule(moduleObject.ModuleStringId))
                {
                    CanSendNews = true;
                }
            }
        }
Ejemplo n.º 54
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(Request["categoryid"]) || !Int32.TryParse(Request["categoryid"], out _categoryId))
        {
            Error404();
        }

        Category = CategoryService.GetCategory(_categoryId);
        if (Category == null || Category.Enabled == false || Category.ParentsEnabled == false)
        {
            Error404();
            return;
        }

        Indepth = Request["indepth"] == "1" || Category.DisplayChildProducts;

        _priceField = CustomerSession.CurrentCustomer.PriceType.ToString();

        _paging = new SqlPaging
            {
                TableName =
                    "[Catalog].[Product] " +
                    "LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] " +
                    "inner join Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] " +
                    "Left JOIN [Catalog].[ProductPropertyValue] ON [Product].[ProductID] = [ProductPropertyValue].[ProductID] " +
                    "LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferID] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId " +
                    "Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId " +
                    "LEFT JOIN [Customers].[LastPrice] ON [LastPrice].[ProductId] = [Product].[ProductId] AND [LastPrice].[CustomerId] = @CustomerId"
            };

        _paging.AddFieldsRange(
           new List<Field>
                {
                    new Field {Name = "[Product].[ProductID]", IsDistinct = true},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"},
                    new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"},
                    new Field {Name = "[ProductCategories].[CategoryID]", NotInQuery=true},
                    new Field {Name = "BriefDescription"},
                    new Field {Name = "Product.ArtNo"},
                    new Field {Name = "Name"},
                    new Field {Name = string.Format("(CASE WHEN {0}=0 THEN 0 ELSE 1 END) as TempSort", _priceField), Sorting=SortDirection.Descending},
                    new Field {Name = "Recomended"},
                    new Field {Name = "Bestseller"},
                    new Field {Name = "New"},
                    new Field {Name = "OnSale"},
                    new Field {Name = "Discount"},
                    new Field {Name = "Offer.Main", NotInQuery=true},
                    new Field {Name = "Offer.OfferID"},
                    new Field {Name = "(Select Max(Offer.Amount) from catalog.Offer Where ProductId=[Product].[ProductID]) as Amount"},
                    new Field {Name = "(CASE WHEN (Select Max(Offer.Amount) from catalog.Offer Where ProductId=[Product].[ProductID])  <= 0 OR (Select Max(Offer.Amount) from catalog.Offer Where ProductId=[Product].[ProductID]) < IsNull(MinAmount,0) THEN 0 ELSE 1 END) as TempAmountSort", Sorting=SortDirection.Descending},
                    new Field {Name = "MinAmount"},
                    new Field {Name = "MaxAmount"},
                    new Field {Name = "Multiplicity"},
                    new Field {Name = "Enabled"},
                    new Field {Name = "AllowPreOrder"},
                    new Field {Name = "Ratio"},
                    new Field {Name = "RatioID"},
                    new Field {Name = "DateModified"},
                    new Field {Name = "ShoppingCartItemId"},
                    new Field {Name = "UrlPath"},
                    new Field {Name = !Indepth ? "[ProductCategories].[SortOrder]" : "0 as SortOrder"},
                    new Field {Name = "[ShoppingCart].[CustomerID]", NotInQuery=true},
                    new Field {Name = "BrandID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Size_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Color_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ProductID as Price_ProductID", NotInQuery=true},
                    new Field {Name = "Offer.ColorID"},
                    new Field {Name = "CategoryEnabled", NotInQuery=true},
                });

        if (SettingsCatalog.ComplexFilter)
        {
            _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"},
                    new Field {Name = string.Format("(select max ({0}) - min ({0}) from catalog.offer where offer.productid=product.productid) as MultiPrices", _priceField)},
                    new Field {Name = string.Format("(select min ({0}) from catalog.offer where offer.productid=product.productid) as Price", _priceField)},
                });
        }
        else
        {
            _paging.AddFieldsRange(new List<Field>
                {
                    new Field {Name = "null as Colors"},
                    new Field {Name = "0 as MultiPrices"},
                    new Field
                    {
                        Name = SettingsCatalog.UseLastPrice
                            ? string.Format("(CASE WHEN ProductPrice IS NULL THEN {0} ELSE ProductPrice END) as Price", _priceField)
                            : string.Format("{0} as Price", _priceField)
                    },
                });
        }

        _paging.AddParam(new SqlParam { ParameterName = "@CustomerId", Value = CustomerSession.CustomerId.ToString() });
        _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.Product.ToString() });

        ProductsCount = Indepth ? Category.TotalProductsCount : Category.GetProductCount();

        categoryView.CategoryID = _categoryId;
        categoryView.Visible = Category.DisplayStyle == "True" || ProductsCount == 0;
        pnlSort.Visible = ProductsCount > 0;
        productView.Visible = ProductsCount > 0;
        catalogView.CategoryID = _categoryId;

        filterProperty.CategoryId = _categoryId;

        filterBrand.CategoryId = _categoryId;
        filterBrand.InDepth = Indepth;

        filterSize.CategoryId = _categoryId;
        filterSize.InDepth = Indepth;

        filterColor.CategoryId = _categoryId;
        filterColor.InDepth = Indepth;

        filterPrice.CategoryId = _categoryId;
        filterPrice.InDepth = Indepth;

        filterPrice.PriceType = CustomerSession.CurrentCustomer.PriceType;

        lblCategoryName.Text = _categoryId != 0 ? Category.Name : Resource.Client_MasterPage_Catalog;

        breadCrumbs.Items =
            CategoryService.GetParentCategories(_categoryId).Select(parent => new BreadCrumbs
                                                                                  {
                                                                                      Name = parent.Name,
                                                                                      Url = UrlService.GetLink(ParamType.Category, parent.UrlPath, parent.CategoryId)
                                                                                  }).Reverse().ToList();
        breadCrumbs.Items.Insert(0, new BreadCrumbs
                                        {
                                            Name = Resource.Client_MasterPage_MainPage,
                                            Url = UrlService.GetAbsoluteLink("/")
                                        });

        var categoryMeta = SetMeta(Category.Meta, Category.Name, page: paging.CurrentPage);
        lblCategoryName.Text = categoryMeta.H1;

        if (Category.DisplayChildProducts || Indepth)
        {
            var cfilter = new InChildCategoriesFieldFilter
                              {
                                  CategoryId = _categoryId.ToString(),
                                  ParamName = "@CategoryID"
                              };
            _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
        }
        else
        {
            var cfilter = new EqualFieldFilter { Value = _categoryId.ToString(), ParamName = "@catalog" };
            _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
        }

        _paging.Fields["Enabled"].Filter = new EqualFieldFilter { Value = "1", ParamName = "@enabled" };
        _paging.Fields["CategoryEnabled"].Filter = new EqualFieldFilter { Value = "1", ParamName = "@CategoryEnabled" };

        var logicalFilter = new LogicalFilter{ ParamName = "@Main", HideInCustomData = true };
        logicalFilter.AddFilter(new EqualFieldFilter {Value = "1", ParamName = "@Main1", HideInCustomData = true});
        logicalFilter.AddLogicalOperation("OR");
        logicalFilter.AddFilter(new NullFieldFilter { Null = true, ParamName = "@Main2", HideInCustomData = true });
        _paging.Fields["Offer.Main"].Filter = logicalFilter;

        BuildSorting();
        BuildFilter();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string strIds = String.Empty;

        if (!Page.IsPostBack)
        {
            if (SelectedProducts != null && SelectedProducts.Count != 0)
            {
                prevSelected =
                    SelectedProducts.Select(s => s.ToString()).Aggregate(
                        (prev, next) => prev.ToString() + " " + next.ToString());
                strIds = prevSelected;
            }
        }
        else
        {
            strIds = Request.Form["SelectedIds"];
        }


        string[] ids;

        if (!string.IsNullOrEmpty(strIds))
        {
            strIds = strIds.Trim();
            var arrids = strIds.Split(' ');

            ids = new string[arrids.Length];
            _selectionFilter = new InSetFieldFilter {
                IncludeValues = true
            };
            for (int idx = 0; idx <= ids.Length - 1; idx++)
            {
                var t = arrids[idx];
                if (t != "-1")
                {
                    ids[idx] = t;
                }
                else
                {
                    _selectionFilter.IncludeValues = false;
                }
            }

            _selectionFilter.Values = ids;
        }


        if (!IsPostBack)
        {
            // load modalpopup for contact
            _paging = new SqlPaging {
                TableName = "[Catalog].[Product]", ItemsPerPage = 10
            };

            var f = new Field {
                Name = "ProductID", IsDistinct = true
            };

            _paging.AddField(f);

            f = new Field {
                Name = "ArtNo"
            };

            _paging.AddField(f);

            f = new Field {
                Name = "Name"
            };
            _paging.AddField(f);

            agvProducts.ChangeHeaderImageUrl("arrowArtNo", "../images/arrowup.gif");

            _paging.ItemsPerPage = 10;

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex      = 1;
            ViewState["Paging"]           = _paging;
        }
        else
        {
            _paging = (SqlPaging)(ViewState["Paging"]);

            if (_paging == null)
            {
                throw (new Exception("Paging lost"));
            }
        }
    }
Ejemplo n.º 56
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _paging = new SqlPaging
            {
                TableName =
                    "[Catalog].[Product] LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] inner join Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] Left JOIN [Catalog].[ProductPropertyValue] ON [Product].[ProductID] = [ProductPropertyValue].[ProductID] LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferID] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId"
            };
            _paging.AddFieldsRange(
                new List <Field>
            {
                new Field {
                    Name = "[Product].[ProductID]", IsDistinct = true
                },
                //new Field {Name = "PhotoName AS Photo"},
                new Field {
                    Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"
                },
                new Field {
                    Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"
                },
                new Field {
                    Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"
                },

                new Field {
                    Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"
                },
                //new Field {Name = "[Photo].[Description] AS PhotoDesc"},
                new Field {
                    Name = "[ProductCategories].[CategoryID]", NotInQuery = true
                },
                new Field {
                    Name = "BriefDescription"
                },
                new Field {
                    Name = "Product.ArtNo"
                },
                new Field {
                    Name = "Name"
                },
                new Field {
                    Name = "(CASE WHEN Price=0 THEN 0 ELSE 1 END) as TempSort", Sorting = SortDirection.Descending
                },
                new Field {
                    Name = "Recomended"
                },
                new Field {
                    Name = "Bestseller"
                },
                new Field {
                    Name = "New"
                },
                new Field {
                    Name = "OnSale"
                },
                new Field {
                    Name = "Discount"
                },
                new Field {
                    Name = "Offer.Main", NotInQuery = true
                },
                new Field {
                    Name = "Offer.OfferID"
                },
                new Field {
                    Name = "Offer.Amount"
                },
                new Field {
                    Name = "(CASE WHEN Offer.Amount=0 OR Offer.Amount < IsNull(MinAmount,0) THEN 0 ELSE 1 END) as TempAmountSort", Sorting = SortDirection.Descending
                },
                new Field {
                    Name = "MinAmount"
                },
                new Field {
                    Name = "MaxAmount"
                },
                new Field {
                    Name = "Enabled"
                },
                new Field {
                    Name = "AllowPreOrder"
                },
                new Field {
                    Name = "Ratio"
                },
                new Field {
                    Name = "RatioID"
                },
                new Field {
                    Name = "DateModified"
                },
                new Field {
                    Name = "ShoppingCartItemId"
                },
                new Field {
                    Name = "UrlPath"
                },
                new Field {
                    Name = "[ProductCategories].[SortOrder]"
                },
                new Field {
                    Name = "[ShoppingCart].[CustomerID]", NotInQuery = true
                },
                new Field {
                    Name = "BrandID", NotInQuery = true
                },
                new Field {
                    Name = "Offer.ProductID as Size_ProductID", NotInQuery = true
                },
                new Field {
                    Name = "Offer.ProductID as Color_ProductID", NotInQuery = true
                },
                new Field {
                    Name = "Offer.ProductID as Price_ProductID", NotInQuery = true
                },
                new Field {
                    Name = "Offer.ColorID"
                },
                new Field {
                    Name = "CategoryEnabled", NotInQuery = true
                },
            });

            if (SettingsCatalog.ComplexFilter)
            {
                _paging.AddFieldsRange(new List <Field>
                {
                    new Field {
                        Name = "(select max (price) - min (price) from catalog.offer where offer.productid=product.productid) as MultiPrices"
                    },
                    new Field {
                        Name = "(select min (price) from catalog.offer where offer.productid=product.productid) as Price"
                    },
                });
            }
            else
            {
                _paging.AddFieldsRange(new List <Field>
                {
                    new Field {
                        Name = "0 as MultiPrices"
                    },
                    new Field {
                        Name = "Price"
                    },
                });
            }

            _paging.AddParam(new SqlParam {
                ParameterName = "@CustomerId", Value = CustomerContext.CustomerId.ToString()
            });
            _paging.AddParam(new SqlParam {
                ParameterName = "@Type", Value = PhotoType.Product.ToString()
            });

            if (string.IsNullOrEmpty(Request["categoryid"]) || !Int32.TryParse(Request["categoryid"], out _categoryId))
            {
                _categoryId = 0;

                var sbMainPage = StaticBlockService.GetPagePartByKeyWithCache("MainPageSocial");
                if (sbMainPage != null && sbMainPage.Enabled)
                {
                    MainPageText = sbMainPage.Content;
                }
            }

            if (!string.IsNullOrEmpty(MainPageText))
            {
                SetMeta(null, string.Empty);
                return;
            }

            category = CategoryService.GetCategory(_categoryId);
            if (category == null || category.Enabled == false || category.ParentsEnabled == false)
            {
                Error404();
                return;
            }

            ProductsCount = category.GetProductCount();

            categoryView.CategoryID = _categoryId;
            categoryView.Visible    = true;
            pnlSort.Visible         = ProductsCount > 0;
            productView.Visible     = ProductsCount > 0;

            lblCategoryName.Text = _categoryId != 0 ? category.Name : Resource.Client_MasterPage_Catalog;
            //lblCategoryDescription.Text = category.Description;

            //imgCategoryImage.ImageUrl = string.IsNullOrEmpty(category.Picture) ? "" : string.Format("{0}", ImageFolders.GetImageCategoryPath(false, category.Picture));

            breadCrumbs.Items =
                CategoryService.GetParentCategories(_categoryId).Select(parent => new BreadCrumbs
            {
                Name = parent.Name,
                Url  = "social/catalogsocial.aspx?categoryid=" + parent.CategoryId
            }).Reverse().ToList();
            breadCrumbs.Items.Insert(0, new BreadCrumbs
            {
                Name = Resource.Client_MasterPage_MainPage,
                Url  = UrlService.GetAbsoluteLink("social/catalogsocial.aspx")
            });

            SetMeta(category.Meta, category.Name);

            if (category.DisplayChildProducts)
            {
                var cfilter = new InChildCategoriesFieldFilter
                {
                    CategoryId = _categoryId.ToString(),
                    ParamName  = "@CategoryID"
                };
                _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
            }
            else
            {
                var cfilter = new EqualFieldFilter {
                    Value = _categoryId.ToString(), ParamName = "@catalog"
                };
                _paging.Fields["[ProductCategories].[CategoryID]"].Filter = cfilter;
            }

            _paging.Fields["Enabled"].Filter = new EqualFieldFilter {
                Value = "1", ParamName = "@enabled"
            };;
            _paging.Fields["CategoryEnabled"].Filter = new EqualFieldFilter {
                Value = "1", ParamName = "@CategoryEnabled"
            };

            var logicalFilter = new LogicalFilter {
                ParamName = "@Main", HideInCustomData = true
            };

            logicalFilter.AddFilter(new EqualFieldFilter {
                Value = "1", ParamName = "@Main1", HideInCustomData = true
            });
            logicalFilter.AddLogicalOperation("OR");
            logicalFilter.AddFilter(new NullFieldFilter {
                Null = true, ParamName = "@Main2", HideInCustomData = true
            });
            _paging.Fields["Offer.Main"].Filter = logicalFilter;

            BuildSorting();
        }
Ejemplo n.º 57
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resources.Resource.Admin_Brands_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging
                {
                    TableName    = "[Catalog].[Brand] left join Catalog.Photo on Photo.ObjId = Brand.BrandID and Type = @Type ",
                    ItemsPerPage = 10
                };

                _paging.AddFieldsRange(new List <Field>
                {
                    new Field
                    {
                        Name       = "BrandID as ID",
                        IsDistinct = true
                    },
                    new Field {
                        Name = "ProductsCount", SelectExpression = "(Select Count(ProductID) from Catalog.Product Where Product.BrandID=Brand.BrandID) as ProductsCount"
                    },
                    new Field {
                        Name = "PhotoName as BrandLogo"
                    },
                    new Field {
                        Name = "Enabled"
                    },
                    new Field {
                        Name = "SortOrder", Sorting = SortDirection.Ascending
                    },
                    new Field {
                        Name = "BrandName", Sorting = SortDirection.Ascending
                    }
                });
                _paging.AddParam(new SqlParam {
                    Value = PhotoType.Brand.ToString(), ParameterName = "@Type"
                });
                grid.ChangeHeaderImageUrl("arrowSortOrder", "images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex      = 1;
                ViewState["Paging"]           = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIds"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    _selectionFilter = new InSetFieldFilter();
                    if (arrids.Contains("-1"))
                    {
                        _selectionFilter.IncludeValues = false;
                        _inverseSelection = true;
                    }
                    else
                    {
                        _selectionFilter.IncludeValues = true;
                    }
                    _selectionFilter.Values = arrids.Where(id => id != "-1").ToArray();
                }
            }
        }
Ejemplo n.º 58
0
        protected void Page_Load(object sender, EventArgs e)
        {
            btnAdd.OnClientClick = "javascript:open_window('m_ProductVideos.aspx?ProductID=" + ProductID + "',780,600);return false;";

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Catalog].[ProductVideo]", ItemsPerPage = 10 };

                var f = new Field { Name = "ProductVideoID", IsDistinct = true, Filter = _selectionFilter };
                _paging.AddField(f);

                f = new Field
                    {
                        Name = "ProductID",
                        Filter = new EqualFieldFilter
                            {
                                ParamName = "@productID",
                                Value = ProductID.ToString()
                            }
                    };
                _paging.AddField(f);

                f = new Field { Name = "Name" };
                _paging.AddField(f);

                f = new Field { Name = "VideoSortOrder", Sorting = SortDirection.Ascending };
                _paging.AddField(f);

                grid_video.ChangeHeaderImageUrl("arrowVideoSortOrder", "~/admin/images/arrowup.gif");

                _paging.ItemsPerPage = 10;

                pageNumberer.CurrentPageIndex = 1;
                _paging.CurrentPageIndex = 1;
                ViewState["Paging"] = _paging;
            }
            else
            {
                _paging = (SqlPaging)(ViewState["Paging"]);
                _paging.ItemsPerPage = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                if (_paging == null)
                {
                    throw (new Exception("Paging lost"));
                }

                string strIds = Request.Form["SelectedIdsVideo"];

                if (!string.IsNullOrEmpty(strIds))
                {
                    strIds = strIds.Trim();
                    string[] arrids = strIds.Split(' ');

                    var ids = new string[arrids.Length ];
                    _selectionFilter = new InSetFieldFilter { IncludeValues = true };
                    for (int idx = 0; idx <= ids.Length - 1; idx++)
                    {
                        int t = -1;
                        int.TryParse(arrids[idx], out t);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString();
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                    //_InverseSelection = If(ids(0) = -1, True, False)
                }
            }
        }
Ejemplo n.º 59
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool categoryIdIsNum = false;
            int categoryId = -1;
            if (!string.IsNullOrEmpty(Request["newscategoryid"]) &&
                Int32.TryParse(Request["newscategoryid"], out categoryId))
            {
                categoryIdIsNum = categoryId != -1;
            }

            _paging = new SqlPaging
                {
                    TableName = "Settings.News left join Catalog.Photo on Photo.objId=News.NewsID and Type=@Type",
                    ItemsPerPage = SettingsNews.NewsPerPage
                };

            _paging.AddField(new Field { Name = "NewsID" });

            _paging.AddField(new Field { Name = "AddingDate", Sorting = SortDirection.Descending });

            _paging.AddField(new Field { Name = "Title" });

            _paging.AddField(new Field { Name = "PhotoName as Picture" });

            _paging.AddField(new Field { Name = "TextToPublication" });

            _paging.AddField(new Field { Name = "TextToEmail" });

            _paging.AddField(new Field { Name = "TextAnnotation" });

            _paging.AddField(new Field { Name = "UrlPath" });

            _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.News.ToString() });

            if (categoryIdIsNum)
            {
                var f = new Field { Name = "NewsCategoryID", NotInQuery = true };
                var filter = new EqualFieldFilter
                    {
                        ParamName = "@NewsCategoryID",
                        Value = categoryId.ToString(CultureInfo.InvariantCulture)
                    };
                f.Filter = filter;
                _paging.AddField(f);
            }

            MetaInfo nmeta = new MetaInfo
                {
                    Type = MetaType.News,
                    Title = SettingsNews.NewsMetaTitle,
                    MetaKeywords = SettingsNews.NewsMetaKeywords,
                    MetaDescription = SettingsNews.NewsMetaDescription,
                    H1 = SettingsNews.NewsMetaH1
                };

            var category = NewsService.GetNewsCategoryById(categoryId);
            header.Text = category != null
                              ? string.Format("{0} / {1}", Resource.Client_News_News, category.Name)
                              : Resource.Client_News_News;

            if (paging.CurrentPage > 1)
            {
                header.Text = header.Text + Resource.Client_Catalog_PageIs + paging.CurrentPage;
            }

            if (category != null)
            {
                ucBreadCrumbs.Items = new List<BreadCrumbs>
                    {
                        new BreadCrumbs
                            {
                                Name = Resource.Client_News_News,
                                Url = UrlService.GetAbsoluteLink("news")
                            },
                        new BreadCrumbs
                            {
                                Name = category.Name,
                                Url = UrlService.GetLink(ParamType.NewsCategory, category.UrlPath, category.NewsCategoryID)
                            }
                    };
            }
            else
            {
                ucBreadCrumbs.Visible = false;
            }

            if (paging.CurrentPage > 1)
            {
                nmeta.Title += Resource.Client_Catalog_PageIs + paging.CurrentPage;
                nmeta.MetaDescription += Resource.Client_Catalog_PageIs + paging.CurrentPage;
            }
            SetMeta(nmeta, string.Empty);
        }
Ejemplo n.º 60
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _priceField = CustomerSession.CurrentCustomer.PriceType.ToString();

            _paging = new SqlPaging
                {
                    TableName =
                        "[Catalog].[Product] " +
                        "LEFT JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID] and [Offer].Main = 1 " +
                        "LEFT JOIN [Catalog].[ShoppingCart] ON [Catalog].[ShoppingCart].[OfferID] = [Catalog].[Offer].[OfferID] AND [Catalog].[ShoppingCart].[ShoppingCartType] = 3 AND [ShoppingCart].[CustomerID] = @CustomerId  " +
                        "Left JOIN [Catalog].[Ratio] on Product.ProductId= Ratio.ProductID and Ratio.CustomerId=@CustomerId " +
                        "LEFT JOIN [Customers].[LastPrice] ON [LastPrice].[ProductId] = [Product].[ProductId] AND [LastPrice].[CustomerId] = @CustomerId"
                };

            _paging.AddFieldsRange(
                new List<Field>()
                    {
                        new Field {Name = "[Product].[ProductID] as ProductID", IsDistinct = true},
                        new Field {Name = "null AS AdditionalPhoto"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select Count(PhotoName) From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) ELSE (Select Count(PhotoName) From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type) END)  AS CountPhoto"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) PhotoName From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS Photo"},
                        new Field {Name = "(CASE WHEN Offer.ColorID is not null THEN (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE ([Photo].ColorID = Offer.ColorID or [Photo].ColorID is null) and [Product].[ProductID] = [Photo].[ObjId] and Type=@Type Order By main desc, [Photo].[PhotoSortOrder]) ELSE (Select TOP(1) [Photo].[Description] From [Catalog].[Photo] WHERE [Product].[ProductID] = [Photo].[ObjId] and Type=@Type AND [Photo].[Main] = 1) END)  AS PhotoDesc"},
                        new Field {Name = "BriefDescription"},
                        new Field {Name = "Product.ArtNo"},
                        new Field {Name = "Name"},
                        new Field
                        {
                            Name = SettingsCatalog.UseLastPrice
                            ? string.Format("(CASE WHEN ProductPrice IS NULL THEN {0} ELSE ProductPrice END) as Price", _priceField)
                            : string.Format("{0} as Price", _priceField)
                        },
                        new Field {Name = string.Format("{0} - {0}*discount/100 as discountPrice", _priceField), NotInQuery = true},
                        new Field {Name = "0 as MultiPrices"},
                        new Field {Name = "Recomended"},
                        new Field {Name = "New"},
                        new Field {Name = "Bestseller"},
                        new Field {Name = "OnSale"},
                        new Field {Name = "Discount"},
                        new Field {Name = "UrlPath"},
                        new Field {Name = "[Offer].Amount"},
                        new Field {Name = "Offer.Main", NotInQuery = true},
                        new Field {Name = "Offer.OfferID"},
                        new Field {Name = "MinAmount"},
                        new Field {Name = "MaxAmount"},
                        new Field {Name = "Multiplicity"},
                        new Field {Name = "Enabled"},
                        new Field {Name = "ShoppingCartItemId"},
                        new Field {Name = "AllowPreOrder"},
                        new Field {Name = "Ratio"},
                        new Field {Name = "RatioID"},
                        new Field {Name = "DateModified"},
                        new Field {Name = "[ShoppingCart].[CustomerID]", NotInQuery = true},
                        new Field {Name = "BrandID", NotInQuery = true},
                        new Field {Name = "CategoryEnabled", NotInQuery = true},
                        new Field {Name = "Offer.ColorID as ColorID"},
                        new Field
                            {
                                Name = "(select [Settings].[ProductColorsToString]([Product].[ProductID])) as Colors"
                            }
                    });

            _paging.AddParam(new SqlParam { ParameterName = "@CustomerId", Value = CustomerSession.CustomerId.ToString() });
            _paging.AddParam(new SqlParam { ParameterName = "@Type", Value = PhotoType.Product.ToString() });

            if (string.IsNullOrEmpty(Request["type"]) || !Enum.TryParse(Request["type"], true, out _typeFlag) ||
                _typeFlag == ProductOnMain.TypeFlag.None)
            {
                Error404();
            }

            ProductsCount = ProductOnMain.GetProductCountByType(_typeFlag);
            pnlSort.Visible = ProductsCount > 0;
            productView.Visible = ProductsCount > 0;

            filterBrand.CategoryId = 0;
            filterBrand.InDepth = true;
            filterBrand.WorkType = _typeFlag;

            filterPrice.CategoryId = 0;
            filterPrice.InDepth = true;

            _paging.Fields["CategoryEnabled"].Filter = new EqualFieldFilter
                {
                    Value = "1",
                    ParamName = "@CategoryEnabled"
                };
            _paging.Fields["Enabled"].Filter = new EqualFieldFilter {Value = "1", ParamName = "@Enabled"};

            if (_typeFlag == ProductOnMain.TypeFlag.Bestseller)
            {
                var filterB = new EqualFieldFilter {ParamName = "@Bestseller", Value = "1"};
                _paging.Fields["Bestseller"].Filter = filterB;
                _paging.Fields.Add(new KeyValuePair<string, Field>("SortBestseller",
                                                                   new Field {Name = "SortBestseller as Sort"}));
                PageName = Resource.Client_ProductList_AllBestSellers;

                SetMeta(
                    new AdvantShop.SEO.MetaInfo(SettingsMain.ShopName + " - " + Resource.Client_Bestsellers_Header),
                    string.Empty);
            }
            if (_typeFlag == ProductOnMain.TypeFlag.New)
            {
                var filterN = new EqualFieldFilter {ParamName = "@New", Value = "1"};
                _paging.Fields["New"].Filter = filterN;
                _paging.Fields.Add(new KeyValuePair<string, Field>("SortNew", new Field {Name = "SortNew as Sort"}));
                PageName = Resource.Client_ProductList_AllNew;

                SetMeta(new AdvantShop.SEO.MetaInfo(SettingsMain.ShopName + " - " + Resource.Client_New_Header),
                        string.Empty);
            }
            if (_typeFlag == ProductOnMain.TypeFlag.Discount)
            {
                var filterN = new NotEqualFieldFilter() {ParamName = "@Discount", Value = "0"};
                _paging.Fields["Discount"].Filter = filterN;
                _paging.Fields.Add(new KeyValuePair<string, Field>("SortDiscount",
                                                                   new Field {Name = "SortDiscount as Sort"}));
                PageName = Resource.Client_ProductList_AllDiscount;

                SetMeta(new AdvantShop.SEO.MetaInfo(SettingsMain.ShopName + " - " + Resource.Client_Discount_Header),
                        string.Empty);
            }

            breadCrumbs.Items.AddRange(new BreadCrumbs[]
                {
                    new BreadCrumbs()
                        {
                            Name = Resource.Client_MasterPage_MainPage,
                            Url = UrlService.GetAbsoluteLink("/")
                        },
                    new BreadCrumbs() {Name = PageName, Url = null}
                });

            BuildSorting();
            BuildFilter();
        }