示例#1
0
        //private DataTable RetrieveDetail()
        //{
        //    DataTable dtAtt = new DataTable();
        //    string constring = ConfigurationManager.ConnectionStrings["dbx"].ConnectionString;
        //    using (SqlConnection con = new SqlConnection(constring))
        //    {
        //        using (SqlCommand cmd = new SqlCommand("SELECT * FROM Total_Attendance_db", sqlcon))
        //        {
        //            con.Open();
        //            SqlDataAdapter reader = cmd.ExecuteReader();
        //        }
        //    }
        //        return dtAtt;
        //}

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            AttendanceTable ATT = new AttendanceTable();

            ATT.Show();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult dialog = MessageBox.Show("Are You Sure You Want To End Session?", "END SESSION?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialog == DialogResult.Yes)
            {
                timer1.Stop();
                sqlcon.Open();
                string     name = sessionName.Text;
                SqlCommand cmd  = new SqlCommand();
                cmd = new SqlCommand("UPDATE Total_Attendance_db set " + name + " = '0' WHERE " + name + " IS NULL ", sqlcon);
                cmd.ExecuteNonQuery();
                sqlcon.Close();

                this.Close();


                AttendanceTable ATT = new AttendanceTable();
                ATT.Show();
            }
            else if (dialog == DialogResult.No)
            {
                MessageBox.Show("Ok, Continue...");
            }
        }