예제 #1
0
        private void btnEditUsers_Click(object sender, EventArgs e)
        {
            foreach (Form c in this.ParentForm.MdiChildren)
            {
                if (c.GetType() == new AdminUser().GetType())
                {
                    mu = true;
                }
            }

            if (!mu)
            {
                AdminUser editUser = new AdminUser();
                editUser.MdiParent = this.ParentForm;
                editUser.Show();
            }
        }
예제 #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         AppUser loginUser = AppUserDAO.VerifyAppUser(txtUser.Text, txtPass.Text);
         if (loginUser.userType)
         {
             AdminUser admin = new AdminUser();
             admin.Show();
         }
         else
         {
             NormalUser normal = new NormalUser(loginUser);
             normal.Show();
         }
         Hide();
     }
     catch (Exception exception)
     {
         MessageBox.Show("Verifique su usuario y contraseña.", "Inicio de sesión fallido",
                         MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }