none
dual login RRS feed

  • Question

  • Hi, I have 3 forms a login form and 2 menu forms.

    I also have a login table with 3 fields: username, password and privilege.

    on the login form there is 2 fields and a login button.

    what i'm trying to accomplish is; when i type a username and password and click the login button

    it check the privilege of user.

    if privilege is Admin it takes you to menu form 1

    if privilege is User it takes you to menu form 2

    can anyone assist me pleas?

    Thursday, October 23, 2014 1:57 PM

Answers

  •             if (sPreviledge == "Admin")
                {
                 
                    Form1 frm = new Form1();
                    frm.ShowDialog();
                    this.Hide();
                }
                else if (sPreviledge == "User")
                {
    
                    Form2 frm = new Form2();
                    frm.Show();
                    this.Hide();
                }



    Happy Coding, RDRaja


    Thursday, October 23, 2014 2:48 PM

All replies

  •             if (sPreviledge == "Admin")
                {
                 
                    Form1 frm = new Form1();
                    frm.ShowDialog();
                    this.Hide();
                }
                else if (sPreviledge == "User")
                {
    
                    Form2 frm = new Form2();
                    frm.Show();
                    this.Hide();
                }



    Happy Coding, RDRaja


    Thursday, October 23, 2014 2:48 PM
  • Do you have also other privileges, other wise it looks to me a little bit strange code and can it be.

    Also why not simply use another menustrip

     if (sPreviledge == "Admin")
                {
                 
                    this.MenuStrip = Adminmenustrip;
                }
                else 
                {
                    this.MenuStrip = UserMenuStrip;
                }


    Success
    Cor

    Thursday, October 23, 2014 3:07 PM