public ActionResult Percentage(Guid id, PercentageViewModel model, bool?backToOverview = null) { if (!ModelState.IsValid) { return(View(model)); } TempData.Add(PercentageKey, Convert.ToDecimal(model.PercentageRecoverable)); return(RedirectToAction("EstimatedValue", "WasteRecovery", new { backToOverview })); }
public async Task <ActionResult> Percentage(Guid id, bool?backToOverview = null) { var percentageRecoverable = await mediator.SendAsync(new GetRecoverablePercentage(id)); var model = new PercentageViewModel { PercentageRecoverable = percentageRecoverable.ToString() }; return(View(model)); }
public static ICalculate OperationType(object sign) { ICalculate Operation = null; switch (sign) { case "+": Operation = new AddViewModel(); break; case "-": Operation = new SubtractionViewModel(); break; case "*": Operation = new MultiplicationViewodel(); break; case "/": Operation = new DivideVieModel(); break; case "^": Operation = new PowerViewModel(); break; case "%": Operation = new PercentageViewModel(); break; case "\\": Operation = new SqrtViewModel(); break; case "r": Operation = new RemainderViewModel(); break; default: throw new NotImplementedException("Not Implemented Yet"); } return(Operation); }
public Percentage() { InitializeComponent(); DataContext = new PercentageViewModel(); }