public ActionResult EditStudent(int Id) { oprEntities editdb = new oprEntities(); Student_Table editstudent = editdb.Student_Table.Find(Id); return(View(editstudent)); }
public ActionResult EditView(int id) { Models.oprEntities db = new oprEntities(); Section Sectiondt = db.Sections.Find(id); return(View(Sectiondt)); }
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 AddStudent(Student_Table studtbl) { oprEntities studdb = new oprEntities(); studdb.Student_Table.Add(studtbl); studdb.SaveChanges(); return(View()); }
public ActionResult AddSchool(opr.Models.School sch) { Models.oprEntities db = new oprEntities(); db.Schools.Add(sch); db.SaveChanges(); return(View()); }
// GET: Campus public ActionResult Index() { oprEntities camdb = new oprEntities(); List <Campus_Table> listOfCampus = new List <Campus_Table>(); var list = camdb.Campus_Table.ToList(); return(View(list)); }
// GET: Group public ActionResult Index() { oprEntities dbgrp = new oprEntities(); List <Group> listOfGroup = new List <Group>(); var saveGroup = dbgrp.Groups.ToList(); return(View(saveGroup)); }
// GET: School public ActionResult Index() { Models.oprEntities db = new oprEntities(); List <Models.School> model = new List <School>(); model = db.Schools.ToList(); return(View(model)); }
public ActionResult EditClass(int id) { ViewBag.ModifiedBy = User.Identity.GetUserName(); Models.oprEntities db = new oprEntities(); ClassesTable edata = db.ClassesTables.Find(id); return(View(edata)); }
// GET: Classes public ActionResult Index() { Models.oprEntities dt = new oprEntities(); List <Models.ClassesTable> model = new List <ClassesTable>(); model = dt.ClassesTables.Where(r => r.IsActive == true && r.IsDeleted == true).ToList(); return(View(model)); }
public ActionResult SectionDetail() { Models.oprEntities db = new oprEntities(); IList <Models.Section> model = new List <Section>(); model = db.Sections.ToList(); return(View(model)); }
public ActionResult AddStudent() { Models.oprEntities dt = new oprEntities(); List <Models.StudentTable> model = new List <StudentTable>(); model = dt.StudentTables.ToList(); ViewBag.UserId = User.Identity.GetUserId(); return(View(model)); }
public ActionResult DeleteStudent(int Id) { oprEntities deletedb = new oprEntities(); Student_Table delete = deletedb.Student_Table.Find(Id); deletedb.Student_Table.Remove(delete); deletedb.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Student public ActionResult Index() { oprEntities studDb = new oprEntities(); List <Student_Table> listOfStudent = new List <Student_Table>(); var list = studDb.Student_Table.ToList(); return(View(list)); }
public ActionResult Delete(int id) { Models.oprEntities sub = new oprEntities(); School student_table = sub.Schools.Find(id); sub.Schools.Remove(student_table); sub.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteGroup(int Id) { oprEntities obj = new oprEntities(); Group grp = obj.Groups.Find(Id); obj.Groups.Remove(grp); obj.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddCampus(Campus_Table tabl) { oprEntities camdb = new oprEntities(); camdb.Campus_Table.Add(tabl); camdb.SaveChanges(); return(View()); }
//public ActionResult DeleteData(int id) //{ // Models.oprEntities db = new oprEntities(); // Section Sectiondt = db.Sections.Find(id); // db.Sections.Remove(Sectiondt); // db.SaveChanges(); // return RedirectToAction("SectionDetail"); //} //public ActionResult DeleteData(int id) //{ // Models.oprEntities db = new oprEntities(); // Section Sectiondt = db.Sections.Find(id); // return View(Sectiondt); // //var user = new User() { Id = userId, Password = password }; // //using (var db = new MyEfContextName()) // //{ // // db.Users.Attach(user); // // db.Entry(user).Property(x => x.Password).IsModified = true; // // db.SaveChanges(); // //} // //return RedirectToAction("Index"); //} public ActionResult DeleteData(int id) { Section model = new Section(); model.IsDeleted = true; Models.oprEntities db = new oprEntities(); Section Sectiondt = db.Sections.Find(id); return(View(Sectiondt)); }
public ActionResult EditGroup(int Id) { ViewBag.date = DateTime.Now; ViewBag.ids = User.Identity.GetUserId(); ViewBag.name = User.Identity.Name; oprEntities grdata = new oprEntities(); Group edata = grdata.Groups.Find(Id); return(View(edata)); }
public ActionResult AddStudent(opr.Models.StudentTable model) { oprEntities db = new oprEntities(); db.StudentTables.Add(model); db.SaveChanges(); return(View()); }
public ActionResult DeleteCampus(int Id) { oprEntities camdb = new oprEntities(); Campus_Table deletecam = camdb.Campus_Table.Find(Id); camdb.Campus_Table.Remove(deletecam); camdb.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddGroup(opr.Models.Group mod) { oprEntities dbgrp = new oprEntities(); dbgrp.Groups.Add(mod); dbgrp.SaveChanges(); return(View()); }
public ActionResult AddClass(opr.Models.ClassesTable model) { oprEntities db = new oprEntities(); db.ClassesTables.Add(model); db.SaveChanges(); return(View()); }
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 EditCampus(int Id) { ViewBag.userName = User.Identity.Name; ViewBag.idcam = User.Identity.GetUserId(); ViewBag.date = DateTime.Now; oprEntities camdb = new oprEntities(); Campus_Table camdata = camdb.Campus_Table.Find(Id); return(View(camdata)); }
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 Index(opr.Models.Section model) { model.IsDeleted = true; model.IsActive = true; opr.Models.oprEntities db = new oprEntities(); db.Sections.Add(model); db.SaveChanges(); return(View(new Section())); }
public ActionResult EditSchool(int id) { Models.oprEntities obj = new oprEntities(); ViewBag.modifiedBy = User.Identity.Name; var eid = obj.Schools.Where(w => w.Id == id).FirstOrDefault(); if (obj == null) { return(RedirectToAction("Index")); } return(View(eid)); }
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 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)); }