Example #1
0
        protected override bool IsCanRemove(RealtorViewModel entityViewModel, out string errorText)
        {
            errorText = null;

            ValidationResult validation = _DictionaryService.IsPossibilityToDelete(entityViewModel.DbEntity);

            if (!validation.IsValid)
            {
                errorText = validation.GetReasons();
            }

            return(validation.IsValid);
        }
        private static void DeleteAllDict()
        {
            var dealVariantServiceEntities = dealVariantService.GetAll();

            foreach (var dealVariantServiceEntity in dealVariantServiceEntities)
            {
                if (dealVariantService.IsPossibilityToDelete(dealVariantServiceEntity))
                {
                    dealVariantService.Delete(dealVariantServiceEntity);
                }
            }

            var streetServiceEntities = streetService.GetAll();

            foreach (var streetServiceEntity in streetServiceEntities)
            {
                if (streetService.IsPossibilityToDelete(streetServiceEntity))
                {
                    streetService.Delete(streetServiceEntity);
                }
            }

            var districtServiceEntities = districtService.GetAll();

            foreach (var districtServiceEntity in districtServiceEntities)
            {
                if (districtService.IsPossibilityToDelete(districtServiceEntity))
                {
                    districtService.Delete(districtServiceEntity);
                }
            }
            var floorLevelServiceEntities = floorLevelService.GetAll();

            foreach (var floorLevelServiceEntity in floorLevelServiceEntities)
            {
                if (floorLevelService.IsPossibilityToDelete(floorLevelServiceEntity))
                {
                    floorLevelService.Delete(floorLevelServiceEntity);
                }
            }
            var layoutServiceEntities = layoutService.GetAll();

            foreach (var layoutServiceEntity in layoutServiceEntities)
            {
                if (layoutService.IsPossibilityToDelete(layoutServiceEntity))
                {
                    layoutService.Delete(layoutServiceEntity);
                }
            }
            var materialServiceEntities = materialService.GetAll();

            foreach (var materialServiceEntity in materialServiceEntities)
            {
                if (materialService.IsPossibilityToDelete(materialServiceEntity))
                {
                    materialService.Delete(materialServiceEntity);
                }
            }
            var ownershipServiceEntities = ownershipService.GetAll();

            foreach (var ownershipServiceEntity in ownershipServiceEntities)
            {
                if (ownershipService.IsPossibilityToDelete(ownershipServiceEntity))
                {
                    ownershipService.Delete(ownershipServiceEntity);
                }
            }
            var realtorServiceEntities = realtorService.GetAll();

            foreach (var realtorServiceEntity in realtorServiceEntities)
            {
                if (realtorService.IsPossibilityToDelete(realtorServiceEntity))
                {
                    realtorService.Delete(realtorServiceEntity);
                }
            }
            var sewageServiceEntities = sewageService.GetAll();

            foreach (var sewageServiceEntity in sewageServiceEntities)
            {
                if (sewageService.IsPossibilityToDelete(sewageServiceEntity))
                {
                    sewageService.Delete(sewageServiceEntity);
                }
            }


            var terraceServiceEntities = terraceService.GetAll();

            foreach (var terraceServiceEntity in terraceServiceEntities)
            {
                if (terraceService.IsPossibilityToDelete(terraceServiceEntity))
                {
                    terraceService.Delete(terraceServiceEntity);
                }
            }
            var toiletTypeServiceEntities = toiletTypeService.GetAll();

            foreach (var toiletTypeServiceEntity in toiletTypeServiceEntities)
            {
                if (toiletTypeService.IsPossibilityToDelete(toiletTypeServiceEntity))
                {
                    toiletTypeService.Delete(toiletTypeServiceEntity);
                }
            }
            var waterSupplyServiceEntities = waterSupplyService.GetAll();

            foreach (var waterSupplyServiceEntity in waterSupplyServiceEntities)
            {
                if (waterSupplyService.IsPossibilityToDelete(waterSupplyServiceEntity))
                {
                    waterSupplyService.Delete(waterSupplyServiceEntity);
                }
            }
        }