Ejemplo n.º 1
0
        private void sendanswer_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            teachhomepage ss = new teachhomepage();

            ss.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void sign_in_Click(object sender, EventArgs e)
        {
            if (teacher.Checked)
            {
                string           oradb = "Data Source=localhost;User Id=DBMS;Password=DBMS;";
                OracleConnection conn  = new OracleConnection(oradb); // C#
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
                string            query = "Select username,password From t_signup where username = '******' and password = '******'";
                OracleDataAdapter sda   = new OracleDataAdapter(query, conn);
                DataTable         dt    = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count == 1)
                {
                    cmd.CommandText = "select fname,tid from t_signup where username = '******'";
                    cmd.CommandType = CommandType.Text;
                    OracleDataReader dr = cmd.ExecuteReader();
                    dr.Read();
                    passclass.uname = dr["fname"].ToString();
                    passclass.id    = dr["tid"].ToString();
                    teachhomepage ss = new teachhomepage();
                    ss.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Please Check your Username and Password");
                }
            }
            else if (student.Checked)
            {
                string           oradb = "Data Source=localhost;User Id=DBMS;Password=DBMS;";
                OracleConnection conn  = new OracleConnection(oradb); // C#
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
                string            query = "Select username,password From sign_up where username = '******' and password = '******'";
                OracleDataAdapter sda   = new OracleDataAdapter(query, conn);
                DataTable         dt    = new DataTable();
                sda.Fill(dt);
                if (dt.Rows.Count == 1)
                {
                    cmd.CommandText = "select fname,sid from sign_up where username = '******'";
                    cmd.CommandType = CommandType.Text;
                    OracleDataReader dr = cmd.ExecuteReader();
                    dr.Read();
                    passclass.uname = dr["fname"].ToString();
                    passclass.id    = dr["sid"].ToString();

                    this.Hide();
                    dashboard ss = new dashboard();
                    ss.Show();
                }
                else
                {
                    MessageBox.Show("Please Check your Username and Password");
                }
            }
        }
Ejemplo n.º 3
0
        private void backlink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            teachhomepage d = new teachhomepage();

            d.Show();
            this.Hide();
        }
Ejemplo n.º 4
0
 private void go_back_Click(object sender, EventArgs e)
 {
     if (passclass.Test == 1)
     {
         teachhomepage d = new teachhomepage();
         d.Show();
         this.Hide();
     }
     else if (passclass.Test == 0)
     {
         dashboard ss = new dashboard();
         ss.Show();
         this.Hide();
     }
 }