示例#1
0
 public IActionResult UpdateStudent(String id)
 {
     if (db.Student.Where(s => s.IndexNumber == id).Any())
     {
         var res = db.Student.SingleOrDefault(s => s.IndexNumber == id);
         res.Modified = DateTime.Now;
         db.SaveChanges();
         return(Ok("Zmodyfikowano " + DateTime.Now));
     }
     return(NotFound("Podano zly index"));
 }
示例#2
0
        public IActionResult AddDoctor(Doctors doctors)
        {
            var db = new s18967Context();

            doctors.Email = "*****@*****.**";
            db.Doctors.Add(doctors);
            db.SaveChanges();
            return(RedirectToAction("IdDoctor"));
        }