Exemplo n.º 1
0
        public void AddVisite(ReceptionViewModel visit)
        {
            string date = visit.VisiteDate + " " + visit.VisiteTime;

            db.Visites.Add(new Visite
            {
                PatientId = visit.PatientId,
                VisiteDate = DateTime.Parse(date),
                Description = visit.Description,
                DoctorId = visit.DoctorId
            });
            db.SaveChanges();
        }
 public ActionResult Reception(ReceptionViewModel visit)
 {
     if (ModelState.IsValid)
     {
         Service serv = new Service();
         serv.AddVisite(visit);
         ViewBag.DoctorName = serv.GetDoctorBySpecializationId(visit.MedicalSpecializationId);
         ViewBag.DoctorSpecialization = serv.GetMedicalSpecialization(visit.MedicalSpecializationId);
         ViewBag.PatientName = serv.GetPatienName(visit.PatientId);
     }
     return Redirect("Administration/Reception");
 }