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());
            }
        }
Ejemplo n.º 2
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 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);
            }
        }