public async Task <ActionResult> EditTender(Guid tenderGuid) { TenderDTO tender = await TenderProvider.GetTender(tenderGuid); var viewModel = new TenderAboveThresholdUAViewModel(tender); return(View(viewModel)); }
public async Task <ActionResult> EditTender(TenderAboveThresholdUAViewModel viewModel) { if (!ModelState.IsValid) { return(View(viewModel)); } var tenderDTO = viewModel.ToDTO(); await TenderProvider.EditTender(tenderDTO); return(RedirectToAction("Info", "TenderInfo", new { tenderGuid = tenderDTO.Guid })); }
public async Task <ActionResult> Info(Guid tenderGuid) { var tender = await TenderProvider.GetTender(tenderGuid); switch (tender.ProcurementMethodType) { case ProcurementMethodType.ABOVE_THRESHOLD_UA: { var viewModel = new TenderAboveThresholdUAViewModel(tender); return(View("InfoAboveThresholdUA", viewModel)); } case ProcurementMethodType.ABOVE_THRESHOLD_EU: { var viewModel = new TenderAboveThresholdEUViewModel(tender); return(View("InfoAboveThresholdEU", viewModel)); } case ProcurementMethodType.REPORTING: { var viewModel = new TenderLimitedReportingViewModel(tender); return(View("InfoTenderLimitedReporting", viewModel)); } case ProcurementMethodType.NEGOTIATION: { var viewModel = new TenderLimitedViewModel(tender); return(View("InfoTenderLimited", viewModel)); } case ProcurementMethodType.NEGOTIATION_QUICK: { var viewModel = new TenderLimitedQuickViewModel(tender); return(View("InfoTenderLimitedQuick", viewModel)); } case ProcurementMethodType.ABOVE_THRESHOLD_UA_DEFENSE: { var viewModel = new TenderDefenseViewModel(tender); return(View("InfoTenderDefense", viewModel)); } default: { var viewModel = new TenderBelowThresholdViewModel(tender); return(View("InfoBelowThreshold", viewModel)); } } throw new BadRequestException(); }