Esempio n. 1
0
        private void button1LoginSucess_Click(object sender, EventArgs e)
        {
            info.userName = textBox1UserName.Text;
            info.password = textBox2Password.Text;

            dataTable= opr.loginUser(info);
            if (dataTable.Rows.Count > 0)
            {


                typeUser = dataTable.Rows[0][3].ToString().Trim();
                if (typeUser=="A")
                {
                    this.Hide();
                    Form1AdminServer form1Admin = new Form1AdminServer();
                    form1Admin.Show();
                    MessageBox.Show(dataTable.Rows[0][1].ToString());
                   

                }
                else
                {
                    // Take to Chart
                    this.Hide();
                Form3ChatArea form3Chat = new Form3ChatArea();
                form3Chat.Show();
                
            }

            }   else
            {
                MessageBox.Show("User name not found in our database");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Form3ChatArea form3ChatArea = new Form3ChatArea();

            form3ChatArea.Show();
            this.Close();
        }