Example #1
0
        public ActionResult AddDiagnosis(BookViewModel model)
        {
            var book         = new Book();
            var doctorUserId = User.Identity.GetUserId();
            var doctor       = _context.DoctorsRepository.GetBy(d => d.UserId == doctorUserId);

            model.DoctorId       = doctor.Id;
            book                 = Mapper.Map <BookViewModel, Book>(model);
            book.DiagnosticsDate = model.DiagnosticDate;
            _userBll.InitializeBaseModel(book);

            _userBll.AddNewBook(book, model.PatientId);
            var patientUserId = _context.PacientRepository.Get(model.PatientId);

            return(Json(new { newUrl = Url.Action("PatientProfile", "PatientForm", new { patientUserId.UserId }) }));
        }