Exemple #1
0
        // GET: Students/Create
        public ActionResult Create()
        {
            DeptRepo repo = new DeptRepo();

            ViewBag.Dept = new SelectList(repo.GetDept(), "DeptId", "Name");
            return(View());
        }
Exemple #2
0
        // GET: Students/Edit/5
        public ActionResult Edit(int id)
        {
            StudentRepo repo  = new StudentRepo();
            DeptRepo    drepo = new DeptRepo();

            ViewBag.Dept = new SelectList(drepo.GetDept(), "DeptId", "Name");
            return(View(repo.GetStudent().ToList().Find(d => d.StudentId == id)));
        }
Exemple #3
0
        public ActionResult Index()
        {
            DeptRepo repo = new DeptRepo();

            ModelState.Clear();

            return(View(repo.GetDept()));
        }
Exemple #4
0
        public ActionResult Edit(int id)
        {
            DeptRepo repo = new DeptRepo();

            return(View(repo.GetDept().Find(d => d.DeptId == id)));
        }