Пример #1
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            if (Class1.stuId != -1)
            {
                SqlConnection newcon1 = new SqlConnection(con);
                newcon1.Open();
                string     qu     = "update ClassAttendance set AttendanceDate='" + dateTimePicker1.Value.Date + "' where Id='" + Class1.stuId + "'";
                SqlCommand newcom = new SqlCommand(qu, newcon1);
                newcom.ExecuteNonQuery();
                newcon1.Close();
                Class1.stuId = -1;
            }
            else
            {
                SqlConnection newcon = new SqlConnection(con);
                newcon.Open();
                string     qu     = "insert into ClassAttendance(AttendanceDate) values('" + dateTimePicker1.Value.Date + "')";
                SqlCommand newcom = new SqlCommand(qu, newcon);
                newcom.ExecuteNonQuery();
                newcon.Close();
            }
            this.Hide();
            ClassAttendance back = new ClassAttendance();

            back.Show();
        }
Пример #2
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            ClassAttendance bck = new ClassAttendance();

            bck.Show();
        }
Пример #3
0
        private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            ClassAttendance add = new ClassAttendance();

            add.Show();
        }