private void button2_Click_1(object sender, EventArgs e)
 {
     HOME r3 = new HOME();
     this.Hide();
     r3.Show();
     /*MessageBox.Show(
         this,
         "YOU HAVE CHOOSEN THE VALID PURPOSE. \n NOW YOU CAN ENTER !!!",
        "",
        MessageBoxButtons.OK,
         MessageBoxIcon.Question);
     /*MessageBox.Show(
              this, // needs a reference to the "Owner" form
                       "this is my text", // text to be shown in the message box
            "this is the caption", // Title of the message box
         MessageBoxButtons.OK, // Button to show
             MessageBoxIcon.Warning);*/
 }
        private void button1_Click(object sender, EventArgs e)
        {
            name = UNM.Text;
            if (pictureBox2.Image != null & UNM.Text != "")
            {
                MessageBox.Show("YOU are logout !!!");
                DateTime now = DateTime.Now;
                // MessageBox.Show("Current time: " + now);
                com.Connection = con;
                com.CommandText = "insert into Logout_Scheduld values ('" + name + "','" + now + "')";
               com.ExecuteNonQuery();
                com.Dispose();

                HOME l1 = new HOME();
                this.Hide();
                l1.Show();
            }
            else
            {
                MessageBox.Show("FOR LOGOUT FILL ENTRY");
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            if (NAME4.Text != "" & UNAME4.Text != "" & PSWD4.Text != "" & CPSWD4.Text != "" & pictureBox2.Image != null & EML4.Text != "" & UTYPE4.Text != "" & NID4.Text != "" & DEPTT4.Text != "")
            {
                if (PSWD4.Text != CPSWD4.Text)
                {
                    MessageBox.Show("PLEASE... \n ENTER THE CORRECT PASSWORD !!!");
                }
                else
                {
                    com.Connection = con;
                    com.CommandText = "Select Uname from Faculty_Info where Uname='" + UNAME4.Text + "'";
                    Int32 reg = Convert.ToInt32(UNAME4.Text);
                    Int32 count = Convert.ToInt32(com.ExecuteScalar());
                    if (count == reg)
                    {
                        MessageBox.Show("YOU HAVE ALREADY REGISTERED OR USER NAME ALREADY USED");
                    }
                    else
                    {
                        com.CommandText = "insert into Others_Info(name,Uname,Paswrd,Email,Utype,Nid,Dept) values ('" + NAME4.Text + "','" + UNAME4.Text + "','" + PSWD4.Text + "','" + EML4.Text + "','" + UTYPE4.Text + "','" + NID4.Text + "','" + DEPTT4.Text + "')";
                        com.ExecuteNonQuery();
                        com.Dispose();
                        //MessageBox.Show("record inserted");

                        MessageBox.Show("YOU HAVE BEEN REGISTERED SUCCESSFULLY !!!");
                        //     MessageBox.Show("YOUR FINGER PRINT NO IS : "+count);

                        HOME l3 = new HOME();
                        this.Hide();
                        l3.Show();

                    //MessageBox.Show("YOU HAVE BEEN REGISTERED SUCCESSFULLY !!!");
                    //     MessageBox.Show("YOUR FINGER PRINT NO IS : "+count);

                   // LOGIN_PAGE l3 = new LOGIN_PAGE();
                    //this.Hide();
                    //l3.Show();
                }
            }
               }

            else
            {

                MessageBox.Show(" PLEASE..... \n FILL ALL THE ENTERIES, ALL ENTERIES ARE MANDATORY !!! ");
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     HOME a4 = new  HOME();
     this.Hide();
     a4.Show();
 }
 private void button2_Click(object sender, EventArgs e)
 {
     MessageBox.Show(" YOU HAVE CANCELED YOUR REGISTRATION !!! ");
     HOME a1 = new HOME();
     this.Hide();
     a1.Show();
 }
        private void button4_Click(object sender, EventArgs e)
        {
            if (NAME1.Text != "" & UNAME1.Text != "" & PSWD1.Text != "" & CPSWD1.Text != "" & pictureBox1.Image != null & EML1.Text != "" & UTYPE1.Text != "" & AID1.Text != "")
            {
                if (PSWD1.Text != CPSWD1.Text)
                {
                    MessageBox.Show("PLEASE... \n ENTER THE CORRECT PASSWORD !!!");
                }
                else
                {
                    com.Connection = con;
                    com.CommandText = "Select Uname from Admin_Info where Uname='" + UNAME1.Text + "'";
                    Int32 reg = Convert.ToInt32(UNAME1.Text);
                    Int32 count = Convert.ToInt32(com.ExecuteScalar());
                    if (count == reg)
                    {
                        MessageBox.Show("YOU HAVE ALREADY REGISTERED YOURSELF...");
                    }
                    else
                    {
                        com.CommandText = "insert into Admin_Info(Aname,Uname,Paswrd,Email,Utype,Aid) values ('" + NAME1.Text + "','" + UNAME1.Text + "','" + PSWD1.Text + "','" + EML1.Text + "','" + UTYPE1.Text + "','" + AID1.Text + "')";
                        com.ExecuteNonQuery();
                        com.Dispose();
                        //MessageBox.Show("record inserted");

                        MessageBox.Show("YOU HAVE BEEN REGISTERED SUCCESSFULLY !!!");
                        //     MessageBox.Show("YOUR FINGER PRINT NO IS : "+count);

                        HOME l3 = new HOME();
                        this.Hide();
                        l3.Show();
                    }
                }
            }

            else
            {

                MessageBox.Show(" PLEASE..... \n FILL ALL THE ENTERIES, ALL ENTERIES ARE MANDATORY !!! ");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (checkedListBox1.Text == "")
            {
                MessageBox.Show("Please...\n FIRST CHOOSE THE PURPOSE");
                // STUDENT_PURPOSE sp = new STUDENT_PURPOSE();
                //this.Hide();
                //sp.Show();
            }
            /*com.Connection = con;
            com.CommandText = "insert into Sighin_Info(Uname,Paswrd,Utype) values ('" + UNAME.Text + "','" + PWD.Text + "','" + UTYPE.Text + "')";
            com.ExecuteNonQuery();
            com.Dispose();*/
            //MessageBox.Show("record inserted");
            else
            {
                /*com.Connection = con;
               // com.CommandText = "select * from Sigin Paswrd= '" + NPWD.Text + "' WHERE Uname = '" + UNM.Text + "'";//(Sname,Uname,Paswrd,Email,Utype,Rlno,Sem,Batch,Deg,Dept) values ('" + RNO.Text + "','" + OPWD.Text + "','" + NPWD.Text + "')";
                //com.CommandText = "update Student_Info set Paswrd= '" + NPWD.Text + "' WHERE Uname = '" + UNM.Text + "'";//(Sname,Uname,Paswrd,Email,Utype,Rlno,Sem,Batch,Deg,Dept) values ('" + RNO.Text + "','" + OPWD.Text + "','" + NPWD.Text + "')";
                com.ExecuteNonQuery();
                com.Dispose();*/

                MessageBox.Show("YOU HAVE CHOOSEN THE VALID PURPOSE. \n NOW YOU CAN ENTER !!!");
                DateTime now = DateTime.Now;
                MessageBox.Show("Current time: " + now);
                com.Connection = con;
                com.CommandText = "insert into Login_Scheduld values ('" + uname + "','" + now + "')";
                com.ExecuteNonQuery();
                com.Dispose();

               // MessageBox.Show("YOU HAVE CHOOSEN THE VALID PURPOSE. \n NOW YOU CAN ENTER !!!");
               HOME l1 = new HOME();
                this.Hide();
                l1.Show();
            }
        }
 private void button3_Click_1(object sender, EventArgs e)
 {
     HOME l = new HOME();
     this.Hide();
     l.Show();
 }
 private void CANCEL2_Click(object sender, EventArgs e)
 {
     HOME a2 = new HOME();
     this.Hide();
     a2.Show();
 }
 private void button3_Click(object sender, EventArgs e)
 {
     /* MessageBox.Show(
                  this, // needs a reference to the "Owner" form
                           "this is my text", // text to be shown in the message box
                "this is the caption", // Title of the message box
             MessageBoxButtons.OK, // Button to show
                 MessageBoxIcon.Warning); // Icon to show//CANCEl c1 = new CANCEl();
     //this.Hide();
     //c1.Show();/*/
        MessageBox.Show("YOU HAVE BEEN CANCELD YOUR LOG_IN  :( !!!");
        HOME m = new HOME();
        this.Hide();
        m.Show();
 }
        private void button2_Click(object sender, EventArgs e)
        {

            string count;

            if (UNAM.Text != "" & pictureBox1.Image != null && UTYPE.Text != "")
            {

                if (UTYPE.SelectedItem.ToString() == "ADMIN")
                {
                    com.Connection = con;
                    com.CommandText = "Select Paswrd from Admin_Info where Uname='" + UNAM.Text + "' and Utype='" + UTYPE.Text + "'";
                   // MessageBox.Show("b");
                    //Int32 nam = Convert.ToInt32(UNAME.Text);
                    count = Convert.ToString(com.ExecuteScalar());
                   // SqlDataReader read_rd
                    MessageBox.Show(" YOUR PASSWORD IS: " +count);
                    HOME hm = new HOME();
                    this.Hide();
                    hm.Show();
                }

                if (UTYPE.SelectedItem.ToString() == "FACULTY")
                {
                    com.Connection = con;
                    com.CommandText = "Select Paswrd from Faculty_Info where Uname='" + UNAM.Text + "' and Utype='" + UTYPE.Text + "'";
                    // MessageBox.Show("b");
                    //Int32 nam = Convert.ToInt32(UNAME.Text);
                    count = Convert.ToString(com.ExecuteScalar());
                    // SqlDataReader read_rd
                    MessageBox.Show(" YOUR PASSWORD IS: " + count);
                    HOME hm = new HOME();
                    this.Hide();
                    hm.Show();
                }

                if (UTYPE.SelectedItem.ToString() == "STUDENT")
                {
                    com.Connection = con;
                    com.CommandText = "Select Paswrd from Student_Info where Uname='" + UNAM.Text + "' and Utype='" + UTYPE.Text + "'";
                    // MessageBox.Show("b");
                    //Int32 nam = Convert.ToInt32(UNAME.Text);
                    count = Convert.ToString(com.ExecuteScalar());
                    // SqlDataReader read_rd
                    MessageBox.Show(" YOUR PASSWORD IS: " + count);
                    HOME hm = new HOME();
                    this.Hide();
                    hm.Show();
                }

                if (UTYPE.SelectedItem.ToString() == "OTHERS")
                {
                    com.Connection = con;
                    com.CommandText = "Select Paswrd from Others_Info where Uname='" + UNAM.Text + "' and Utype='" + UTYPE.Text + "'";
                    // MessageBox.Show("b");
                    //Int32 nam = Convert.ToInt32(UNAME.Text);
                    count = Convert.ToString(com.ExecuteScalar());
                    // SqlDataReader read_rd
                    MessageBox.Show(" YOUR PASSWORD IS: " + count);
                    HOME hm = new HOME();
                    this.Hide();
                    hm.Show();
                }

            }
            else
            {
                MessageBox.Show(" PLEASE..... \n FILL ALL THE ENTERIES !!! "); //MessageBox.Show(" YOU HAVE FILLED ALL THE ENTERIES !!! ");
                //this.Hide(); 
            }

        }