Beispiel #1
0
 public ActionResult PatientSignUp(RegistrationDetailModel rdm)/*To post the patient Sign in page data  (Working) */
 {
     if (ModelState.IsValid)
     {
         var dbc = new DbConnectivityModel();
         rdm.EmailId  = Request["EmailId"];
         rdm.Password = Request["Password"];
         bool result = dbc.ValidateEmail(rdm.EmailId);
         if (result == true)
         {
             bool outcome = dbc.RegisterPatientInOtp(rdm.EmailId, rdm.Password);
             if (outcome == true)
             {
                 return(RedirectToAction("Login"));
             }
             else
             {
                 return(View());
             }
         }
         else
         {
             ViewBag.Message = "Email Already registered";
             return(View());
         }
     }
     else
     {
         return(View());
     }
 }
        public JsonResult GetSpecialization(string SpecializationId)
        {
            var dbc        = new DbConnectivityModel();
            var Specialist = dbc.ListingSpecialization(SpecializationId);

            return(Json(Specialist, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult Login(RegistrationDetailModel lds)
        {
            var dbc = new DbConnectivityModel();

            lds.EmailId  = Request["UserEmail"];
            lds.Password = Request["Password"];
            bool autheticateUser = dbc.CheckAuthentication(lds);

            if (autheticateUser == true)
            {
                Session["UserId"] = dbc.ReturnUserId(lds.EmailId, lds.Password);                            /*Used Session*/
                int userRole = dbc.ReturnRole(lds.EmailId, lds.Password);
                Session["Role"] = userRole.ToString();
                if (userRole == PatientRole)
                {
                    return(RedirectToAction("SearchLayout", "Profile"));
                }
                else if (userRole == DoctorRole)
                {
                    return(RedirectToAction("SearchLayout", "DoctorsProfile"));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                ViewBag.Message = "Invalid Email Id or Password";
                return(View());
            }
        }
Beispiel #4
0
        public JsonResult ListOfLocalities(string CityName)
        {
            var dbc = new DbConnectivityModel();
            var ListOfLocalities = dbc.ListingLocalities(CityName);

            return(Json(ListOfLocalities, JsonRequestBehavior.AllowGet));
        }
        public JsonResult ListCities(int StateId)
        {
            var dbc        = new DbConnectivityModel();
            var CitiesList = dbc.ListingCities(StateId);

            return(Json(CitiesList, JsonRequestBehavior.AllowGet));
        }
        public JsonResult SpecializationList()
        {
            var dbc        = new DbConnectivityModel();
            var SpeciaList = dbc.ListOutSpecialization();

            return(Json(SpeciaList, JsonRequestBehavior.AllowGet));
        }
        public ActionResult ChangeEmailId(string EmailId, string Password)
        {
            var  dbc    = new DbConnectivityModel();
            var  userId = Session["UserId"].ToString();
            bool result = dbc.ValidateEmail(EmailId);

            if (result == true)
            {
                bool exist = dbc.CheckPassword(Password, userId);
                if (exist == true)
                {
                    bool outcome = dbc.ChangeEmailId(EmailId, Password, userId);
                    if (outcome == true)
                    {
                        return(RedirectToAction("Account"));
                    }
                    else
                    {
                        return(View());
                    }
                }
                else
                {
                    ViewBag.PasswordMessage = "Invalid Password";
                    return(View());
                }
            }
            else
            {
                ViewBag.EmailMessage = "Email ID already Registered";
                return(View());
            }
        }
        public JsonResult GetDetails()
        {
            var dbc     = new DbConnectivityModel();
            var UserId  = Session["UserId"].ToString();
            var details = dbc.AccountDetails(UserId);

            return(Json(details, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UdateAccount(string FullName, string PhoneNumber, DateTime DateOfBirth, string Gender, string BloodGroup)
        {
            var dbc = new DbConnectivityModel();
            //var outcome = dbc.InsertLocality(Locality);
            var userId = Session["UserId"].ToString();
            var result = dbc.UpdateAccountDetails(FullName, PhoneNumber, DateOfBirth, Gender, BloodGroup, userId);

            return(RedirectToAction("Account"));
        }
Beispiel #10
0
        public ActionResult SearchResult()
        {
            var dbc         = new DbConnectivityModel();
            var searchModel = new DoctorsProfileModel
            {
                CityName           = dbc.ListOutCities(),
                SpecializationList = dbc.ListOutSpecialization()
            };

            return(View(searchModel));
        }/*Retrieves the search result*/
Beispiel #11
0
        public ActionResult SearchLayout()
        {
            var dbc         = new DbConnectivityModel();
            var searchModel = new SearchFilterModels
            {
                CityName           = dbc.ListOutCities(),
                SpecializationList = dbc.ListOutSpecialization()
            };

            //ViewBag.CityList = dbc.ListOutCities();
            //ViewBag.SpecializationList = dbc.ListOutSpecialization();
            return(View(searchModel));
        }
        public string CheckEmail(string EmailId)
        {
            var  dbc    = new DbConnectivityModel();
            bool result = dbc.ValidateEmail(EmailId);

            if (result == true)
            {
                string value = " ";
                return(value);
            }
            else
            {
                string value = "Email Id Already Registered ";
                return(value);
            }
        }
 public ActionResult Account()
 {
     if (Session["UserId"] != null /*&& Session["Role"] == DoctorRole*/)
     {
         var dbc       = new DbConnectivityModel();
         var userModel = new UserRegistrationDetail
         {
             CityName = dbc.ListOutCities(),
             State    = dbc.ListOutStates()
         };
         return(View(userModel));
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }
 // GET: Profile
 public ActionResult SearchLayout()
 {
     if (Session["UserId"] != null && Session["Role"].ToString() == PatientRole)
     {
         var dbc         = new DbConnectivityModel();
         var searchModel = new SearchFilterModels
         {
             CityName           = dbc.ListOutCities(),
             SpecializationList = dbc.ListOutSpecialization()
         };
         return(View(searchModel));
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }
        // GET: DoctorsProfile
        public ActionResult SearchLayout()
        {
            //if (Session["EmailId"] != null)
            // {
            var dbc         = new DbConnectivityModel();
            var searchModel = new SearchFilterModels
            {
                CityName           = dbc.ListOutCities(),
                SpecializationList = dbc.ListOutSpecialization()
            };

            return(View(searchModel));
            //}
            // else
            //{
            //return RedirectToAction("Login", "Home");
            // }
        }
        public ActionResult ChangeUserPassword(string CurrentPassword, string NewPassword)
        {
            var  dbc    = new DbConnectivityModel();
            var  userId = Session["UserId"].ToString();
            bool exist  = dbc.CheckPassword(CurrentPassword, userId);

            if (exist == true)
            {
                bool change = dbc.UpdatePassword(CurrentPassword, NewPassword, userId);
                if (change == true)
                {
                    return(View("Account"));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                ViewBag.PasswordMessage = "Invalid Password";
                return(View());
            }
        }