Exemplo n.º 1
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;
        }
Exemplo n.º 2
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;
                }

            }
        }
Exemplo n.º 3
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"));
                }
            }
        }
Exemplo n.º 4
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)
                }
            }
        }
Exemplo n.º 5
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);

                _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)
                }
            }
        }
Exemplo n.º 6
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;
                }
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var 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 = "[Customers].[Customer]", ItemsPerPage = 10 };

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

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

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

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

                agvCustomers.ChangeHeaderImageUrl("arrowFirstname", UrlService.GetAdminAbsoluteLink("images/arrowup.gif"));
                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"));
                }

                if (!string.IsNullOrEmpty(hfSelectedCustomer.Value))
                {
                    SelectedCustomers = new List<Guid> { new Guid(hfSelectedCustomer.Value) };
                }
            }
        }
        protected void grid_Sorting(object sender, GridViewSortEventArgs e)
        {
            var arrows = new Dictionary<string, string>
                {
                    {"PriceRange", "arrowPriceRange"},
                    {"PercentDiscount", "arrowPercentDiscount"}
                };

            const string urlArrowUp = "images/arrowup.gif";
            const string urlArrowDown = "images/arrowdown.gif";
            const string urlArrowGray = "images/arrowdownh.gif";

            var csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
            var nsf = new Field();
            nsf = _paging.Fields[e.SortExpression];
            if (nsf.Name.Equals(csf.Name))
            {
                csf.Sorting = csf.Sorting == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
                grid.ChangeHeaderImageUrl(arrows[csf.Name], csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown);
            }
            else
            {
                csf.Sorting = null;
                //If Not csf.Name.Contains("SortOrder") Then
                grid.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);
                //End If

                nsf.Sorting = SortDirection.Ascending;
                grid.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
            }

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex = 1;
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resources.Resource.Admin_Subscription_Header));
            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "[Customers].[Customer]", ItemsPerPage = 10 };

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

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

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

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

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

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

                grid.ChangeHeaderImageUrl("arrowEmail", "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(' ');

                    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 != "")
                        {
                            ids[idx] = t;
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_m_CategorySortOrder_Title));

            divSave.Visible = false;
            grid.ResetToDefaultValueOnRowEditCancel = false;

            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 = SQLDataHelper.GetInt(ddRowsPerPage.SelectedValue);

                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"));
                }
            }
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblMes.Text = string.Empty;
            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resources.Resource.Admin_301Redirects_Header));

            if (!IsPostBack)
            {
                chbEnabled301Redirect.Checked = AdvantShop.Configuration.SettingsSEO.Enabled301Redirects;

                _paging = new SqlPaging { TableName = "[Settings].[Redirect]", ItemsPerPage = 20 };

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

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

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

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

                grid.ChangeHeaderImageUrl("arrowID", "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();
                    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)
                }
            }
        }
Exemplo n.º 12
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 = "convert(nvarchar, isnull(ColorID, 0)) as ColorID" };
                _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 = 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)
                }
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Admin_MailFormat_Header));

            if (!IsPostBack)
            {
                _paging = new SqlPaging { TableName = "Settings.MailFormat", ItemsPerPage = 10 };

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

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

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

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

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

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

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

                _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();
                }

            }
        }
Exemplo n.º 14
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)
                }
            }
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(string.Format("{0} - {1}", AdvantShop.Configuration.SettingsMain.ShopName, Resource.Admin_MasterPageAdminCatalog_Catalog));
            if (string.IsNullOrEmpty(ModuleName))
            {
                Response.Redirect("ExportFeed.aspx?ModuleId=YandexMarket");
                return;
            }
            if (!string.IsNullOrEmpty(Request["CatId"]))
            {
                Int32.TryParse(Request["CatId"], out _catId);
            }
            Category cat = CategoryService.GetCategory(_catId);
            if (cat != null)
            {
                lblCategoryName.Text = cat.Name;
                sn.BuildNavigationAdmin(_catId);
            }
            if (!Page.IsPostBack)
            {
                var flag = ExportFeedService.CheakCategoryHierical(ModuleName, _catId);
                pnlCategorySet.Enabled = !flag;
                chbFull.Checked = ExportFeedService.CheakCategory(ModuleName, _catId);
                pnlData.Enabled = !chbFull.Checked && !flag;
            }
            PageSubheader.Visible = true;
            ModuleNameLiteral.Text = ModuleName;
            if (!IsPostBack)
            {
                var node2 = new TreeNode { Text = SelectCategory(0, ModuleName, Resource.Admin_m_Category_Root), Value = "0", Selected = true, NavigateUrl = ExportFeedNew + "?moduleid=" + ModuleName };

                tree2.Nodes.Add(node2);
                LoadChildCategories2(tree2.Nodes[0]);

                _paging = new SqlPaging
                    {
                        TableName = "[Catalog].[Product] left JOIN [Catalog].[Offer] ON [Product].[ProductID] = [Offer].[ProductID]  AND [Offer].Main=1 INNER JOIN Catalog.ProductCategories on ProductCategories.ProductId = [Product].[ProductID] and ProductCategories.Main=1",
                        ItemsPerPage = 100
                    };

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

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

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

                f = new Field { Name = "(Select count(*) from Settings.ExportFeedSelectedProducts where ModuleName=@ModuleName and ExportFeedSelectedProducts.ProductID=Product.ProductId) as Cheaked" };
                _paging.AddField(f);

                var pf = new EqualFieldFilter { Value = _catId.ToString(), ParamName = "@Parent" };
                f = new Field { Name = "CategoryId", Filter = pf };
                _paging.AddField(f);

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

                _paging.AddParam(new SqlParam { ParameterName = "@ModuleName", Value = ModuleName });

                _paging.ExtensionWhere = "and Offer.Price > 0 and (Offer.Amount > 0 or Product.AllowPreorder=1) and CategoryEnabled=1 and Enabled=1";
                grid.ChangeHeaderImageUrl("arrowName", "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();
                    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;
                }
            }
        }
Exemplo n.º 16
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"));
                }
            }
        }
Exemplo n.º 17
0
        protected void grid_Sorting(object sender, GridViewSortEventArgs e)
        {
            var arrows = new Dictionary<string, string>
                {
                    {"Product.ArtNo", "arrowArtNo"},
                    {"Name", "arrowName"},
                    {"Price", "arrowPrice"},
                    {"Amount", "arrowQty"},
                    {"Enabled", "arrowEnabled"},
                    {"ProductCategories.SortOrder", "arrowSortOrder"},
                };

            const string urlArrowUp = "images/arrowup.gif";
            const string urlArrowDown = "images/arrowdown.gif";
            const string urlArrowGray = "images/arrowdownh.gif";

            var csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
            var nsf = new Field();
            if (e.SortExpression.Equals("SortOrder"))
            {
                switch (ShowMethod)
                {
                    case EShowMethod.Normal:
                        nsf = _paging.Fields["ProductCategories.SortOrder"];
                        break;
                }
            }
            else
            {
                nsf = _paging.Fields[e.SortExpression];
            }

            if (nsf.Name.Equals(csf.Name))
            {
                csf.Sorting = csf.Sorting == SortDirection.Ascending
                                  ? SortDirection.Descending
                                  : SortDirection.Ascending;
                grid.ChangeHeaderImageUrl(arrows[csf.Name],
                                          (csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown));
            }
            else
            {
                csf.Sorting = null;
                grid.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);

                nsf.Sorting = SortDirection.Ascending;
                grid.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
            }

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex = 1;
        }
Exemplo n.º 18
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;
                }
            }
        }
        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"));
                }
            }
        }
Exemplo n.º 20
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;
                }
            }
        }
Exemplo n.º 21
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"];
            }
        }
Exemplo n.º 22
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);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMeta(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 = 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++)
                    {
                        int t = int.Parse(arrids[idx]);
                        if (t != -1)
                        {
                            ids[idx] = t.ToString(CultureInfo.InvariantCulture);
                        }
                        else
                        {
                            _selectionFilter.IncludeValues = false;
                            _inverseSelection = true;
                        }
                    }

                    _selectionFilter.Values = ids;
                }
            }
        }