public ActionResult XuLyTinhTich(SoNguyenModel entity) { if (ModelState.IsValid) { int kq = entity.SoA * entity.SoB * entity.SoC; TempData["KetQua"] = string.Format("Kết quả: {0} x {1} x {2} = {3}", entity.SoA, entity.SoB, entity.SoC,kq); return RedirectToAction("PhepTinh2"); } return View("PhepTinh2", entity); }
public ActionResult XuLyTinhTong(SoNguyenModel entity) { if (ModelState.IsValid) { int kq = entity.SoA + entity.SoB + entity.SoC; //Truyền dữ liệu sang view TempData["KetQua"] = string.Format("Kết quả: {0} + {1} + {2} = {3}", entity.SoA, entity.SoB, entity.SoC, kq); // Điều hướng sang action "PhepTinh2" return RedirectToAction("PhepTinh2"); } return View("PhepTinh2", entity); }