private void btnUpdate_Click(object sender, EventArgs e) { AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService(); string res = null; for (int i = 0; i < temp; i++) { if (listStudents.GetItemChecked(i)) { res = aws.markAttendanceBLL(update.Tables[0].Rows[i][0].ToString(), dt.Text, "P", 1);//1 indiactes update existing attendance } else { res = aws.markAttendanceBLL(update.Tables[0].Rows[i][0].ToString(), dt.Text, "A", 1); } } MessageBox.Show("Attendance Has Been Successfully Updated", "Success Report"); dTable.Clear(); update.Clear(); count = 0; temp = 0; }
private void btnSubmit_Click(object sender, EventArgs e) { AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService(); string res = null; string a = s.Tables[0].Rows[0][0].ToString(); for (int i = 0; i < s.Tables[0].Rows.Count; i++) { if (listStudents.GetItemChecked(i)) { res = aws.markAttendanceBLL(s.Tables[0].Rows[i][0].ToString(), dt.Text, "P", 0);// 0 indiactes to Mark New Attendance if (res == "false") { break; } } else { res = aws.markAttendanceBLL(s.Tables[0].Rows[i][0].ToString(), dt.Text, "A", 0); if (res == "false") { break; } } } if (res == "false") { MessageBox.Show("Attendance Has Already Been Marked on This Date", "Permission Denied"); } else { MessageBox.Show("Attendance Has Been Successfully Marked", "Success Report"); } }