예제 #1
0
 public FestivalController(IFestivalRepository festivalRepository, ILogger <FestivalController> logger, IMapper mapper, IPCRepository pCRepository)
 {
     _festivalrepo   = festivalRepository;
     _logger         = logger;
     _mapper         = mapper;
     _productcatrepo = pCRepository;
 }
 public PCalcRepository(IPublicMethodRepsoitory <FormulaModel> formularepo, IPublicMethodRepsoitory <CopponModel> couponrepo, ILogger <PCalcRepository> logger, IPromotionBoxProdRepository boxProdRepository, IPublicMethodRepsoitory <ProductCombineModel> combinemodel, IFestivalRepository festivalRepository)
 {
     this._formularepo       = formularepo;
     this._couponrepo        = couponrepo;
     this._logger            = logger;
     this._boxProdRepository = boxProdRepository;
     this._combinerepo       = combinemodel;
     this._festrepo          = festivalRepository;
 }
예제 #3
0
 public PCalcRepository(IPublicMethodRepsoitory <CopponModel> couponrepo, ILogger <PCalcRepository> logger, IPromotionBoxProdRepository boxProdRepository, IFestivalRepository festivalRepository, BarayandContext context, IPublicMethodRepsoitory <OptionsModel> optionrepo)
 {
     this._couponrepo        = couponrepo;
     this._logger            = logger;
     this._boxProdRepository = boxProdRepository;
     this._festrepo          = festivalRepository;
     _context    = context;
     _optionrepo = optionrepo;
     CheckOptions();
 }
예제 #4
0
 public FestivalController(IFestivalRepository repository)
 {
     _repository = repository;
 }
예제 #5
0
 public FestivalService(IFestivalRepository repository)
 {
     _repository = repository;
 }
예제 #6
0
 public FestivalController(IFestivalRepository repository)
 {
     _repository = repository;
 }
예제 #7
0
 public FestivalController()
 {
     _repository = new SqlFestivalRepository();
 }
        private void ConvertFestivals()
        {
            _festivalRepository = new FestivalRepository();
            try
            {
                if (_selectedClient != null)
                {
                    var festivalList = _festivalRepository.GetFestivals(_selectedClient.Id).Where(c => c.IsArchived == false).Select(c => new FestivalViewModel(c));
                    Festivals = new ObservableCollection <FestivalViewModel>(festivalList);
                }
                else if (FilterInputString != null)
                {
                    var festivalList = _festivalRepository.GetFestivals().Select(c => new FestivalViewModel(c)).Where(f => f.Name.Contains(FilterInputString) && f.IsArchived == false);

                    if (SelectedComboItem != null)
                    {
                        switch (SelectedComboItem)
                        {
                        case "Begin Datum":
                            Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderBy(f => f.StartDate).Skip(FestivalPage).Take(5).ToList());
                            RaisePropertyChanged("Festivals");
                            break;

                        case "Eind Datum":
                            Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderByDescending(f => f.EndDate).Skip(FestivalPage).Take(5).ToList());
                            RaisePropertyChanged("Festivals");
                            break;

                        case "Bedrijf asc":
                            Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderBy(f => f.Company.NameCompany).Skip(FestivalPage).Take(5).ToList());
                            RaisePropertyChanged("Festivals");
                            break;

                        case "Bedrijf desc":
                            Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderByDescending(f => f.Company.NameCompany).Skip(FestivalPage).Take(5).ToList());
                            RaisePropertyChanged("Festivals");
                            break;

                        default:
                            Festivals = new ObservableCollection <FestivalViewModel>(festivalList);
                            RaisePropertyChanged("Festivals");
                            break;
                        }
                    }
                    else
                    {
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList);
                        RaisePropertyChanged("Festivals");
                    }
                }
                else if (FilterInputString == null && SelectedComboItem != null)
                {
                    var festivalList = _festivalRepository.GetFestivals().Where(c => c.IsArchived == false).Select(c => new FestivalViewModel(c));
                    switch (SelectedComboItem)
                    {
                    case "Begin Datum":
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderBy(f => f.StartDate).Skip(FestivalPage).Take(5).ToList());
                        RaisePropertyChanged("Festivals");
                        break;

                    case "Eind Datum":
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderByDescending(f => f.EndDate).Skip(FestivalPage).Take(5).ToList());
                        RaisePropertyChanged("Festivals");
                        break;

                    case "Bedrijf asc":
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderBy(f => f.Company.NameCompany).Skip(FestivalPage).Take(5).ToList());
                        RaisePropertyChanged("Festivals");
                        break;

                    case "Bedrijf desc":
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList.OrderByDescending(f => f.Company.NameCompany).Skip(FestivalPage).Take(5).ToList());
                        RaisePropertyChanged("Festivals");
                        break;

                    default:
                        Festivals = new ObservableCollection <FestivalViewModel>(festivalList);
                        RaisePropertyChanged("Festivals");
                        break;
                    }
                }
                else
                {
                    var festivalList = _festivalRepository.GetFestivals().Where(c => c.IsArchived == false).Select(c => new FestivalViewModel(c));
                    var result       = festivalList.Skip(FestivalPage).Take(5);
                    Festivals = new ObservableCollection <FestivalViewModel>(result);
                    RaisePropertyChanged("Festivals");
                }
            }
            catch
            {
            }
        }