public ActionResult CancelUserAppointment(int id, int chamberId, int userId, string mobileNo)
 {
     if (User.IsInRole("Doctor"))
     {
         if (id != 0 && userId != 0 && mobileNo != null)
         {
             int    doctorId = GetDoctorData().Id;
             string message  = aDoctorManager.CancelUserAppointment(id, doctorId, userId, mobileNo);
             if (message == "Success")
             {
                 BookAppointment bookAppointInfo = new BookAppointment();
                 bookAppointInfo.BookAppointId = id;
                 bookAppointInfo.DoctorId      = doctorId;
                 bookAppointInfo.ChamberId     = chamberId;
                 bookAppointInfo.UserId        = userId;
                 SendCencelMessageToUser(mobileNo, bookAppointInfo);
                 TempData["Message"] = "Appointment canceled successfully";
             }
             else
             {
                 TempData["ErrorMessage"] = message;
             }
         }
     }
     return(RedirectToAction("Index", "Doctor"));
 }
Пример #2
0
 public ActionResult CancelAppointment(int id, int doctorId)
 {
     if (User.IsInRole("User"))
     {
         if (id != 0 && doctorId != 0)
         {
             int    userId   = GetUserData().UserId;
             string mobileNo = GetUserData().MobileNo;
             string message  = aDoctorManager.CancelUserAppointment(id, doctorId, userId, mobileNo);
             if (message == "Success")
             {
                 TempData["Message"] = "Appointment canceled successfully";
             }
             else
             {
                 TempData["ErrorMessage"] = message;
             }
         }
     }
     return(RedirectToAction("Index", "User"));
 }