public ActionResult EditView(opr.Models.Section model) { Models.oprEntities dbs = new oprEntities(); var mod = dbs.DefTables.Select(s => new { s.TableId, s.TableName }).ToList(); SelectList selectList = new SelectList(mod, "TableName", "TableName"); ViewBag.dataForDropDown = selectList; var mods = dbs.DefControls.Select(c => new { c.ControId, c.ControlName }).ToList(); SelectList selectLists = new SelectList(mods, "ControlName", "ControlName"); ViewBag.dataForDropDowns = selectLists; Models.oprEntities db = new oprEntities(); db.Entry(model).State = System.Data.Entity.EntityState.Modified; try { db.SaveChanges(); return(RedirectToAction("SectionDetail")); } catch { } ModelState.AddModelError("", "Unable to save changes"); return(View(model)); }
public ActionResult DeleteClass(int id) { Models.oprEntities db = new oprEntities(); ClassesTable classdt = db.ClassesTables.Find(id); classdt.IsDeleted = true; db.Entry(classdt).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult IsDelete(int Id) { oprEntities db = new oprEntities(); Group classdt = db.Groups.Find(Id); classdt.IsDeleted = true; db.Entry(classdt).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteData(opr.Models.Section model) { Models.oprEntities db = new oprEntities(); db.Entry(model).State = System.Data.Entity.EntityState.Modified; try { db.SaveChanges(); return(RedirectToAction("SectionDetail")); } catch { } ModelState.AddModelError("", "Unable to save changes"); return(View(model)); }
public ActionResult EditSchool(opr.Models.School schl) { Models.oprEntities sub = new oprEntities(); sub.Entry(schl).State = System.Data.Entity.EntityState.Modified; try { sub.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Unable to save changes made to the entity."); return(View(schl)); }
public ActionResult EditGroup(opr.Models.Group grp) { oprEntities groupData = new oprEntities(); groupData.Entry(grp).State = System.Data.Entity.EntityState.Modified; try { groupData.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Unable to save changes made to the entity."); return(View(grp)); }
public ActionResult EditStudent(Student_Table stutable) { oprEntities editdb = new oprEntities(); editdb.Entry(stutable).State = EntityState.Modified; try { editdb.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Data Cannot edit "); return(View(editdb)); }
public ActionResult EditClass(opr.Models.ClassesTable model) { oprEntities cls = new oprEntities(); model.IsDeleted = true; model.IsActive = true; cls.Entry(model).State = System.Data.Entity.EntityState.Modified; try { cls.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Unable to save changes"); return(View(model)); }
public ActionResult EditCampus(Campus_Table camtbl) { oprEntities camdb = new oprEntities(); camdb.Entry(camtbl).State = EntityState.Modified; try { camdb.SaveChanges(); return(RedirectToAction("Index")); } catch { } ModelState.AddModelError("", "Unable to Save Changes made to the Entity :("); return(View(camtbl)); }