Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btn_loguserin_Click(object sender, EventArgs e)
- {
- string userName;
- string userPassword;
- userName = txtbx_username.Text;
- userPassword = txtbx_password.Text;
- if (userName == "" || userPassword == "")
- {
- txtbx_username.Text = "MISSING INPUT";
- }
- else
- {
- LogIn loginStatus = LogIn.getInstance();
- byte runLevel = loginStatus.LogMeIn(userName, userPassword);
- if (runLevel > 0)
- {
- Form1 form1 = Application.OpenForms["Form1"] as Form1;
- if (form1 == null)
- {
- Console.WriteLine("Form is null!");
- // !!! Throw an exception here !!!
- }
- else
- {
- form1.runLevelChecker();
- }
- }
- else
- {
- txtbx_username.Text = "INVALID LOGIN";
- }
- Form1 form1 = Application.OpenForms["Form1"] as Form1;
Add Comment
Please, Sign In to add comment