Example #1
0
        public ActionResult EditStudent(int Id)
        {
            oprEntities   editdb      = new oprEntities();
            Student_Table editstudent = editdb.Student_Table.Find(Id);

            return(View(editstudent));
        }
Example #2
0
        public ActionResult EditView(int id)
        {
            Models.oprEntities db        = new oprEntities();
            Section            Sectiondt = db.Sections.Find(id);

            return(View(Sectiondt));
        }
Example #3
0
        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));
        }
Example #4
0
        public ActionResult AddStudent(Student_Table studtbl)
        {
            oprEntities studdb = new oprEntities();

            studdb.Student_Table.Add(studtbl);
            studdb.SaveChanges();
            return(View());
        }
Example #5
0
        public ActionResult AddSchool(opr.Models.School sch)
        {
            Models.oprEntities db = new oprEntities();

            db.Schools.Add(sch);
            db.SaveChanges();
            return(View());
        }
Example #6
0
        // 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));
        }
Example #7
0
        // GET: Group
        public ActionResult Index()
        {
            oprEntities  dbgrp       = new oprEntities();
            List <Group> listOfGroup = new List <Group>();
            var          saveGroup   = dbgrp.Groups.ToList();

            return(View(saveGroup));
        }
Example #8
0
        // GET: School
        public ActionResult Index()
        {
            Models.oprEntities   db    = new oprEntities();
            List <Models.School> model = new List <School>();

            model = db.Schools.ToList();
            return(View(model));
        }
Example #9
0
        public ActionResult EditClass(int id)
        {
            ViewBag.ModifiedBy = User.Identity.GetUserName();
            Models.oprEntities db    = new oprEntities();
            ClassesTable       edata = db.ClassesTables.Find(id);


            return(View(edata));
        }
Example #10
0
        // 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));
        }
Example #11
0
        public ActionResult SectionDetail()
        {
            Models.oprEntities     db    = new oprEntities();
            IList <Models.Section> model = new List <Section>();

            model = db.Sections.ToList();

            return(View(model));
        }
Example #12
0
        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));
        }
Example #13
0
        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"));
        }
Example #14
0
        // 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));
        }
Example #15
0
        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"));
        }
Example #16
0
        public ActionResult DeleteGroup(int Id)
        {
            oprEntities obj = new oprEntities();
            Group       grp = obj.Groups.Find(Id);

            obj.Groups.Remove(grp);
            obj.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #17
0
        public ActionResult AddCampus(Campus_Table tabl)
        {
            oprEntities camdb = new oprEntities();

            camdb.Campus_Table.Add(tabl);
            camdb.SaveChanges();

            return(View());
        }
Example #18
0
        //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));
        }
Example #19
0
        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));
        }
Example #20
0
        public ActionResult AddStudent(opr.Models.StudentTable model)
        {
            oprEntities db = new oprEntities();


            db.StudentTables.Add(model);

            db.SaveChanges();
            return(View());
        }
Example #21
0
        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"));
        }
Example #22
0
        public ActionResult AddGroup(opr.Models.Group mod)
        {
            oprEntities dbgrp = new oprEntities();

            dbgrp.Groups.Add(mod);
            dbgrp.SaveChanges();


            return(View());
        }
Example #23
0
        public ActionResult AddClass(opr.Models.ClassesTable model)
        {
            oprEntities db = new oprEntities();


            db.ClassesTables.Add(model);

            db.SaveChanges();
            return(View());
        }
Example #24
0
        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"));
        }
Example #25
0
        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));
        }
Example #26
0
        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"));
        }
Example #27
0
        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()));
        }
Example #28
0
        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));
        }
Example #29
0
 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));
 }
Example #30
0
 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));
 }