public ActionResult Index(CalcView input) { if (ModelState.IsValid) { CalcModel.CalcPay calc = new CalcModel.CalcPay(); calc.CountPayment = input.CountPayment; calc.ExchangeRate = input.ExchangeRate; calc.FirstDate = input.FirstDate; calc.NDS = input.NDS; calc.Sum = input.Sum; input.PaymentShedule = calc.PaymentShedule(); input.TotalSum = calc.GetTotalSum(); return(View(input)); } return(View()); }
public CalcController() { num1 = 0; onRun = true; CalcView newView = new CalcView(); CalcModel newModel = new(); newView.startApp(); while (onRun) { num1 = newView.getNumber(); num2 = newView.getNumber(); oper = newView.getOperation(); newModel.Number1 = num1; newModel.Number2 = num2; rslt = newModel.doCalculation(oper); onRun = newView.showResult(rslt); } }
public CalcViewModel BuildViewModel(string viewPrice, string viewOwnership) { var clats = _context.Clats.OrderBy(x => x.To).ThenBy(x => x.To).ToList(); var properties = _context.CostProperties.ToList(); decimal price; decimal.TryParse(viewPrice, out price); var modelView = new CalcView() { Price = price, OwnershipForm = viewOwnership }; var model = new CalcViewModel() { ModelCalcView = modelView, ClatList = clats, CostPropertiesList = properties }; return(model); }
public void Test() { CalcView.Repl(); }
public void GivenCalculatorAppIsInitialized() { AppInit.StartApp(); calc = new CalcView(); }