Пример #1
0
 private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         TxtPassword.Focus();    // ID 입력후 엔터 하면 커서 위치가 PW로 이동
     }
 }
Пример #2
0
        // buscar como centralizar al agrandar

        private void BtnIngresar_Click(object sender, EventArgs e)
        {
            if ((TxtUsuario.Text == ""))
            {
                MessageBox.Show("Se debe ingresar un usuario.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if ((TxtPassword.Text == ""))
            {
                MessageBox.Show("Se debe ingresar una contraseña.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            UsuarioEntidad user = new UsuarioEntidad();

            user = UsuarioBLL.ValidarLogin(TxtUsuario.Text, TxtPassword.Text);

            if (!string.IsNullOrEmpty(user.Nombre.ToString()))
            {
                MessageBox.Show("Login OK.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //this.Close();
                Menu menu = new Menu();
                menu.ShowDialog();
            }
            else
            {
                TxtUsuario.Text  = "";
                TxtPassword.Text = "";
                TxtPassword.Focus();
                MessageBox.Show("Debe ingresar usuario y/o contraseña válidos", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
 private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         TxtPassword.Focus();
     }
 }
Пример #4
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {
        Username = TxtUsername.Text;
        Password = TxtPassword.Text;

        if (string.IsNullOrEmpty(Username))
        {
            Config.MsgBoxAjax("İstifadəçi adı daxil edin.", Page);
            TxtUsername.Focus();
            return;
        }

        if (string.IsNullOrEmpty(Password))
        {
            Config.MsgBoxAjax("Şifrə daxil edni.", Page);
            TxtPassword.Focus();
            return;
        }

        if (Type == "a")
        {
            if (DlistType.SelectedValue == "1")
            {
                AdministratorCheck();
            }
            else
            {
                AdoptionAdministratorCheck();
            }
        }
        else
        {
            UsersCheck();
        }
    }
 private void TxtUserName_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == Convert.ToChar(Keys.Enter))
     {
         TxtPassword.Focus();
     }
 }
Пример #6
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            AuthBAL Auth = new AuthBAL();
            AuthDAL Ad   = new AuthDAL();

            if (TxtUseName.Text.Trim() != "" && TxtPasWord.Text.Trim() != "")
            {
                Auth.Username = TxtUseName.Text.Trim();
                Auth.Password = TxtPasWord.Text.Trim();
                bool result = Ad.Auth(Auth);
                if (result == true)
                {
                    TUnlock.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Invalid Username and Password");
                }
            }
            else if (TxtUseName.Text.Trim() == "")
            {
                MessageBox.Show("Username Cannot be Empty");
                TxtUsername.Focus();
            }
            else if (TxtPasWord.Text.Trim() == "")
            {
                MessageBox.Show("Password Cannot be Empty");
                TxtPassword.Focus();
            }
            else
            {
                MessageBox.Show("Username and Password cannot be empty");
            }
        }
 private void TxtUsername_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key.Equals(Key.Enter))
     {
         TxtPassword.Focus();
     }
 }
Пример #8
0
 private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (Char)13) // 대문자 Char : .NET 전체 (클래스) , 소문자 char : C# 데이터 타입형
     {                          //엔터
         TxtPassword.Focus();   // 엔터치면 밑으로
     }
 }
Пример #9
0
 private void TxtUsername_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Tab)
     {
         TxtPassword.Focus();
     }
 }
Пример #10
0
 private void textID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13) // 엔터
     {
         TxtPassword.Focus();
     }
 }
Пример #11
0
 private void TxtUserId_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r') // 엔터
     {
         TxtPassword.Focus();
     }
 }
Пример #12
0
        private async void  login_button_click(object sender, RoutedEventArgs e)
        {
            if (TxtUsername.Text == "")
            {
                _message.Message.Text = "Please Enter Username";
                TxtUsername.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            if (TxtPassword.Password == "")
            {
                _message.Message.Text = "Please Enter Password";
                TxtPassword.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            UserDataManager userManager = new UserDataManager();
            User            user        = userManager.AuthenticateUser(TxtUsername.Text, TxtPassword.Password);

            if (user == null)
            {
                _message.Message.Text = "Wrong username or password";
                TxtUsername.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            MainWindow window = new MainWindow();

            window.Show();
            Close();
        }
Пример #13
0
 private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter) //e.KeyChar == 13 -> Enter
     {
         TxtPassword.Focus();
     }
 }
Пример #14
0
 private void TxtUserId_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         TxtPassword.Focus();
     }
 }
Пример #15
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {
        string Username = TxtUsername.Text;
        string Password = TxtPassword.Text;

        if (string.IsNullOrEmpty(Username))
        {
            Config.MsgBoxAjax("İstifadəçi adı daxil edin.");
            TxtUsername.Focus();
            return;
        }

        if (string.IsNullOrEmpty(Password))
        {
            Config.MsgBoxAjax("Şifrə daxil edni.");
            TxtPassword.Focus();
            return;
        }

        DataTable Dt = DALC.GetDataTable("*", "Users", "Username,Password,IsActive", new object[] { Username, Password.Sha1(), true });

        if (Dt == null)
        {
            Config.MsgBoxAjax(Config._DefaultErrorMessages);
            return;
        }

        if (Dt.Rows.Count != 1)
        {
            Config.MsgBoxAjax("Giriş baş tutmadı!");
            return;
        }

        var Dictionary = new Dictionary <string, string>();

        //Success
        DALC.AdministratorClass AdminLoginInformation = new DALC.AdministratorClass();
        AdminLoginInformation.ID            = Dt._RowsObject("ID")._ToInt16();
        AdminLoginInformation.Fullname      = Dt._Rows("Fullname");
        AdminLoginInformation.UsersStatusID = Dt._Rows("UsersStatusID")._ToInt16();
        Session["AdminLogin"] = AdminLoginInformation;


        string ReturnResult = Config._GetQueryString("return");

        if (ReturnResult == "close-page")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "JsWindowClose", "this.close();", true);
            return;
        }

        if (ReturnResult.Length > 0)
        {
            Config.Rd(ReturnResult);
        }
        else
        {
            Config.Rd("/tools/main");
        }
    }
Пример #16
0
 private void Txtusername_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         TxtPassword.Focus();
     }
 }
 private void TxtUserEmail_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         TxtPassword.Focus();
     }
 }
Пример #18
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            string email = TxtEmail.Text;
            string pass  = TxtPassword.Password;

            var data = myContext.User.Where(d => d.Email == email).SingleOrDefault();

            if (email == null)
            {
                TxtEmail.BorderBrush = Brushes.Red;
                TxtEmail.Focus();
            }
            if (pass == null)
            {
                TxtPassword.BorderBrush = Brushes.Red;
                TxtPassword.Focus();
            }
            if (data != null)
            {
                MessageBox.Show("Login Successful");
                MainWindow dboard = new MainWindow();
                dboard.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Login Unsuccessful! Re-entry your input");
                TxtEmail.Text        = "";
                TxtPassword.Password = "";
            }
        }
 private void TxtUserEmail_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         TxtPassword.Focus();        // 이메일치고 엔터누르면 포커스가 패스워드창으로 감
     }
 }
Пример #20
0
 private void TxtUsuario_KeyDown(object sender, KeyEventArgs e) //con enter hace foco en el campo password
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPassword.Focus();
     }
 }
Пример #21
0
 private void TxtName_OnKeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Accept)
     {
         TxtPassword.Focus(FocusState.Pointer);
     }
 }
Пример #22
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            AuthBAL Auth = new AuthBAL();

            if (TxtUsername.Text.Trim() != "" && TxtPassword.Text.Trim() != "")
            {
                Auth.Username = TxtUsername.Text.Trim();
                Auth.Password = TxtPassword.Text.Trim();
                bool result = Ad.Auth(Auth);
                if (result == true)
                {
                    Home main = new Home();
                    main.Show();
                    Hide();
                }
                else
                {
                    MessageBox.Show("Invalid Username and Password");
                }
            }
            else if (TxtUsername.Text.Trim() == "")
            {
                MessageBox.Show("Username Cannot be Empty");
                TxtUsername.Focus();
            }
            else if (TxtPassword.Text.Trim() == "")
            {
                MessageBox.Show("Password Cannot be Empty");
                TxtPassword.Focus();
            }
            else
            {
                MessageBox.Show("Username and Password Invalid");
            }
        }
 private void TxtUserName_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPassword.Focus();
         e.Handled = true;
     }
 }
Пример #24
0
 private void TxtName_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPassword.Focus();
     }
     if (e.KeyCode == Keys.Escape)
     {
         Application.Exit();
     }
 }
Пример #25
0
 private void BtnLoginClick(object sender, EventArgs e)
 {
     if (TxtUserName.Text == "" || string.IsNullOrEmpty(TxtUserName.Text))
     {
         LblMessage.Text = "Please Enter User Name";
         TxtUserName.Focus();
         return;
     }
     if (TxtPassword.Text == "" || string.IsNullOrEmpty(TxtPassword.Text))
     {
         LblMessage.Text = "Please Enter Password";
         TxtPassword.Focus();
         return;
     }
     try
     {
         var            dsResult = new DataSet();
         var            vmResult = new VmUserDetails();
         SqlParameter[] sqlParam = new SqlParameter[3];
         sqlParam[0] = new SqlParameter("@Mode", "VALIDATEUSER");
         sqlParam[1] = new SqlParameter("@UserName", TxtUserName.Text);
         sqlParam[2] = new SqlParameter("@Password", TxtPassword.Text);
         dsResult    = objHelper.GetDatasetFromProcedure("dbo.Proc_ValidateUser", sqlParam);
         if (dsResult != null && dsResult.Tables.Count > 0)
         {
             if (dsResult.Tables[0].Rows.Count > 0)
             {
                 vmResult = dsResult.Tables[0].ToList <VmUserDetails>().ToList().FirstOrDefault();
             }
         }
         if (vmResult.IsAuthenticated)
         {
             FrmChequeMaintanance frmMain = new FrmChequeMaintanance();
             frmMain.Show();
             //Form frm = this.MdiParent;
             //MenuStrip ms = (MenuStrip)frm.Controls["MenuDetails"];
             // ms.Enabled = true;
             // ms.Visible = true;
             GlobalAccess.GlobalUserId       = vmResult.UserId;
             GlobalAccess.GlobalUserFullName = vmResult.UserFullName;
             frmMain.Text = "Welcome " + vmResult.UserFullName;
             this.Hide();
         }
         else
         {
             LblMessage.Text = vmResult.ErrorMessage;
             return;
         }
     }
     catch (Exception ex)
     {
         log.Error("[FrmLogin][BtnLoginClick][ExceptionMessage = " + ex.Message + "][ExceptionStackTrace = " + ex.StackTrace + "]");
     }
 }
Пример #26
0
 public override void FocusOnFirstLoad()
 {
     if (!string.IsNullOrEmpty(TxtUsername.Text))
     {
         TxtPassword.Focus();
     }
     else
     {
         base.FocusOnFirstLoad();
     }
 }
Пример #27
0
 private void WdwChangePassword_Loaded(object sender, RoutedEventArgs e)
 {
     if (TxtOldPassword.IsVisible)
     {
         TxtOldPassword.Focus();
     }
     else
     {
         TxtPassword.Focus();
     }
 }
Пример #28
0
 private void TxtUserName_KeyUp(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.Enter:
     {
         TxtPassword.SelectAll();
         TxtPassword.Focus();
         break;
     }
     }
 }
Пример #29
0
 public LoginFrm()
 {
     InitializeComponent();
     if (File.Exists(LoginInfoFileName))
     {
         FileStream fs   = File.Open(LoginInfoFileName, FileMode.Open, FileAccess.Read);
         byte[]     buff = new byte[fs.Length];
         fs.Read(buff, 0, Convert.ToInt32(fs.Length));
         fs.Close(); fs.Dispose();
         string username = Encoding.Default.GetString(buff, 0, buff.Length);
         TxtUserName.Text = username;
         TxtPassword.Focus();
     }
 }
Пример #30
0
 private void MiEventoImagen(object sender, EventArgs e)
 {
     Nombre_Usuario         = ((PictureBox)sender).Tag.ToString();
     PtboxUsuario.Image     = ((PictureBox)sender).Image;
     LblNombreCompleto.Text = Nombre_Usuario;
     OcultarPanelesPrincipal();
     PanelContenedor.Visible = false;
     PanelDerecha.Visible    = false;
     PanelTareas.Visible     = false;
     PanelTitulo.Visible     = false;
     Panelizquierda.Visible  = true;
     Panelizquierda.Dock     = DockStyle.Fill;
     TxtPassword.Focus();
 }