Ejemplo n.º 1
0
        public ActionResult PatientVerification(Guid accId)
        {
            PatientProcess   process = new PatientProcess();
            PatientViewModel vm      = new PatientViewModel();

            vm.AccId = accId;
            int result = process.PatientVerification(vm);

            TempData["Verified"] = "Verified";

            if (result == 1)
            {
                TempData["Verified"] = "Verified";
                return(View());
            }
            else
            {
                //throw error page
                TempData["Verified"] = "Error";
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult MakeAppointment(AppointmentModel appointmentModel)
        {
            TempData["Rejected"]  = "";
            TempData["DateRange"] = "";

            if (ModelState.IsValid)
            {
                if (appointmentModel.AppointmentDate >= DateTime.Now)
                {
                    appointmentModel.AppointmentDate = appointmentModel.AppointmentDate + appointmentModel.AppointmentTime;
                    PatientProcess process = new PatientProcess();
                    int            result  = process.MakeAppointment(appointmentModel);
                    if (result == 1)         //success
                    {
                        return(Content(@"<body>
                       <script type='text/javascript'>
                         if(confirm('Appointment is made successfully. Please wait and check your email for practitioner approval. Press ok to close this tab.')){ window.close(); };
                       </script>
                     </body> "));
                    }
                    else if (result == -1)   //rejected
                    {
                        TempData["Rejected"] = "Rejected";
                        return(View());
                    }
                    else                    //failed
                    {
                        return(View());
                    }
                }
                else
                {
                    TempData["DateRange"] = "DateRange";
                }
            }

            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult ProfileEdit(PatientBaseViewModel vm, Guid accId)
        {
            PatientBaseViewModel result = new PatientBaseViewModel();

            result.AccId = accId;

            PatientProcess process     = new PatientProcess();
            int            returnValue = process.ProfileEdit(vm);


            if (returnValue != 0)
            {
                return(RedirectToAction("Home", "Patient", result));
            }
            else
            {
                return(Content(@"<body>
                           <script type='text/javascript'>
                             if(confirm('Profile is not updated successfully. Press Ok to try again.')){ window.history.back(); };
                           </script>
                         </body> "));
            }
        }
Ejemplo n.º 4
0
        public ActionResult PatientRegister(PatientViewModel newUser)
        {
            PatientProcess process = new PatientProcess();

            TempData["ConflictEmailAddress"] = "";

            if (Request.Form["Submit"] != null)
            {
                if (newUser.EmailAddress.Equals(newUser.ReconfirmEmail) && newUser.Password.Equals(newUser.RetypePassword))
                {
                    if (ModelState.IsValid)
                    {
                        int result = process.PatientRegister(newUser);

                        if (result == 1)
                        {
                            return(RedirectToAction("AccCreateSuccess", "HomePage", null));
                        }
                        else if (result == 2)
                        {
                            TempData["ConflictEmailAddress"] = "ConflictEmailAddress";
                            return(View(newUser));
                        }
                        else
                        {
                            return(View(newUser));
                        }
                    }
                }
                else
                {
                    return(View(newUser));
                }
            }
            return(View(newUser));
        }