public ActionResult ResetPassword(string EmailId, string Code) { try { string DecryptedEmailId = BrokerUtility.DecryptURL(EmailId); Session["EmailId"] = DecryptedEmailId; DataSet dsValidEmail = BrokerWSUtility.CheckForValidEmailId(DecryptedEmailId); if (dsValidEmail.Tables.Count > 0) { if (dsValidEmail.Tables[0].Rows.Count > 0) { if (dsValidEmail.Tables[0].Rows[0][0].ToString() != "0") { if (dsValidEmail.Tables[0].Rows[0]["ForgetPasswordRanNum"].ToString() != "") { if (dsValidEmail.Tables[0].Rows[0]["ForgetPasswordRanNum"].ToString() == Code) { Session["ResetPasswordUserType"] = dsValidEmail.Tables[0].Rows[0]["UserType"].ToString(); return(View()); } else { ViewBag.Message = "Password could not reset. Please try again"; return(View("ResetResult")); } } else { ViewBag.Message = "Reset password link expired."; return(View("ResetResult")); } } else { ViewBag.Message = "Password could not reset. Please try again"; return(View("ResetResult")); } } else { ViewBag.Message = "Password could not reset. Please try again"; return(View("ResetResult")); } } else { ViewBag.Message = "Password could not reset. Please try again"; return(View("ResetResult")); } } catch (Exception Ex) { ViewBag.Message = "Password could not reset. Please try again"; return(View("ResetResult")); } }
public ActionResult VerifyEmailForApp(string EmailId, string RegistrationCode) { DataSet dsResult = null; DataSet dsValidEmail = null; try { string DecryptEmail = BrokerUtility.DecryptURL(EmailId); dsValidEmail = BrokerWSUtility.CheckForValidEmailId(DecryptEmail); if (Convert.ToBoolean(dsValidEmail.Tables[0].Rows[0]["IsEmailIdVerified"].ToString()) == false) { dsResult = BrokerWSUtility.VerifyUserDetails(DecryptEmail, RegistrationCode); if (dsResult.Tables.Count > 0) { ViewData["EmailVerifyMessage"] = strEmailVerifyMessage; if (dsResult.Tables[0].Rows[0]["UserType"].ToString() == "Customer") { //ViewData["LoginUrl"] = "CustomerLogin"; ViewData["Login"] = "******"; } else { //ViewData["LoginUrl"] = "BrokerLogin"; ViewData["Login"] = "******"; } return(View()); } else { ViewData["EmailVerifyMessage"] = "Email Verification Failed. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } } else { ViewData["EmailVerifyMessage"] = "Your email address is already verified."; if (dsValidEmail.Tables[0].Rows[0]["IsEmailIdVerified"].ToString() == "Customer") { ViewData["Login"] = "******"; } else { ViewData["Login"] = "******"; } return(View("VerifyEmailFail")); } } catch (Exception Ex) { ViewData["EmailVerifyMessage"] = "Email Verification Failed. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } }
public ActionResult CustomerChat(string BrokerMessageId, string CustomerMessageId, string BrokerId, string CustomerId, string CustomerName) { DataSet dsMainMsgDetails = null; string MainMessage = "", IsRead = "", LocalDateTime = ""; string this_BrokerMessageId = BrokerMessageId; string this_CustomerMessageId = CustomerMessageId; string this_BrokerId = BrokerId; string this_CustomerId = CustomerId; string this_CustomerName = CustomerName; this_BrokerMessageId = BrokerUtility.DecryptURL(this_BrokerMessageId); this_CustomerMessageId = BrokerUtility.DecryptURL(this_CustomerMessageId); this_BrokerId = BrokerUtility.DecryptURL(this_BrokerId); this_CustomerId = BrokerUtility.DecryptURL(this_CustomerId); this_CustomerName = BrokerUtility.DecryptURL(this_CustomerName); ViewBag.BrokerMessageId = this_BrokerMessageId; ViewBag.CustomerMessageId = this_CustomerMessageId; ViewBag.BrokerId = this_BrokerId; ViewBag.CustomerId = this_CustomerId; ViewBag.BrokerName = this_CustomerName; ViewBag.FirstName = Session["FirstName"].ToString(); ViewBag.LastName = Session["LastName"].ToString(); dsMainMsgDetails = BrokerWebDB.BrokerWebDB.GetMainMessage(this_BrokerId, this_CustomerId, this_BrokerMessageId, this_CustomerMessageId, "CustomerMessages"); if (dsMainMsgDetails.Tables.Count > 0) { if (dsMainMsgDetails.Tables[0].Rows.Count > 0) { MainMessage = dsMainMsgDetails.Tables[0].Rows[0][0].ToString(); IsRead = dsMainMsgDetails.Tables[0].Rows[0]["IsRead"].ToString(); LocalDateTime = dsMainMsgDetails.Tables[0].Rows[0]["LocalDateTime"].ToString(); } } ViewBag.MainMessage = MainMessage; ViewBag.IsRead = IsRead; ViewBag.LocalDateTime = LocalDateTime; if (Session["WebServiceURL"] != null) { ViewBag.WebServiceURL = Session["WebServiceURL"].ToString(); } return(View()); }
public ActionResult VerifyEmail(string EmailId, string RegistrationCode) { try { DataSet dsResult = null; string DecryptEmail = BrokerUtility.DecryptURL(EmailId); Session["DecryptedEmailId"] = DecryptEmail; DataSet dsValidEmail = BrokerWSUtility.CheckForValidEmailId(DecryptEmail); //Check for Customer Email verification if (Convert.ToBoolean(dsValidEmail.Tables[0].Rows[0]["IsEmailIdVerified"].ToString()) == false && dsValidEmail.Tables[0].Rows[0]["UserType"].ToString() == "Customer") { DataSet ds = new DataSet(); ds = BrokerWebDB.BrokerWebDB.CheckForValidUserDetails(Session["DecryptedEmailId"].ToString(), RegistrationCode); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { return(View()); } else { ViewData["EmailVerifyMessage"] = "Email verification link is expired. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } } else { ViewData["EmailVerifyMessage"] = "Email verification link is expired. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } } //Check for Broker Email verification else if (Convert.ToBoolean(dsValidEmail.Tables[0].Rows[0]["IsEmailIdVerified"].ToString()) == false && dsValidEmail.Tables[0].Rows[0]["UserType"].ToString() == "Broker") { dsResult = BrokerWSUtility.VerifyUserDetails(DecryptEmail, RegistrationCode); if (dsResult.Tables.Count > 0) { ViewData["EmailVerifyMessage"] = strEmailVerifyMessage; ViewData["LoginUrl"] = "BrokerLogin"; return(View("VerifyEmailSuccess")); } else { ViewData["EmailVerifyMessage"] = "Email verification link is expired. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } } //If both Customer and Broker are already verified. else { ViewData["EmailVerifyMessage"] = "Your email address is already verified."; if (dsValidEmail.Tables[0].Rows[0]["UserType"].ToString() == "Customer") { ViewData["Login"] = "******"; } else { ViewData["Login"] = "******"; } return(View("VerifyEmailFail")); } } catch (Exception Ex) { ViewData["EmailVerifyMessage"] = "Email Verification Failed. Please try again"; ViewData["Login"] = ""; return(View("VerifyEmailFail")); } }