Advertisement
Guest User

Login

a guest
May 25th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace BugTraker
  12. {
  13.     public partial class Login : Form
  14.     {
  15.         UserController userCtrl = UserController.Instance;
  16.         public Login()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void btnSubmit_Click(object sender, EventArgs e)
  22.         {
  23.             var username = txtUsername.Text;
  24.             var password = txtPassword.Text;
  25.  
  26.             if(userCtrl.Login(username, password))
  27.             {
  28.                 lblLoginFailed.Visible = false;
  29.  
  30.                 this.Hide();
  31.                 var listUsers = new ListUsers();
  32.                 listUsers.Closed += (s, args) => this.Close();
  33.                 listUsers.Show();
  34.             }
  35.             else
  36.             {
  37.                 lblLoginFailed.Visible = true;
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement