public async Task <IActionResult> AuMReports(string type) { string function = StringSwapper.ByArea( type, SqlFunctionDictionary.ReportFunds, SqlFunctionDictionary.ReportSubFunds, null); var today = DateTime.Today; var date = today.BuildReportDate(type, 1); var headers = await this.service.All(function, date).FirstOrDefaultAsync(); var values = await this.service.All(function, date, 1).ToListAsync(); var viewModel = new AuMReportViewModel { Date = date, Headers = headers, Values = values, SelectedType = type, }; await this.recentService.Save(this.User, this.Request.Path); return(this.View(viewModel)); }
public async Task <IActionResult> GetAllTimeSeries(int id, string areaName) { string functionProviders = StringSwapper.ByArea( areaName, null, SqlFunctionTimeSeries.ProvidersSubFund, SqlFunctionTimeSeries.ProvidersShareClass); string functionTimeSeries = StringSwapper.ByArea( areaName, null, SqlFunctionTimeSeries.TimeSeriesSF, SqlFunctionTimeSeries.TimeSeriesSC); bool isMainProvider = true; var provider = await this.service.GetProviders(string.Format(functionProviders, id), 1, isMainProvider).FirstOrDefaultAsync(); var dates = await this.service.GetDates(string.Format(functionTimeSeries, id, provider), 1).ToListAsync(); var prices = await this.service.GetPrices(string.Format(functionTimeSeries, id, provider), 1).ToListAsync(); var model = new TimeSeriesViewModel() { AreaName = areaName, TSPriceDates = dates, TSTypeProvider = provider, TSAllPriceValues = prices, Id = id, }; return(this.PartialView("SpecificEntity/_TimeSeries", model)); }
public async Task <IActionResult> GetAllTimelines(int id, string areaName) { string functionDates = StringSwapper.ByArea( areaName, null, SqlFunctionTimeSeries.DatesSubFund, SqlFunctionTimeSeries.DatesShareClass); string functionProviders = StringSwapper.ByArea( areaName, null, SqlFunctionTimeSeries.ProvidersSubFund, SqlFunctionTimeSeries.ProvidersShareClass); string functionPrices = StringSwapper.ByArea( areaName, null, SqlFunctionTimeSeries.PricesSubFund, SqlFunctionTimeSeries.PricesShareClass); var dates = await this.service.GetDates(functionDates, id, 1).ToListAsync(); var providers = await this.service.GetProviders(functionProviders, id, 1).ToListAsync(); var prices = await this.service.GetPrices(functionPrices, id).ToListAsync(); var model = new TimeSeriesViewModel() { AreaName = areaName, TSPriceDates = dates, TSTypeProviders = providers, TSAllPriceValues = prices, Id = id, }; return(this.PartialView("SpecificEntity/_TimeSeries", model)); }
public async Task <IActionResult> AuMReports(string type) { string function = StringSwapper.ByArea( type, SqlFunctionDictionary.ReportFunds, SqlFunctionDictionary.ReportSubFunds, null); int day = (type == EndpointsConstants.FundArea) ? FixedDayNavValue : DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month - 1); var date = new DateTime(DateTime.Today.Year, DateTime.Today.Month - 1, day); var headers = await this.service.All(function, date).FirstOrDefaultAsync(); var values = await this.service.All(function, date, 1).ToListAsync(); var viewModel = new AuMReportViewModel { Date = date, Headers = headers, Values = values, SelectedType = type, }; return(this.View(viewModel)); }
public IActionResult GetAllDocuments(int id, string areaName) { var model = new DocumentOverviewViewModel { AreaName = areaName }; string function = StringSwapper.ByArea(areaName, SqlFunctionDictionary.DocumentsFund, SqlFunctionDictionary.DocumentsSubFund, SqlFunctionDictionary.DocumentsShareClass); model.Documents = this.entitiesDocumentService.GetDocuments <DocumentViewModel>(function, id); return(this.PartialView("SpecificEntity/_AllDocuments", model)); }
// ________________________________________________________ // // Documents public async Task UploadDocument(UploadDocumentInputModel model) { UploadDocumentDto dto = AutoMapperConfig.MapperInstance.Map <UploadDocumentDto>(model); dto.EndConnection = DateTimeExtensions.ToSqlFormat(model.EndConnection); dto.DocumentType = await this.service.ByIdDocumentType(model.DocumentType); Validator.ArgumentNullExceptionInt(dto.DocumentType, ErrorMessages.InvalidDocType); string query = StringSwapper.ByArea(model.AreaName, SqlProcedureDictionary.DocumentFund, SqlProcedureDictionary.DocumentSubFund, SqlProcedureDictionary.DocumentShareClass); query += " @file_name, @entity_id, @start_connection, @end_connection, @file_ext, @filetype_id"; SqlCommand command = new SqlCommand(query); command.Parameters.AddRange(new[] { new SqlParameter("@file_name", SqlDbType.NVarChar) { Value = dto.FileName }, new SqlParameter("@entity_id", SqlDbType.Int) { Value = dto.Id }, new SqlParameter("@file_ext", SqlDbType.NVarChar) { Value = dto.FileExt }, new SqlParameter("@start_connection", SqlDbType.NVarChar) { Value = dto.StartConnection }, new SqlParameter("@end_connection", SqlDbType.NVarChar) { Value = dto.EndConnection }, new SqlParameter("@filetype_id", SqlDbType.Int) { Value = dto.DocumentType }, }); await this.sqlManager.ExecuteProcedure(command); }
public async Task <IActionResult> AuMReports(AuMReportViewModel model) { string function = StringSwapper.ByArea( model.SelectedType, SqlFunctionDictionary.ReportFunds, SqlFunctionDictionary.ReportSubFunds, null); var date = model.Date.BuildReportDate(model.SelectedType); model.Headers = await this.service.All(function, date).FirstOrDefaultAsync(); model.Values = await this.service.All(function, date, 1).ToListAsync(); return(this.View(model)); }
public async Task DeleteDocument(int fileId, string areaName) { string query = StringSwapper.ByArea(areaName, SqlProcedureDictionary.DeleteDocumentFund, SqlProcedureDictionary.DeleteDocumentSubFund, SqlProcedureDictionary.DeleteDocumentShareClass); SqlCommand command = new SqlCommand(query); command.Parameters.Add(new SqlParameter("@file_id", SqlDbType.Int) { Value = fileId }); await this.sqlManager.ExecuteProcedure(command); }
public IActionResult GetAllCountriesDist(int id, string areaName) { string function = StringSwapper.ByArea(areaName, null, null, SqlFunctionDictionary.CountryDistShareClass); var model = this.service.All <CountryDistViewModel>(function, id); this.ViewBag.Area = areaName; this.ViewBag.Route = StringSwapper.ByArea(areaName, EndpointsConstants.RouteDetails + EndpointsConstants.FundArea, EndpointsConstants.RouteDetails + EndpointsConstants.DisplaySub + EndpointsConstants.FundArea, EndpointsConstants.RouteDetails + EndpointsConstants.ShareClassArea); return(this.PartialView("SpecificEntity/_CountryDist", model)); }
public IActionResult GetAllTimelines(int id, string areaName) { string function = StringSwapper.ByArea(areaName, SqlFunctionDictionary.TimelineFund, SqlFunctionDictionary.TimelineSubFund, SqlFunctionDictionary.TimelineShareClass); var model = this.service.GetTimeline <TimelineViewModel>(function, id); this.ViewBag.Area = areaName; this.ViewBag.Route = StringSwapper.ByArea(areaName, GlobalConstants.FundDetailsRouteName, GlobalConstants.SubFundDetailsRouteName, GlobalConstants.ShareClassDetailsRouteName); return(this.PartialView("SpecificEntity/_Timeline", model)); }
public IActionResult GetAllTimelines(int id, string areaName) { string function = StringSwapper.ByArea(areaName, SqlFunctionDictionary.TimelineFund, SqlFunctionDictionary.TimelineSubFund, SqlFunctionDictionary.TimelineShareClass); var model = this.service.All <TimelineViewModel>(function, id); this.ViewBag.Area = areaName; this.ViewBag.Route = StringSwapper.ByArea(areaName, EndpointsConstants.RouteDetails + EndpointsConstants.FundArea, EndpointsConstants.RouteDetails + EndpointsConstants.DisplaySub + EndpointsConstants.FundArea, EndpointsConstants.RouteDetails + EndpointsConstants.ShareClassArea); return(this.PartialView("SpecificEntity/_Timeline", model)); }
public object Do(PropertyInfo info, string tableValue) { var tableValueSwapped = StringSwapper.Swap(tableValue); if (tableValueSwapped != tableValue) { // new text = new translation var item = Translator.Translate(info, tableValueSwapped); return(item); } else { // if the swap doesn't do anything don't retranslate... // but see if something else wants to do work. var item = Translator.TranslateContinueAfterOperation(info, tableValue, TranslationOrder.Swapped.ToInt32()); return(item); } }
public IActionResult All(string type) { string function = StringSwapper.ByArea(type, SqlFunctionDictionary.AllAgreementsFunds, SqlFunctionDictionary.AllAgreementsSubFunds, SqlFunctionDictionary.AllAgreementsShareClasses); var today = DateTime.Today; var agreements = this.service.GetAll <AllAgreementViewModel>(function, today); var viewModel = new AllAgreementOverviewViewModel() { Date = today.ToString(GlobalConstants.RequiredWebDateTimeFormat), Agreements = agreements, SelectedType = Regex.Replace(type, "(\\B[A-Z])", " $1"), }; return(this.View(viewModel)); }
public async Task <IActionResult> AuMReports(AuMReportViewModel model) { string function = StringSwapper.ByArea( model.SelectedType, SqlFunctionDictionary.ReportFunds, SqlFunctionDictionary.ReportSubFunds, null); int day = (model.SelectedType == EndpointsConstants.FundArea) ? FixedDayNavValue : DateTime.DaysInMonth(model.Date.Year, model.Date.Month); var date = new DateTime(model.Date.Year, model.Date.Month, day); model.Headers = await this.service.All(function, date).FirstOrDefaultAsync(); model.Values = await this.service.All(function, date, 1).ToListAsync(); return(this.View(model)); }
public IActionResult GetAllAgreements(int id, string date, string areaName) { var model = new AgreementOverviewViewModel { AreaName = areaName, ContainerId = id, Date = date, }; var dateParsed = DateTimeParser.FromWebFormat(date); string function = StringSwapper.ByArea(areaName, SqlFunctionDictionary.AgreementsFund, SqlFunctionDictionary.AgreementsSubFund, SqlFunctionDictionary.AgreementsShareClass); model.Agreements = this.entitiesDocumentService.GetAgreements <AgreementViewModel>(function, id, dateParsed); return(this.PartialView("SpecificEntity/_AllAgreements", model)); }
public async Task <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"), }; await this.recentService.Save(this.User, this.Request.Path); return(this.View(viewModel)); }
public IActionResult GetDistinct(int id, string date, string areaName) { var model = new DistinctOverviewViewModel { AreaName = areaName }; var dateParsed = DateTimeParser.FromWebFormat(date); string functionDoc = StringSwapper.ByArea(areaName, SqlFunctionDictionary.DistinctDocumentsFund, SqlFunctionDictionary.DistinctDocumentsSubFund, SqlFunctionDictionary.DistinctDocumentsShareClass); string functionAgr = StringSwapper.ByArea(areaName, SqlFunctionDictionary.DistinctAgreementsFund, SqlFunctionDictionary.DistinctAgreementsSubFund, SqlFunctionDictionary.DistinctAgreementsShareClass); model.Documents = this.entitiesDocumentService.GetDistinctDocuments <DistinctDocViewModel>(functionDoc, id, dateParsed); model.Agreements = this.entitiesDocumentService.GetDistinctAgreements <DistinctAgrViewModel>(functionAgr, id, dateParsed); return(this.PartialView("SpecificEntity/_DistinctDocuments", model)); }
public IActionResult All(AllAgreementOverviewViewModel model) { if (model.Date != null) { string function = StringSwapper.ByArea(model.SelectedType, SqlFunctionDictionary.AllAgreementsFunds, SqlFunctionDictionary.AllAgreementsSubFunds, SqlFunctionDictionary.AllAgreementsShareClasses); var parsedDate = DateTimeParser.FromWebFormat(model.Date); model.Agreements = this.service.GetAll <AllAgreementViewModel>(function, parsedDate); } if (model.Agreements != null) { return(this.View(model)); } this.ShowError(this.sharedLocalizer.GetHtmlString(ErrorMessages.UnsuccessfulUpdate)); return(this.View(model)); }
// ________________________________________________________ // // Agreements public async Task UploadAgreement(UploadAgreementInputModel model) { UploadAgreementDto dto = AutoMapperConfig.MapperInstance.Map <UploadAgreementDto>(model); dto.AgreementType = await this.repository.ByIdAgreementType(model.AgrType); dto.Status = await this.repository.ByIdStatus(model.Status); dto.Company = await this.repository.ByIdCompany(model.Company); Validator.ArgumentNullExceptionInt(dto.AgreementType, ErrorMessages.InvalidAgrType); Validator.ArgumentNullExceptionInt(dto.Status, ErrorMessages.InvalidStatus); Validator.ArgumentNullExceptionInt(dto.Company, ErrorMessages.InvalidStatus); string query = StringSwapper.ByArea(model.AreaName, SqlProcedureDictionary.AgreementFund, SqlProcedureDictionary.AgreementSubFund, SqlProcedureDictionary.AgreementShareClass); query += " @file_name, @entity_id, @file_ext, @activity_type_id, @contract_date,@activation_date, " + "@expiration_date, @company_id, @status"; SqlCommand command = new SqlCommand(query); command.Parameters.AddRange(new[] { new SqlParameter("@file_name", SqlDbType.NVarChar) { Value = dto.FileName }, new SqlParameter("@entity_id", SqlDbType.Int) { Value = dto.Id }, new SqlParameter("@file_ext", SqlDbType.NVarChar) { Value = dto.FileExt }, new SqlParameter("@activity_type_id", SqlDbType.Int) { Value = dto.AgreementType }, new SqlParameter("@contract_date", SqlDbType.NVarChar) { Value = dto.ContractDate }, new SqlParameter("@activation_date", SqlDbType.NVarChar) { Value = dto.ActivationDate }, new SqlParameter("@expiration_date", SqlDbType.NVarChar) { Value = dto.ExpirationDate }, new SqlParameter("@company_id", SqlDbType.Int) { Value = dto.Company }, new SqlParameter("@status", SqlDbType.Int) { Value = dto.Status }, }); await this.sqlManager.ExecuteProcedure(command); }