Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool checkvalidate = validation();

            var emp = empRepo.ValidateLogin(txtLoginId.Text, txtPassword.Text);
            if (emp != null && !string.IsNullOrEmpty(emp.Name))
            {
                ApplicationElements.loggedInEmployee = emp;
                ManagementConsole mgmt = new ManagementConsole();
                this.Hide();
                mgmt.ShowDialog();
                this.Dispose();
                //new MainForm().Show();
            }
            else
            {
                MessageBox.Show("Invalid user name or password ! Please try again.", "Unable to login !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtLoginId.Focus();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool checkvalidate = validation();

            var emp = empRepo.ValidateLogin(txtLoginId.Text, txtPassword.Text);

            if (emp != null && !string.IsNullOrEmpty(emp.Name))
            {
                ApplicationElements.loggedInEmployee = emp;
                ManagementConsole mgmt = new ManagementConsole();
                this.Hide();
                mgmt.ShowDialog();
                this.Dispose();
                //new MainForm().Show();
            }
            else
            {
                MessageBox.Show("Invalid user name or password ! Please try again.", "Unable to login !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtLoginId.Focus();
            }
        }