Exemplo n.º 1
0
 public IActionResult AddPermanentTeacher(PermanentTeacher r)
 {
     if (ModelState.IsValid)
     {
         PermanentTeacher t = new PermanentTeacher();
         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.PermanentTeacher.Add(t);
         db.SaveChanges();
     }
     return(Redirect("ViewPermanentTeacherList"));
 }
Exemplo n.º 2
0
 public IActionResult EditPermanentTeacher(PermanentTeacher f)
 {
     if (ModelState.IsValid)
     {
         PermanentTeacher t = new PermanentTeacher();
         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.PermanentTeacher.Update(t);
         db.SaveChanges();
     }
     return(RedirectToAction("ViewPermanentTeacherList"));
 }
Exemplo n.º 3
0
        public IActionResult ViewPermanentTeacherList()
        {
            var test = db.PermanentTeacher;
            var i    = new List <PermanentTeacher>();

            foreach (var f in test)
            {
                PermanentTeacher t = new PermanentTeacher();
                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));
        }