Пример #1
0
 public IActionResult AddPartTimeTeacher(PartTimeTeacher r)
 {
     if (ModelState.IsValid)
     {
         PartTimeTeacher t = new PartTimeTeacher();
         t.Id          = r.Id;
         t.Name        = r.Name;
         t.Type        = r.Type;
         t.Designation = r.Designation;
         t.Contact     = r.Contact;
         t.Address     = r.Address;
         t.Email       = r.Email;
         db.PartTimeTeacher.Add(t);
         db.SaveChanges();
     }
     return(Redirect("ViewPartTimeTeacherList"));
 }
Пример #2
0
 public IActionResult EditPartTimeTeacher(PartTimeTeacher f)
 {
     if (ModelState.IsValid)
     {
         PartTimeTeacher t = new PartTimeTeacher();
         t.Id          = f.Id;
         t.Name        = f.Name;
         t.Type        = f.Type;
         t.Designation = f.Designation;
         t.Contact     = f.Contact;
         t.Address     = f.Address;
         t.Email       = f.Email;
         db.PartTimeTeacher.Update(t);
         db.SaveChanges();
     }
     return(RedirectToAction("ViewPartTimeTeacherList"));
 }
Пример #3
0
        public IActionResult ViewPartTimeTeacherList()
        {
            var test = db.PartTimeTeacher;
            var i    = new List <PartTimeTeacher>();

            foreach (var f in test)
            {
                PartTimeTeacher t = new PartTimeTeacher();
                t.Id          = f.Id;
                t.Name        = f.Name;
                t.Type        = f.Type;
                t.Designation = f.Designation;
                t.Contact     = f.Contact;
                t.Address     = f.Address;
                t.Email       = f.Email;
                i.Add(t);
            }
            return(View(i));
        }