示例#1
0
        //public void sendSMS()
        //{

        //}

        public void sendNotification()
        {
            //PatientBusiness pb = new PatientBusiness();
            //BookingBusiness bb = new BookingBusiness();
            Booking                b   = new Booking();
            Notification           n   = new Notification();
            bookingPatient         bp  = new bookingPatient();
            Email_serviceViewModel es  = new Email_serviceViewModel();
            Email_serviceBusiness  esb = new Email_serviceBusiness();

            //var booknotif= bb.GetAllBookings();
            var brepo = new BookingRepository();

            foreach (Booking p in brepo.GetAll())
            {
                int day   = Convert.ToDateTime(p.Time_start).Date.Day;
                int month = Convert.ToDateTime(p.Time_start).Date.Month;
                int year  = Convert.ToDateTime(p.Time_start).Date.Year;
                if (p.notificationStatus != true)
                {
                    if (month == DateTime.Now.Month && year == DateTime.Now.Year)
                    {
                        if (day - 1 == Convert.ToInt32(DateTime.Now.Day))
                        {
                            es.To      = p.Email;
                            es.Subject = "Reminder";
                            es.Body    = "Good day dear " + p.PatientFullName + "<br/>" + "We want to remind you that you have an appointement tomorrow at " + p.Time + " at Glenwood Medical Centre";
                            esb.createemail(es);
                        }
                    }
                    p.notificationStatus = true;
                    brepo.Update(p);
                }
            }
        }
示例#2
0
 public ActionResult BookPatient(bookingPatient bo)
 {
     try
     {
         // b.SaveBooking(bo);
         return(RedirectToAction("ScheduleDate", "Calendar", new { id = Convert.ToInt32(System.Web.HttpContext.Current.Session["bookingId"]) }));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
        public ActionResult Details(bookingPatient m)
        {
            string dat = b.DateOfBooking(m.identification);

            if (b.GetBookingDetails(m.identification) == true)
            {
                //int id = Convert.ToInt16( System.Web.HttpContext.Current.Session["ide"] );
                ViewBag.Error = "Can't book a patient twice in a day";
                return(View(b.FindPatientDetails(m.PatientIdKey)));
            }
            b.SaveBooking(m);
            //int d = Convert.ToInt32(System.Web.HttpContext.Current.Session["ide"]);
            return(RedirectToAction("ScheduleDate", "Calendar", new { id = m.PatientIdKey }));
        }
示例#4
0
        public ActionResult Create(bookingPatient bo)
        {
            try
            {
                // TODO: Add insert logic here
                b.resquestBooking(bo);

                TempData["msg"] = "Dear  " + bo.FullName + " your resquest is being Process and you will receive an email shortly";
                return(RedirectToAction("succussfully", "Booking"));
            }
            catch
            {
                TempData["Msg"] = "Dear  " + bo.FullName + "an error occured during the process please try again";
                return(View());
            }
        }
示例#5
0
        public bookingPatient GetSaveBooking(int id)
        {
            bookingPatient bo  = new bookingPatient();
            string         nat = new PatientRepository().GetById(id).NationalId;

            using (var bookpro = new BookingRepository())
            {
                Booking _booking = bookpro.GetAll().Find(x => x.PatientID.Equals(nat));
                // bo.BookingId = _booking.BookingId;
                bo.FullName = _booking.PatientFullName;

                bo.identification = _booking.PatientID;
                bo.date           = _booking.Date;
                bo.bookingStatus  = _booking.bookingStatus;
                return(bo);
            }
        }
示例#6
0
        public bookingPatient FindPatientDetails(int?id)
        {
            bookingPatient rm = new bookingPatient();

            using (var parepo = new PatientRepository())
            {
                if (id.HasValue && id != 0)
                {
                    Patient _patient = parepo.GetById(id.Value);
                    rm.FullName       = _patient.FullName;
                    rm.Email          = _patient.Email;
                    rm.Telephone      = _patient.Telephone;
                    rm.identification = _patient.NationalId;
                    rm.PatientIdKey   = id.Value;
                }
                return(rm);
            }
        }
示例#7
0
        public bookingPatient GetBooking(int?id)
        {
            bookingPatient bo = new bookingPatient();

            using (var bookpro = new BookingRepository())
            {
                Booking _booking = bookpro.GetById(id.Value);

                bo.BookingId = _booking.BookingId;
                bo.FullName  = _booking.PatientFullName;
                bo.Email     = _booking.Email;
                bo.date      = _booking.Date;

                bo.time       = _booking.Time;
                bo.start_date = _booking.Time_start;
                bo.end_date   = _booking.Time_end;
                return(bo);
            }
        }
示例#8
0
        // Display the information of the patient
        #region Create a resquest booking Booking

        public void resquestBooking(bookingPatient model)
        {
            using (var bookpro = new BookingRepository())
            {
                if (model.BookingId == 0)
                {
                    Booking _booking = new Booking
                    {
                        BookingId       = model.BookingId,
                        PatientFullName = model.FullName,
                        PatientID       = model.identification,
                        Email           = model.Email,
                        Telephone       = model.Telephone,
                        Physician       = model.Physician,
                        Date            = model.date
                    };
                    bookpro.Insert(_booking);
                }
            }
        }
示例#9
0
 public void booking(bookingPatient model, int PatientId)
 {
     using (var bookpro = new BookingRepository())
     {
         if (model.BookingId == 0)
         {
             Booking _booking = new Booking
             {
                 BookingId       = model.BookingId,
                 PatientFullName = model.FullName,
                 PatientID       = model.identification,
                 Email           = model.Email,
                 Telephone       = model.Telephone,
                 Physician       = model.Physician,
                 Date            = model.date,
                 Status          = 0,
                 PatientIdKey    = PatientId
             };
             bookpro.Insert(_booking);
             System.Web.HttpContext.Current.Session["bookingId"] = _booking.BookingId;
         }
     }
 }
示例#10
0
 public void SaveBooking(bookingPatient model)
 {
     using (var bookpro = new BookingRepository())
     {
         if (model.BookingId == 0)
         {
             Booking _booking = new Booking
             {
                 BookingId       = model.BookingId,
                 PatientFullName = model.FullName,
                 PatientID       = model.identification,
                 Email           = model.Email,
                 Date            = DateTime.Today.ToString(),
                 Telephone       = model.Telephone,
                 Physician       = model.Physician,
                 bookingStatus   = "None",
                 PatientIdKey    = model.PatientIdKey
             };
             bookpro.Insert(_booking);
             System.Web.HttpContext.Current.Session["bookingId"] = _booking.BookingId;
         }
     }
 }