public async Task <ActionResult> EditTender(Guid tenderGuid) { var tender = await DraftProvider.GetDraftTender(tenderGuid); tender.Documents = tender.Documents.Where(m => m.DocumentOf == RelatedTo.Tender).ToList(); var viewModel = new DraftTenderDefenseViewModel(tender); return(View(viewModel)); }
public async Task <ActionResult> EditTender(DraftTenderDefenseViewModel viewModel) { if (!ModelState.IsValid) { return(View(viewModel)); } var draftDTO = viewModel.ToDTO(); await DraftProvider.EditDraftTender(viewModel.Guid, draftDTO); return(RedirectToAction("Info", "DraftTenderInfo", new { tenderGuid = viewModel.Guid })); }
public async Task <ActionResult> Info(Guid tenderGuid) { var tender = await DraftProvider.GetDraftTender(tenderGuid); TenderValidation(tender); switch (tender.ProcurementMethodType) { case ProcurementMethodType.ABOVE_THRESHOLD_UA: { var viewModel = new DraftTenderAboveThresholdUAViewModel(tender); return(View("InfoAboveThresholdUA", viewModel)); } case ProcurementMethodType.ABOVE_THRESHOLD_EU: { var viewModel = new DraftTenderAboveThresholdEUViewModel(tender); return(View("InfoAboveThresholdEU", viewModel)); } case ProcurementMethodType.REPORTING: { var viewModel = new DraftTenderLimitedReportingViewModel(tender); return(View("InfoTenderLimitedReporting", viewModel)); } case ProcurementMethodType.NEGOTIATION: { var viewModel = new DraftTenderLimitedViewModel(tender); return(View("InfoTenderLimited", viewModel)); } case ProcurementMethodType.NEGOTIATION_QUICK: { var viewModel = new DraftTenderLimitedQuickViewModel(tender); return(View("InfoTenderLimitedQuick", viewModel)); } case ProcurementMethodType.ABOVE_THRESHOLD_UA_DEFENSE: { var viewModel = new DraftTenderDefenseViewModel(tender); return(View("InfoTenderDefense", viewModel)); } default: { var viewModel = new DraftTenderBelowThresholdViewModel(tender); return(View("InfoBelowThreshold", viewModel)); } } throw new BadRequestException(); }
public ActionResult AddTender() { var viewModel = new DraftTenderDefenseViewModel(); return(View(viewModel)); }