Exemple #1
0
        protected virtual void PrepareDoctorReviewModel(AdminDocorReviewModel model,
                                                        DoctorReview doctorReview, bool excludeProperties, bool formatReviewText)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            if (doctorReview == null)
            {
                throw new ArgumentNullException("doctorReview");
            }

            model.Id         = doctorReview.Id;
            model.DoctorId   = doctorReview.DoctorId;
            model.DoctorName = "Dr." + doctorReview.Doctor.AspNetUser.FirstName + " " + doctorReview.Doctor.AspNetUser.LastName;
            model.PatientId  = doctorReview.PatientId;
            var patient = doctorReview.Patient;

            model.PatientInfo = (patient != null) ? patient.FirstName + " " + patient.LastName : "None";
            // model.PatientInfo = patient.IsRegistered() ? patient.Email : _localizationService.GetResource("Admin.Customers.Guest");
            model.Rating    = doctorReview.Rating;
            model.ReplyText = doctorReview.ReplyText;
            model.CreatedOn = ConvertToUserTime(doctorReview.CreatedOnUtc, DateTimeKind.Utc);
            if (!excludeProperties)
            {
                model.Title      = doctorReview.Title;
                model.ReviewText = doctorReview.ReviewText;
                model.IsApproved = doctorReview.IsApproved;
            }
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            DoctorReview doctorReview = db.DoctorReviews.Find(id);

            db.DoctorReviews.Remove(doctorReview);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        private void CollectAnswers()
        {
            DoctorReview review = CreateReview();

            _appointmentForReviewing.HasBeenReviewed = true;
            _appointmentForReviewing.Doctor.Ratings.Add((int)comboBoxRating.SelectedItem);
            _loggedInPatient.DoctorReviews.Add(review);
        }
        /// <summary>
        /// Deletes a doctor review
        /// </summary>
        /// <param name="doctorReview">Doctor review</param>
        public virtual void DeleteDoctorReview(DoctorReview doctorReview)
        {
            if (doctorReview == null)
            {
                throw new ArgumentNullException("doctorReview");
            }

            _doctorReviewRepository.Delete(doctorReview);
        }
Exemple #5
0
        private DoctorReview CreateReview()
        {
            DoctorReview review = new DoctorReview();

            review.Answers = GetAnswers();
            review.Rating  = (int)comboBoxRating.SelectedItem;
            review.Doctor  = _appointmentForReviewing.Doctor;
            return(review);
        }
Exemple #6
0
 public ActionResult Edit([Bind(Include = "ID,UserID,DoctorID,Review,Rating,IsActive")] DoctorReview doctorReview)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctorReview).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserID   = new SelectList(db.AspNetUsers, "Id", "Email", doctorReview.UserID);
     ViewBag.DoctorID = new SelectList(db.Doctors, "ID", "NameEN", doctorReview.DoctorID);
     return(View(doctorReview));
 }
Exemple #7
0
        //GET: Create
        public async Task <IActionResult> Create(int doctorId)
        {
            Doctor doctor =
                await _db.Doctor.Include(t => t.MedicalField).Where(t => t.Id == doctorId).FirstOrDefaultAsync();

            DoctorReview doctorReview = new DoctorReview();

            doctorReview.DoctorId = doctorId;
            doctorReview.Doctor   = doctor;

            return(View(doctorReview));
        }
Exemple #8
0
        // GET: DoctorReviews/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoctorReview doctorReview = db.DoctorReviews.Find(id);

            if (doctorReview == null)
            {
                return(HttpNotFound());
            }
            return(View(doctorReview));
        }
Exemple #9
0
        // GET: DoctorReviews/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoctorReview doctorReview = db.DoctorReviews.Find(id);

            if (doctorReview == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserID   = new SelectList(db.AspNetUsers, "Id", "Email", doctorReview.UserID);
            ViewBag.DoctorID = new SelectList(db.Doctors, "ID", "NameEN", doctorReview.DoctorID);
            return(View(doctorReview));
        }
Exemple #10
0
        public async Task <IActionResult> Create(DoctorReview doctorReview)
        {
            if (!ModelState.IsValid)
            {
                return(View(doctorReview));
            }

            var claimsIdentity = (ClaimsIdentity)this.User.Identity;
            var claim          = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);

            doctorReview.CreateUserId = claim.Value;
            doctorReview.CreateDate   = DateTime.Now;

            doctorReview.Doctor =
                await _db.Doctor.Where(t => t.Id == doctorReview.DoctorId).FirstOrDefaultAsync();

            _db.DoctorReview.Add(doctorReview);
            await _db.SaveChangesAsync();

            return(RedirectToAction(nameof(Index), "Doctor", new { MedicalFieldId = doctorReview.Doctor.MedicalFieldId }));
        }
 public DoctorReview EvaluateDoctor(DoctorReview doctorReview) => doctorReviewService.EvaluateDoctor(doctorReview);
Exemple #12
0
 public DoctorReview EvaluateDoctor(DoctorReview doctorReview) => doctorReviewRepository.Create(doctorReview);