Exemple #1
0
        public IActionResult All(string type)
        {
            string function = StringSwapper.ByArea(type,
                                                   SqlFunctionDictionary.AllAgreementsFunds,
                                                   SqlFunctionDictionary.AllAgreementsSubFunds,
                                                   SqlFunctionDictionary.AllAgreementsShareClasses);

            var today      = DateTime.Today;
            var agreements = this.service.All <AgreementLibraryViewModel>(function, today);

            var viewModel = new AgreementsLibraryOverviewViewModel()
            {
                Date         = today.ToString(GlobalConstants.RequiredWebDateTimeFormat),
                Agreements   = agreements,
                SelectedType = Regex.Replace(type, "(\\B[A-Z])", " $1"),
            };

            return(this.View(viewModel));
        }
Exemple #2
0
        public IActionResult All(AgreementsLibraryOverviewViewModel model)
        {
            if (model.Date != null)
            {
                string function = StringSwapper.ByArea(model.SelectedType,
                                                       SqlFunctionDictionary.AllAgreementsFunds,
                                                       SqlFunctionDictionary.AllAgreementsSubFunds,
                                                       SqlFunctionDictionary.AllAgreementsShareClasses);

                var parsedDate = DateTimeExtensions.FromWebFormat(model.Date);

                model.Agreements = this.service.All <AgreementLibraryViewModel>(function, parsedDate);
            }

            if (model.Agreements != null)
            {
                return(this.View(model));
            }

            this.ShowError(this.sharedLocalizer.GetHtmlString(ErrorMessages.UnsuccessfulUpdate));
            return(this.View(model));
        }