示例#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
        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
 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
 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
 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
 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
 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
 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);
             }
         }
     }
 }