public ActionResult Category() { List <RadiologyCategory> CategoryList = new List <RadiologyCategory>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchRadiologyCategory"; ds = dl.FetchRadiologyCategory_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { RadiologyCategory m = new RadiologyCategory(); m.CategoryId = item["CategoryId"].ToString(); m.CategoryName = item["CategoryName"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }
public ActionResult Category(RadiologyCategory c) { try { if (dl.InsertRadiologyCategory_Sp(c) > 0) { TempData["MSG"] = "Data Saved Successfully"; } } catch (Exception ex) { TempData["MSG"] = "Something went wrong."; return(Redirect("/Radiology/Category")); } TempData["MSG"] = "Data Saved Successfully."; return(Redirect("/Radiology/Category")); }