Beispiel #1
0
 public IActionResult EditBanComStudent(BanComStudent s)
 {
     if (ModelState.IsValid)
     {
         BanComStudent t = new BanComStudent();
         t.StudentId        = s.StudentId;
         t.StudentName      = s.StudentName;
         t.Department       = s.Department;
         t.PresentAddress   = s.PresentAddress;
         t.PermanentAddress = s.PermanentAddress;
         t.Contact          = s.Contact;
         t.Email            = s.Email;
         db.BanComStudent.Update(t);
         db.SaveChanges();
     }
     return(RedirectToAction("ViewBanComStudentList"));
 }
Beispiel #2
0
        public IActionResult ViewBanComStudentList()
        {
            var test = db.BanComStudent;
            var i    = new List <BanComStudent>();

            foreach (var s in test)
            {
                BanComStudent t = new BanComStudent();
                t.StudentId        = s.StudentId;
                t.StudentName      = s.StudentName;
                t.Department       = s.Department;
                t.PresentAddress   = s.PresentAddress;
                t.PermanentAddress = s.PermanentAddress;
                t.Contact          = s.Contact;
                t.Email            = s.Email;
                i.Add(t);
            }
            return(View(i));
        }