public ActionResult Create(int ListTableID) { GetData(); ViewBag.BeginDate = DateTime.Today; ViewBag.ListTableID = ListTableID; listtable table = ListTableRepository.GetListByID(ListTableID); if (table == null) { return(Content("Table not found")); } ViewBag.TableName = string.Format("Add record to table ({0})", table.Title); listheader header = ListHeaderRepository.GetByListTableID(ListTableID); ViewBag.TableHeaderID = header.ListHeaderID; ViewBag.Type1 = header.Type1; ViewBag.Type2 = header.Type2; ViewBag.Type3 = header.Type3; ViewBag.Type4 = header.Type4; ViewBag.Type5 = header.Type5; ViewBag.Type6 = header.Type6; ViewBag.Type7 = header.Type7; ViewBag.Type8 = header.Type8; ViewBag.Type9 = header.Type9; ViewBag.Type10 = header.Type10; return(PartialView(new listitem { DateEntered = System.DateTime.Today, EnteredBy = User.Identity.Name.ToString(), listTableID = ListTableID, Status = "Active" })); }
public ActionResult Edit(int ListTableID) { listtable listtable = ListTableRepository.GetListByID(ListTableID); GetData(listtable.ministryID); ViewBag.TableHeader = string.Format("Edit Table ({0})", listtable.Title); return(PartialView(listtable)); }