public ActionResult DeleteThings() { Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Program_Educational_Objs d = new Program_Educational_Objs(); int ids = Convert.ToInt32(Request.QueryString["ids"]); var c = (from p in f.Program_Educational_Objs where p.programEduOutcome_ID == ids select p).FirstOrDefault(); f.Program_Educational_Objs.Remove(c); f.SaveChanges(); return(RedirectToAction("ProgramObj2", "Chairman")); }
public ActionResult ProgramObj2() { Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Program_Educational_Objs d = new Program_Educational_Objs(); var detailList = (from u in f.Core_Value select u); ViewData["cores"] = detailList.ToList(); var proEduOut = (from u in f.Program_Educational_Objs join newer in f.Core_Value on u.coreValue_FK equals newer.coreValue_ID select u); ViewData["listOfProEdu"] = proEduOut.ToList(); return(View()); }
public ActionResult ProgramEduObj(FormCollection fc) { string code = fc["code"].ToString(); string desc = fc["desc"].ToString(); string status = fc["status"].ToString(); int sylid = 1; Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Program_Educational_Objs d = new Program_Educational_Objs(); var coreid = (from u in f.Core_Value where u.name == status select u.coreValue_ID).FirstOrDefault(); ViewBag.code = code; ViewBag.desc = desc; ViewBag.status = status; ViewBag.coreid = coreid; d.objectives = desc; d.codeName = code; d.syllabus_FK = sylid; d.coreValue_FK = Convert.ToInt32(coreid); try { f.Program_Educational_Objs.Add(d); f.SaveChanges(); ViewBag.Result = "Saved"; } catch (Exception e) { ViewBag.Result = e; } return(RedirectToAction("ProgramObj2", "Chairman")); }