コード例 #1
0
ファイル: PatientController.cs プロジェクト: nigellin/wdt_a2
        public ActionResult Create(Patient patient)
        {
            if (ModelState.IsValid)
            {
                patient.DateOfRegistration= DateTime.Now;

                db.Patients.Add(patient);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(patient);
        }
コード例 #2
0
ファイル: PatientController.cs プロジェクト: nigellin/wdt_a2
        public ActionResult Edit(Patient patient)
        {
            if (ModelState.IsValid)
            {
                db.Entry(patient).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(patient);
        }
コード例 #3
0
 public Visitation(DateTime date, Patient patient)
 {
     this.Date    = date;
     this.Patient = patient;
 }