public ActionResult SympType() { List <SympType> CategoryList = new List <SympType>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchSympType"; ds = dl.FetchSympType_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { SympType m = new SympType(); m.SympTypeId = item["SympTypeId"].ToString(); m.SymptomsType = item["SymptomsType"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }
public ActionResult SympType(SympType c) { try { if (dl.InsertSympType_Sp(c) > 0) { TempData["MSG"] = "Data Saved Successfully"; } } catch (Exception ex) { TempData["MSG"] = "Something went wrong."; return(Redirect("/Setup/SympType")); } TempData["MSG"] = "Data Saved Successfully."; return(Redirect("/Setup/SympType")); }