示例#1
0
        public ActionResult CreateAccount(string FullName, string Email, string Gender, string Contact, string PaPassword)
        {
            Models.LoginSignup signup = new Models.LoginSignup();
            var status = signup.CreatingNewAccount(FullName, Email, Contact, Gender, PaPassword);

            return(Json(status.ToString(), JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult Login(Models.LoginSignup login)
        {
            var role_type = login.CheckLogin(login.UserName, login.Password);

            if (role_type == "admin")
            {
                Session["AdminUserName"] = login.UserName;
                return(new RedirectResult(@"~\Admin\"));
            }
            else if (role_type == "patient")
            {
                Session["PatientUserName"] = login.UserName;
                return(new RedirectResult(@"~\Patient\"));
            }
            else if (role_type == "doctor")
            {
                Session["DoctorUserName"] = login.UserName;
                return(new RedirectResult(@"~\Doctor\"));
            }
            else
            {
                TempData["Message"] = "UserName or Password is incorrect";
                return(RedirectToAction("Index", "Home"));
            }
        }