private void btnLogin_Click(object sender, EventArgs e)
        {
            con.DataGet("Select * from DBUser where UserName ='******'and Password ='******'");
            DataTable DT = new DataTable();

            con.sda.Fill(DT);

            if (DT.Rows.Count > 0)
            {
                type = DT.Rows[0][5].ToString().Trim();

                if (type == "Admin")
                {
                    this.Hide();
                    MDIControl MDI = new MDIControl();
                    MDI.Show();
                }
                else
                {
                    this.Hide();
                    Guest.FormGuestInfo MDIA = new Guest.FormGuestInfo();
                    MDIA.Show();
                }
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Invalid user name and password.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     this.Hide();
     Guest.FormGuestInfo kkk = new FormGuestInfo();
     kkk.Show();
 }
 private void guestRegisterToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Guest.FormGuestInfo GI = new Guest.FormGuestInfo();
     GI.Show();
 }