Ejemplo n.º 1
0
 public AdminController(ICategoriesRepository _categoryRepo, IEventFormsRepo _eventFormRepo, IBusinessFormsRepo _businessFormRepo, IMapper _mapper)
 {
     this.categoryRepo      = _categoryRepo;
     this.eventFormsRepo    = _eventFormRepo;
     this.businessFormsRepo = _businessFormRepo;
     this.mapper            = _mapper;
 }
Ejemplo n.º 2
0
        public static void SeedForms(IBusinessFormsRepo _businessFormsRepo, IEventFormsRepo _eventFormsRepo)
        {
            //var newForms = GetSeedEventForms();
            //foreach (var item in newForms)
            //{
            //    var existingForm = _eventFormsRepo.Find(f => f.FormName == item.FormName).ToList();

            //    if (existingForm.Count < 1 )
            //    {
            //        _eventFormsRepo.Add(item);
            //    }
            //}

            var newBusinessForms = GetSeedBusinessForms();

            foreach (var item in newBusinessForms)
            {
                var existingForm = _businessFormsRepo.Find(f => f.FormName == item.FormName).ToList();

                if (existingForm.Count < 1)
                {
                    _businessFormsRepo.Add(item);
                }
            }
        }
Ejemplo n.º 3
0
        public ListingCleaner(IEventFormsRepo _eventForms, IBusinessFormsRepo _businessForms)
        {
            this.EventDescriptionOverrides    = new Dictionary <EventType, string>();
            this.BusinessDescriptionOverrides = new Dictionary <BusinessType, string>();

            var eventForms = _eventForms.GetAll().ToList();

            foreach (var form in eventForms)
            {
                if (!string.IsNullOrWhiteSpace(form.DefaultDescriptionText))
                {
                    EventDescriptionOverrides.Add(form.Type, form.DefaultDescriptionText);
                }
            }

            var businessForms = _businessForms.GetAll().ToList();

            foreach (var form in businessForms)
            {
                if (!string.IsNullOrWhiteSpace(form.DefaultDescriptionText))
                {
                    BusinessDescriptionOverrides.Add(form.BusinessType, form.DefaultDescriptionText);
                }
            }
        }
Ejemplo n.º 4
0
 public static void SeedAll(ICategoriesRepository _categoriesRepo,
                            IBusinessFormsRepo _businessFormsRepo,
                            IEventFormsRepo _eventFormsRepo,
                            IEventsRepository _eventRepo,
                            IBusinessRepository _businessRepo)
 {
     SeedCategories(_categoriesRepo);
     SeedForms(_businessFormsRepo, _eventFormsRepo);
     SeedBusinesses(_businessRepo);
     SeedEvents(_eventRepo);
 }
Ejemplo n.º 5
0
 public SeedController(IOptions <DbSettings> _settings,
                       ICategoriesRepository _categoriesRepo,
                       IBusinessFormsRepo _businessForms,
                       IEventFormsRepo _eventForms,
                       IEventsRepository _eventRepo,
                       IBusinessRepository _businessRepo)
 {
     this.settings       = _settings;
     this.categoriesRepo = _categoriesRepo;
     this.businessForms  = _businessForms;
     this.eventForms     = _eventForms;
     this.eventRepo      = _eventRepo;
     this.businessRepo   = _businessRepo;
 }
Ejemplo n.º 6
0
 public static void DropFormCollections(IEventFormsRepo _eventForms, IBusinessFormsRepo _businessForms)
 {
     _eventForms.Db.DropCollection("eventforms");
     _businessForms.Db.DropCollection("businessforms");
 }
Ejemplo n.º 7
0
 public BusinessesController(IBusinessRepository _businessRepo, ICategoriesRepository _categoryRepo, IBusinessFormsRepo _formsRepo)
 {
     this.businessRepo = _businessRepo;
     this.categoryRepo = _categoryRepo;
     this.formsRepo    = _formsRepo;
 }