// GET: CalculationRegressions/Create public ActionResult Run(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } CalculationRegression calculationRegression = db.CalculationRegression.Find(id); if (calculationRegression == null) { return HttpNotFound(); } var serializer = new XmlSerializer(typeof(Areas.Scheme.Models.Deferred)); object result; using (TextReader reader = new StringReader(calculationRegression.Input)) { result = serializer.Deserialize(reader); } CalculationBaseController Calculation = new CalculationBaseController(); Calculation.Calculate(result, calculationRegression.Scheme, calculationRegression.Type,calculationRegression.Reference, true); return RedirectToAction("Index"); }
public ActionResult RunAll() { CalculationRegression calculationRegression = new CalculationRegression(); var AllCalcs = db.CalculationRegression.ToList(); foreach (var Calc in AllCalcs) { var serializer = new XmlSerializer(typeof(Areas.Scheme.Models.Deferred)); object result; using (TextReader reader = new StringReader(Calc.Input)) { result = serializer.Deserialize(reader); } CalculationBaseController Calculation = new CalculationBaseController(); Calculation.Calculate(result, Calc.Scheme, Calc.Type, Calc.Reference, true); } return RedirectToAction("Index"); }