コード例 #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);
            }
        }
コード例 #2
0
 protected void lbDeleteSelected1_Click(object sender, EventArgs e)
 {
     if (!_inverseSelection)
     {
         if (_selectionFilter != null)
         {
             foreach (var customerID in _selectionFilter.Values)
             {
                 if (CustomerService.GetCustomer(customerID.TryParseGuid()).IsAdmin)
                 {
                     if (Message.Visible)
                     {
                         Message.Text = Message.Text + @"<br />" + Resource.Admin_CustomersSearch_ErrAdmin;
                     }
                     else
                     {
                         MsgErr(Resource.Admin_CustomersSearch_ErrDeleting + @"<br />" +
                                Resource.Admin_CustomersSearch_ErrAdmin);
                     }
                 }
                 else if (customerID.Equals(SettingsGeneral.QrUserId))
                 {
                     if (Message.Visible)
                     {
                         Message.Text = Message.Text + @"<br />" + Resource.Admin_CustomersSearch_ErrReg;
                     }
                     else
                     {
                         MsgErr(Resource.Admin_CustomersSearch_ErrDeleting + @"<br />" +
                                Resource.Admin_CustomersSearch_ErrReg);
                     }
                 }
                 else
                 {
                     CustomerService.DeleteCustomer(Guid.Parse(customerID));
                 }
             }
         }
     }
     else
     {
         var itemsIds = _paging.ItemsIds("CustomerID as ID");
         foreach (var customerID in itemsIds.Where(certificateId => !_selectionFilter.Values.Contains(certificateId.ToString())))
         {
             if (!(CustomerService.GetCustomer(customerID).IsAdmin || customerID.Equals(SettingsGeneral.QrUserId)))
             {
                 CustomerService.DeleteCustomer(customerID);
             }
         }
     }
 }
コード例 #3
0
        protected void lbDeleteSelected_Click(object sender, EventArgs e)
        {
            if ((_selectionFilter != null) && (_selectionFilter.Values != null))
            {
                var currency = CurrencyService.Currency(SettingsCatalog.DefaultCurrencyIso3);

                if (!_inverseSelection)
                {
                    foreach (var id in _selectionFilter.Values)
                    {
                        if (currency != null && currency.CurrencyID != SQLDataHelper.GetInt(id))
                        {
                            CurrencyService.DeleteCurrency(SQLDataHelper.GetInt(id));
                        }
                    }
                }
                else
                {
                    var itemsIds = _paging.ItemsIds <int>("CurrencyID as ID");
                    foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
                    {
                        if (currency != null && currency.CurrencyID != id)
                        {
                            CurrencyService.DeleteCurrency(id);
                        }
                    }
                }
                CurrencyService.RefreshCurrency();
            }
        }
コード例 #4
0
ファイル: Sizes.aspx.cs プロジェクト: olegp306/ToyCorp2017
        protected void lbDeleteSelected_Click(object sender, EventArgs e)
        {
            if ((_selectionFilter != null) && (_selectionFilter.Values != null))
            {
                if (!_inverseSelection)
                {
                    foreach (var id in _selectionFilter.Values)
                    {
                        int sizeId = SQLDataHelper.GetInt(id);

                        if (!SizeService.IsSizeUsed(sizeId))
                        {
                            SizeService.DeleteSize(sizeId);
                        }
                    }
                }
                else
                {
                    var itemsIds = _paging.ItemsIds <int>("SizeID as ID");
                    foreach (var id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString())))
                    {
                        if (!SizeService.IsSizeUsed(id))
                        {
                            SizeService.DeleteSize(id);
                        }
                    }
                }
            }
        }
コード例 #5
0
 protected void lbDeleteSelected1_Click(object sender, EventArgs e)
 {
     if (!_inverseSelection)
     {
         if (_selectionFilter != null)
         {
             foreach (var customerID in _selectionFilter.Values)
             {
                 var customer = CustomerService.GetCustomer(customerID.TryParseGuid());
                 if (customer != null && customer.IsAdmin)
                 {
                     if (Message.Visible)
                     {
                         Message.Text = Message.Text + @"<br />" + Resource.Admin_CustomersSearch_ErrAdmin;
                     }
                     else
                     {
                         MsgErr(Resource.Admin_CustomersSearch_ErrDeleting + @"<br />" +
                                Resource.Admin_CustomersSearch_ErrAdmin);
                     }
                 }
                 else
                 {
                     CustomerService.DeleteCustomer(Guid.Parse(customerID));
                 }
             }
         }
     }
     else
     {
         var itemsIds = _paging.ItemsIds <string>("Convert(nvarchar(250), CustomerID) as ID");
         foreach (var customerID in itemsIds.Where(customerId => !_selectionFilter.Values.Contains(customerId.ToString())))
         {
             var customer = CustomerService.GetCustomer(Guid.Parse(customerID));
             if (customer != null && !customer.IsAdmin)
             {
                 CustomerService.DeleteCustomer(Guid.Parse(customerID));
             }
         }
     }
 }
コード例 #6
0
ファイル: ExportFeed.aspx.cs プロジェクト: gkovalev/nastia
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 //CityService.DeleteCity(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("Product.ProductId as ID");
             foreach (var id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 //CityService.DeleteCity(id);
             }
         }
     }
 }
コード例 #7
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 StaticPageService.DeleteStaticPage(SQLDataHelper.GetInt(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("StaticPageID as ID");
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 StaticPageService.DeleteStaticPage(id);
             }
         }
     }
 }
コード例 #8
0
ファイル: OrderSearch.aspx.cs プロジェクト: gkovalev/nastia
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 OrderService.DeleteOrder(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("[Order].OrderID as ID");
             foreach (int id in itemsIds.Where(iId => !_selectionFilter.Values.Contains(iId.ToString())))
             {
                 OrderService.DeleteOrder(id);
             }
         }
     }
 }
コード例 #9
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 CouponService.DeleteCoupon(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("CouponID as ID");
             foreach (int couponeId in itemsIds.Where(cId => !_selectionFilter.Values.Contains(cId.ToString(CultureInfo.InvariantCulture))))
             {
                 CouponService.DeleteCoupon(couponeId);
             }
         }
     }
 }
コード例 #10
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 CarouselService.DeleteCarousel(SQLDataHelper.GetInt(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("CarouselID as ID");
             //IEnumerable<int> ids = CurrencyService.GetAllCurrencyId();
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 CarouselService.DeleteCarousel(id);
             }
         }
     }
 }
コード例 #11
0
ファイル: Catalog.aspx.cs プロジェクト: olegp306/ToyCorp2017
 protected void lbDeleteSelected1_Click(object sender, EventArgs e)
 {
     if (!_inverseSelection)
     {
         if (_selectionFilter != null)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 ProductService.DeleteProduct(SQLDataHelper.GetInt(id), true);
             }
         }
     }
     else
     {
         foreach (int id in _paging.ItemsIds <int>("[Product].[ProductID] as ID").Where(id => !_selectionFilter.Values.Contains(id.ToString())))
         {
             ProductService.DeleteProduct(id, true);
         }
     }
     CategoryService.RecalculateProductsCountManual();
     _needReloadTree = true;
 }
コード例 #12
0
    protected void lbDeleteSelected_Click(object sender, EventArgs e)
    {
        if ((_selectionFilter == null) || (_selectionFilter.Values == null))
        {
            return;
        }

        if (!_inverseSelection)
        {
            foreach (var id in _selectionFilter.Values)
            {
                ReviewService.DeleteReview(Convert.ToInt32(id));
            }
        }
        else
        {
            var itemsIds = _paging.ItemsIds <int>("ReviewId as ID");
            foreach (int id in itemsIds.Where(iId => !_selectionFilter.Values.Contains(iId.ToString())))
            {
                ReviewService.DeleteReview(id);
            }
        }
    }
コード例 #13
0
 protected void lbSendMailSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 OrderByRequestService.SendConfirmationMessage(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("OrderByRequestID as ID");
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 OrderByRequestService.SendConfirmationMessage(id);
             }
         }
     }
 }
コード例 #14
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 DeleteUnRegUsers(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("ID");
             foreach (int id in itemsIds.Where(iId => !_selectionFilter.Values.Contains(iId.ToString(CultureInfo.InvariantCulture))))
             {
                 DeleteUnRegUsers(id);
             }
         }
     }
 }
コード例 #15
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 NewsService.DeleteNewsCategory(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("NewsCategoryID as ID");
             foreach (var newscCatId in itemsIds.Where(ncId => !_selectionFilter.Values.Contains(ncId.ToString(CultureInfo.InvariantCulture))))
             {
                 NewsService.DeleteNewsCategory(newscCatId);
             }
         }
     }
 }
コード例 #16
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 ProductOnMain.DeleteProductByType(SQLDataHelper.GetInt(id), _typeFlag);
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("Product.ProductId as ID");
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 ProductOnMain.DeleteProductByType(id, _typeFlag);
             }
         }
     }
 }
コード例 #17
0
ファイル: Certificates.aspx.cs プロジェクト: gkovalev/nastia
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 GiftCertificateService.DeleteCertificateById(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("CertificateID as ID");
             foreach (var id in itemsIds.Where(certificateId => !_selectionFilter.Values.Contains(certificateId.ToString())))
             {
                 GiftCertificateService.DeleteCertificateById(id);
             }
         }
     }
 }
コード例 #18
0
ファイル: Answers.aspx.cs プロジェクト: olegp306/ToyCorp2017
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 VoiceService.DeleteAnswer(SQLDataHelper.GetInt(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("AnswerID as ID");
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString())))
             {
                 VoiceService.DeleteAnswer(id);
             }
         }
     }
 }
コード例 #19
0
 //Delete!!
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 TaxServices.DeleteTax(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("TaxID as ID");
             foreach (int tax in itemsIds.Where(tax => !_selectionFilter.Values.Contains(tax.ToString(CultureInfo.InvariantCulture))))
             {
                 TaxServices.DeleteTax(tax);
             }
         }
     }
 }
コード例 #20
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 CustomerGroupService.DeleteCustomerGroup(Convert.ToInt32(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("CustomerGroupId as ID");
             //IEnumerable<int> ids = CustomerGroupService.GetCustomerGroupListIds();
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 CustomerGroupService.DeleteCustomerGroup(id);
             }
         }
     }
 }
コード例 #21
0
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 RedirectSeoService.DeleteRedirectSeo(SQLDataHelper.GetInt(id));
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("ID");
             //  List<int> ids = CountryService.GetAllCountryID();
             foreach (int id in itemsIds.Where(id => !_selectionFilter.Values.Contains(id.ToString(CultureInfo.InvariantCulture))))
             {
                 RedirectSeoService.DeleteRedirectSeo(id);
             }
         }
     }
 }
コード例 #22
0
ファイル: Menu.aspx.cs プロジェクト: gkovalev/nastia
 protected void lbDeleteSelected_Click(object sender, EventArgs e)
 {
     if ((_selectionFilter != null) && (_selectionFilter.Values != null))
     {
         if (!_inverseSelection)
         {
             foreach (var id in _selectionFilter.Values)
             {
                 foreach (var item in MenuService.GetAllChildIdByParent(Convert.ToInt32(id), _menuType))
                 {
                     MenuService.DeleteMenuItemById(item, _menuType);
                 }
             }
         }
         else
         {
             var itemsIds = _paging.ItemsIds <int>("MenuItemID as ID");
             foreach (var mItemId in itemsIds.Where(mId => !_selectionFilter.Values.Contains(mId.ToString())))
             {
                 foreach (var id in MenuService.GetAllChildIdByParent(mItemId, _menuType))
                 {
                     MenuService.DeleteMenuItemById(id, _menuType);
                 }
             }
         }
         if (_menuType == MenuService.EMenuType.Top)
         {
             CacheManager.RemoveByPattern(CacheNames.GetMainMenuCacheObjectName());
         }
         if (_menuType == MenuService.EMenuType.Bottom)
         {
             var cacheName = CacheNames.GetBottomMenuCacheObjectName();
             if (CacheManager.Contains(cacheName))
             {
                 CacheManager.Remove(cacheName);
             }
         }
     }
 }