private void SaveUserLoginInfo() { var userchoose = LoginMain.FindControl("UserChoose") as RadioButtonList; string UserType = ""; if (userchoose.SelectedIndex == 0) { UserType = "普通用户"; } else if (userchoose.SelectedIndex == 1) { UserType = "医生用户"; } else if (userchoose.SelectedIndex == 2) { UserType = "开发人员"; } string LoginIP = Request.UserHostAddress; string LoginName = LoginMain.UserName; string LoginTime = DateTime.Now.ToString(); string conString = WebConfigurationManager.ConnectionStrings["CDSSConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString); string SqlStr = "INSERT into UsersLogin (LoginTime,LoginName,UserType,LoginIP) " + "VALUES(@LoginTime,@LoginName,@UserType,@LoginIP)";; SqlCommand cmd = new SqlCommand(SqlStr, con);; cmd.Parameters.AddWithValue("@LoginTime", LoginTime); cmd.Parameters.AddWithValue("@LoginName", LoginName); cmd.Parameters.AddWithValue("@UserType", UserType); cmd.Parameters.AddWithValue("@LoginIP", LoginIP); con.Open(); cmd.ExecuteNonQuery(); }
public void SetupTest() { this.driver = new ChromeDriver(); this.login = new LoginMain(this.driver); this.utilities = new UtilitiesMain(this.driver); this.myprof = new MyProfile(this.driver); utilities.ReportSetup(); }
//Login and Navigate to Register Page - functionality taken from Login.Login public void NavigateTo() { LoginMain login = new LoginMain(this.driver); login.NavigateTo(); //login.LoginSuccess(); login.RegisterLink(); }
//Login functionality taken from Login.Login public void NavigateToInit() { LoginMain login = new LoginMain(this.driver); login.NavigateTo(); login.LoginSuccess(); //Add WAIT Thread.Sleep(5000); }
public void TestSetUp() { this.driver = new ChromeDriver(); this.login = new LoginMain(this.driver); this.register = new Register(this.driver); this.forgotpass = new ForgotPassword(this.driver); this.utilities = new UtilitiesMain(this.driver); utilities.ReportSetup(); }
public void SetupTest() { this.driver = new ChromeDriver(); this.login = new LoginMain(this.driver); this.homepage = new HomepageMain(this.driver); this.attendees = new AttendeesMain(this.driver); this.utilities = new UtilitiesMain(this.driver); this.utilities = new UtilitiesMain(this.driver); utilities.ReportSetup(); }
public void SetupTest() { this.driver = new ChromeDriver(); this.myprofile = new MyProfile(this.driver); this.login = new LoginMain(this.driver); this.homepage = new HomepageMain(this.driver); this.mybookings = new MyBookings(this.driver); this.utilities = new UtilitiesMain(this.driver); utilities.ReportSetup(); }
protected void ButtonLogin_Click(object sender, EventArgs e) { var userchoose = LoginMain.FindControl("UserChoose") as RadioButtonList; bool Authentication = false; if (userchoose.SelectedIndex == 0) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Commonuser"); } else if (userchoose.SelectedIndex == 1) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Doctor"); } else if (userchoose.SelectedIndex == 2) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Developer"); } else { string MsgInfo = "请选择你的身份重新登录!"; Response.Write("<script>window.alert('" + MsgInfo + "');</script>"); } //e.Authenticated = Authenticated; if (Authentication == true) { Session["UserName"] = LoginMain.UserName; Session["LoginTime"] = DateTime.Now.ToString(); FormsAuthentication.SetAuthCookie(Session["UserName"].ToString(), createPersistentCookie: false); SaveUserLoginInfo(); //string ip = Request.UserHostAddress; if (Session["type"].ToString() == "Developer") { Response.Redirect("~/DevelopersPage.aspx"); } else if (Session["type"].ToString() == "Doctor") { Response.Redirect("~/DoctorsPage.aspx"); } else { Response.Redirect("~/CommonUsersPage.aspx"); } } else //如果登录失败就让用户重新登录 { Session["UserName"] = ""; Session["type"] = ""; Session["LoginTime"] = ""; string ErrorMessage = LoginErrorInfo + ",登录失败,请重新登录!"; Response.Write("<script>window.alert('" + ErrorMessage + "');</script>"); //Thread.Sleep(200); //Response.Redirect("~/Account/Login.aspx"); } }
protected void ButtonLogin_Click(object sender, EventArgs e) { var userchoose = LoginMain.FindControl("UserChoose") as RadioButtonList; string Authentication = ""; if (userchoose.SelectedIndex == 0) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Commonuser"); } else if (userchoose.SelectedIndex == 1) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Doctor"); } else if (userchoose.SelectedIndex == 2) { Authentication = SiteLevelCustomAuthenticationMethod(LoginMain.UserName, LoginMain.Password, "Developer"); } else { MessageBox.Show("请选择你的身份重新登录!"); } //e.Authenticated = Authenticated; if (Authentication == "") //登录成功 { Session["UserName"] = LoginMain.UserName; FormsAuthentication.SetAuthCookie(Session["UserName"].ToString(), createPersistentCookie: false); if (Session["type"].ToString() == "Developer") { Response.Redirect("~/DevelopersPage.aspx"); } else if (Session["type"] == "Doctor") { Response.Redirect("~/DoctorsPage.aspx"); } else if (Session["type"] == "CommonUser") { Response.Redirect("~/CommonUsersPage.aspx"); } } else //如果登录失败就让用户重新登录 { Session["type"] = ""; Session["UserName"] = ""; string ErrorMessage = Authentication + ",登录失败!"; //Response.Write("<script>window.alert('" + ErrorMessage + "');</script>"); //LoginMain.FailureText = ErrorMessage; //this.LoginMain_LoginError(sender,e); //MessageBox.Show(ErrorMessage); Thread.Sleep(200); Response.Redirect("~/Account/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["IdConv"])) { Label lblNombreConvocatoria = (Label)LoginMain.FindControl("lblNombreConvocatoria"); if (Request.QueryString["IdConv"].Equals("8809")) { lblNombreConvocatoria.Text = Resources.ResourceConst.ConstPrimeraConvocatoria; } else if (Request.QueryString["IdConv"].Equals("9084")) { lblNombreConvocatoria.Text = Resources.ResourceConst.ConstSegundaConvocatoria; } } }
protected void LoginMain_Authenticate(object sender, AuthenticateEventArgs e) { try { TextBox txtCapcha = (TextBox)LoginMain.FindControl("txtCapcha"); if (Request.QueryString["IdConv"] == null || string.IsNullOrEmpty(Request.QueryString["IdConv"])) { script = JQueryMensaje.ArmaMensaje("Error.", "No es una convocatoria valida, por favor ingrese con una convocatoria valida.", JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", script, true); } else { //Valida usuario y password this.usuarioEntity = this.usuarioBusiness.ValidarUsuario(LoginMain.UserName, LoginMain.Password, Request.QueryString["IdConv"]); if (!this.usuarioEntity.SeAutentica) { LoginMain.FailureText = "El nombre de usuario o el password no son validos, por favor verifique e intente nuevamente."; script = JQueryMensaje.ArmaMensaje("Error.", "El nombre de usuario o el password no son validos, por favor verifique e intente nuevamente.", JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", script, true); return; } } //VALIDACIÓN CÓDIGO CAPTHCHA if (txtCapcha.Text.ToUpper() != Session["Captcha"].ToString()) { LoginMain.FailureText = "El código de la imagen no corresponde."; return; } this.usuarioEntity.Login = LoginMain.UserName; this.usuarioEntity.Password = LoginMain.Password; this.usuarioEntity.IdConvocatoria = Request.QueryString["IdConv"]; Session["Usuario"] = this.usuarioEntity; FormsAuthentication.RedirectFromLoginPage(LoginMain.UserName, LoginMain.RememberMeSet); Response.Redirect("~/NivelFormacion/NivelFormacion.aspx", false); } catch (Exception ex) { script = JQueryMensaje.ArmaMensaje("Error.", ex.Message, JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", script, true); } }
public void SetupTest() { this.driver = new ChromeDriver(); this.myprofile = new MyProfile(this.driver); this.login = new LoginMain(this.driver); this.homepage = new HomepageMain(this.driver); this.services = new ServicesMain(this.driver); this.utilities = new UtilitiesMain(this.driver); this.attendees = new AttendeesMain(this.driver); this.booking = new BookingMain(this.driver); this.mybookings = new MyBookings(this.driver); this.webappLogin = new WebAppLoginMain(this.driver); this.webappStatus = new StatusMain(this.driver); this.admin = new AdministrationMain(this.driver); this.webAppBookingsMain = new BookingsMain(this.driver); this.webAppBookingSearchMain = new BookingSearchMain(this.driver); this.webAppBookingSummaryMain = new BookingSummaryMain(this.driver); utilities.ReportSetup(); this.editBookingMain_s = new EditBookingMain(this.driver); this.NewBookingMain = new NewBookingMain(this.driver); }
public void SetupTest() { this.driver = new ChromeDriver(); this.myprofile = new MyProfile(this.driver); this.login = new LoginMain(this.driver); this.homepage = new HomepageMain(this.driver); this.utilities = new UtilitiesMain(this.driver); utilities.ReportSetup(); //utilities.ConsoleOutput(); //Report Setup But this is moved to Utilities. Using it from there. /* string path = System.Reflection.Assembly.GetCallingAssembly().CodeBase; * string actualPath = path.Substring(0, path.LastIndexOf("bin")); * string projectPath = new Uri(actualPath).LocalPath; * string reportPath = projectPath + "Reports\\Build v6.4.1(Fuji) " + DateTime.Now.ToString("yyyy-MM-dd HH-mm") + ".html"; * extent = new ExtentReports(reportPath, true); * extent.AddSystemInfo("Host Name", "PC 47"); * extent.AddSystemInfo("Environment", "QA"); * extent.AddSystemInfo("User Name", "Mohit Sharma"); * string file = @"F:\Automation Testing\QuickBook Automation Team Code\QuickBookAutomation\UnitTests\Reports\extent-config.xml"; * extent.LoadConfig(file);*/ }
protected void LoginMain_Authenticate(object sender, AuthenticateEventArgs e) { try { TextBox txtCapcha = (TextBox)LoginMain.FindControl("txtCapcha"); //Valida usuario y password if (!this.usuarioBusiness.ValidarUsuarioIcetex(LoginMain.UserName, LoginMain.Password, ResourceConst.PathFileUsers)) { LoginMain.FailureText = "El nombre de usuario o el password no son validos por favor verifique e intente nuevamente."; text = JQueryMensaje.ArmaMensaje("Error.", "El nombre de usuario o el password no son validos por favor verifique e intente nuevamente.", JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", text, true); return; } //VALIDACIÓN CÓDIGO CAPTHCHA if (txtCapcha.Text.ToUpper() != Session["Captcha"].ToString()) { text = JQueryMensaje.ArmaMensaje("Error.", "El código de la imagen no corresponde.", JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", text, true); return; } UsuarioIcetexEntity usuarioIcetexEntity = new UsuarioIcetexEntity() { Login = LoginMain.UserName, Password = LoginMain.Password }; Session["UsuarioIcetex"] = usuarioIcetexEntity; FormsAuthentication.RedirectFromLoginPage(LoginMain.UserName, LoginMain.RememberMeSet); Response.Redirect("~/Administracion/CalificarBeneficiario.aspx", false); } catch (Exception ex) { string script = JQueryMensaje.ArmaMensaje("Error.", ex.Message, JQueryMensaje.TipoMensaje.Error); ClientScript.RegisterClientScriptBlock(Page.GetType(), "abrirmodal", script, true); } }
public void SelectResource() { LoginMain login = new LoginMain(this.driver); SearchResource(); Thread.Sleep(2000); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); try { this.Map.exactmatch.Click(); } catch (WebDriverException e) { IList <IWebElement> selectElements = driver.FindElements(By.ClassName("available")); IEnumerator <IWebElement> enumerator = selectElements.GetEnumerator(); bool hasNext = enumerator.MoveNext(); while (hasNext) { IWebElement i = enumerator.Current; login.Wait(); i.Click(); login.Wait(); if (this.Map.resourceselected.Displayed) { break; } else { hasNext = enumerator.MoveNext(); } } enumerator.Dispose(); Console.WriteLine("Exact match was not Found, but other available time was selected"); } }
private void Awake() { instance = this; }
public LoginMain_Bean() { LoginMain = new LoginMain(this); loginMain_Method = new LoginMain_Method(this); }