Example #1
0
        protected void login_Click(object sender, EventArgs e)
        {
            LoginDTO item = new LoginDTO();

            item.UserId   = UserName.Text;
            item.Password = Password.Text;
            var connection = new LoginFunctions();
            var obj        = connection.DoLogin(item.UserId, item.Password);

            if (obj == null)
            {
                lblErrorMessage.Visible = true;
                lblErrorMessage.Text    = "Login failed.";
            }
            else
            {
                Session["UserName"] = obj.UserId;
                FormsAuthentication.SetAuthCookie(item.UserId, createPersistentCookie: false);

                if (!obj.IsAdmin)
                {
                    Session["IsAdmin"] = false;


                    Response.Redirect("~/ScanLoad.aspx");
                    //FormsAuthentication.RedirectFromLoginPage(obj.UserId, false);
                }
                else
                {
                    Session["IsAdmin"] = true;
                    Response.Redirect("~/Admin.aspx");
                }
            }
        }
Example #2
0
 public void ChangePassword()
 {
     forgotPasswordPage = mainPage.OpenTheForgotPasswordDiv();
     mainPage           = forgotPasswordPage.EnterExistingPassAndNewPassAndClickSubmit(password, newPassword);
     loginPage          = mainPage.LogOutAndOpenLoginPage();
     loginPage.EnterLoginDetailsAndClickOnLoginBtn(newPassword);
 }
Example #3
0
        public void SetUpDriver()
        {
            driver     = new ChromeDriver();
            driver.Url = "http://192.168.99.100:3030/admin";

            User           user      = TestUsersGenerator.GenerateValidUser();
            LoginFunctions loginFunc = new LoginFunctions(driver);

            loginFunc.Login(user);
        }
Example #4
0
        private void LoadStartUpMenu(Menu menu)
        {
            LoginFunctions loginFunctions = new LoginFunctions(menu);

            menu.LoadMenu("Start up Menu", new Dictionary <ConsoleKey, MenuItem>()
            {
                { ConsoleKey.D1, new MenuItem("1. Login", loginFunctions.Login) },
                { ConsoleKey.D2, new MenuItem("2. Sign Up", loginFunctions.SignUp) },
                { ConsoleKey.Escape, new MenuItem("[Esc] => Exit From Application", menu.LoadPreviousMenu) }
            });
        }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            LoginDTO item = new LoginDTO();

            item.Password = Password.Text;
            item.UserId   = UserName.Text;
            item.IsAdmin  = chktnAdmin.Checked;
            var connector = new LoginFunctions();
            var obj       = connector.DoRegister(item);

            if (obj == null)
            {
                lblMessage.Text    = "User Id already exist.Please try with different user name.";
                lblMessage.Visible = true;
            }
            else
            {
                lblMessage.Text    = "Loged In.";
                lblMessage.Visible = true;
                FormsAuthentication.SetAuthCookie(UserName.Text, createPersistentCookie: false);

                //Label lbl = this.Master.FindControl("lblLoginName") as Label;
                //lbl.Text = obj.UserId;
                //HyperLink link = this.Master.FindControl("hypLogOut") as HyperLink;
                //HyperLink scnLink = this.Master.FindControl("hypScn") as HyperLink;
                //link.Text = obj.UserId;

                //lbl.Visible = true;
                //link.Visible = true;

                if (obj.IsAdmin)
                {
                    Session["IsAdmin"] = true;
                    Response.Redirect("~/Admin.aspx");
                }
                else
                {
                    Session["IsAdmin"] = false;
                    Response.Redirect("~/ScanLoad.aspx");
                }
            }
        }
Example #6
0
 public void testLogin()
 {
     Assert.IsTrue(LoginFunctions.login("allpackages", "Foutloos!"));
 }
Example #7
0
 protected void submitLoginButton_Click(object sender, EventArgs e)
 {
     LoginFunctions.check_login(userText, passText);
 }