public ActionResult Confirm(MasonryCalculator MC) { ViewBag.nmb = MasonryCalculator.CalcNumBlocks(MC.WallLength, MC.WallHeight, MC.BlockType); ViewBag.Mortamt = MasonryCalculator.CalcMortarAmount(MC.WallLength, MC.WallHeight, MC.BlockType); MC.AddWallToDB(MC); return View(MC); }
public ActionResult Index(MasonryCalculator MC, string Blocktype, string BlockStrength) { if (ModelState.IsValid) { MC.BlockType = Blocktype; MC.BlockStrength = BlockStrength; return RedirectToAction("Confirm", MC); } else { return View(); } }
public void AddWallToDB(MasonryCalculator MC) { ProjectMunitEntities3 pmu = new ProjectMunitEntities3(); WallInformation walli = new WallInformation(); walli.WallHeight = MC.WallHeight.ToString(); walli.Walllength = MC.WallLength.ToString(); walli.BlockType = MC.BlockType; pmu.WallInformations.Add(walli); pmu.SaveChanges(); }