Ejemplo n.º 1
0
        private void signin_Click(object sender, EventArgs e)
        {
            ClLogin log1 = new ClLogin();
            string  ret  = log1.FuncLog(un.Text, pass.Text, cb1.Text);

            if (ret == "false")
            {
                MessageBox.Show(this, "Login Unsuccessful");
            }
            else if (ret == "true")
            {
                if (cb1.Text == "Administrator")
                {
                    this.Hide();
                    admin a = new admin(un.Text, this);
                    a.Show();
                }
                if (cb1.Text == "Student")
                {
                    MessageBox.Show(this, "0");
                    //        this.Hide();
                    //        student.Show();
                }
                if (cb1.Text == "Faculty")
                {
                    MessageBox.Show(this, "1");
                    //        this.Hide();
                    //        faculty.Show();
                }
            }
            else
            {
                if (ret == "Librarian")
                {
                    this.Hide();
                    Librarian Librar = new Librarian(this);
                    Librar.Show();
                }
                else
                if (ret == "HostelAttendant")
                {
                    this.Hide();
                    HostelAttendant ha = new HostelAttendant(this);
                    ha.Show();
                }
            }
            log1 = null;
        }
Ejemplo n.º 2
0
 private void signin_Click(object sender, EventArgs e)
 {
     ClLogin log1 = new ClLogin();
     string ret = log1.FuncLog(un.Text, pass.Text, cb1.Text);
     if (ret == "false")
     {
         MessageBox.Show (this,"Login Unsuccessful");
     }else if(ret == "true")
     {
         if (cb1.Text == "Administrator")
         {
             this.Hide();
             admin a = new admin(un.Text,this);
             a.Show();
         }
             if(cb1.Text == "Student")
             {
                 MessageBox.Show(this, "0");
         //        this.Hide();
         //        student.Show();
             }
             if (cb1.Text == "Faculty")
             {
                 MessageBox.Show (this,"1");
         //        this.Hide();
         //        faculty.Show();
             }
     }else
     {
             if (ret == "Librarian")
             {
                 this.Hide();
                 Librarian Librar = new Librarian(this);
                 Librar.Show();
             }
             else
             if (ret == "HostelAttendant")
             {
                     this.Hide();
                     HostelAttendant ha = new HostelAttendant(this);
                     ha.Show();
             }
     }
     log1 = null;
 }