Esempio n. 1
0
        private void Check_Attendence_Load(object sender, EventArgs e)
        {
            AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService();
            aws.getStudentDetailsBLL(svi.li.user, ref svi.fName, ref svi.lName, ref svi.rollNo);
            lblName.Text   = svi.fName + " " + svi.lName;
            lblRollNo.Text = svi.rollNo;

            DataSet attd = new DataSet();

            attd = aws.getAttendanceBLL(svi.rollNo);
            gridCheckAttendance.DataSource = attd.Tables[0];
            int p = 0, a = 0, totalDays = 0;

            for (int i = 0; i < attd.Tables[0].Rows.Count; i++)
            {
                if (attd.Tables[0].Rows[i][1].ToString() == "P")
                {
                    p++;
                }
                if (attd.Tables[0].Rows[i][1].ToString() == "A")
                {
                    a++;
                }
            }
            totalDays             = a + p;
            lblTotalAbsents.Text  = a.ToString();
            lblTotalPresents.Text = p.ToString();
            lblTotalDays.Text     = totalDays.ToString();
        }
 private void Mark_Attendence_Load(object sender, EventArgs e)
 {
     lblClass.Text = t.ClassName;
     AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService();
     s = aws.displayStudentsBLL(lblClass.Text);
     listStudents.Visible = true;
     for (int i = 0; i < s.Tables[0].Rows.Count; i++)
     {
         listStudents.Items.Add(s.Tables[0].Rows[i][0]);
     }
 }
        private void dt_ValueChanged(object sender, EventArgs e)
        {
            AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService();

            s.Clear();
            s = aws.displayStudentsBLL(lblClass.Text);
            listStudents.Items.Clear();


            for (int i = 0; i < s.Tables[0].Rows.Count; i++)
            {
                listStudents.Items.Add(s.Tables[0].Rows[i][0]);
            }
        }
Esempio n. 4
0
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            listStudents.Items.Clear();

            AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService();

            //DataSet s = new DataSet();
            //ma.s = aws.displayStudentsBLL(lblClass.Text);

            /*for (int i = 0; i < s.Tables[0].Rows.Count; i++)
             * {
             *  listStudents.Items.Add(s.Tables[0].Rows[i][0]);
             * }*/


            update = new DataSet();

            dTable = new DataTable("present");
            update.Tables.Add(dTable);

            update.Tables[0].Rows.Add(dTable.NewRow());
            dc = new DataColumn();
            update.Tables[0].Columns.Add(dc);


            for (int i = 0; i < ma.s.Tables[0].Rows.Count; i++)
            {
                string a = aws.display4UpdateStudentsBLL(ma.s.Tables[0].Rows[i][0].ToString(), dt.Text);
                if (a == "P")
                {
                    continue;
                }
                else if (a == "false")
                {
                    MessageBox.Show("First you have to use Mark Attendance button from the previos screen to mark attendance on this date only then you can update on this date. ", "Permission Denied");
                    break;
                }
                else
                {
                    listStudents.Items.Add(a);
                    update.Tables[0].Rows[count][0] = a;
                    update.Tables[0].Rows.Add(dTable.NewRow());
                    count++;
                }
            }
            temp  = count;
            count = 0;
        }
Esempio n. 5
0
        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");
            }
        }
 private void Student_View_Information_Load(object sender, EventArgs e)
 {
     AttendanceWS.AttendanceWebService aws = new PakTurk_school_system.AttendanceWS.AttendanceWebService();
     aws.getStudentDetailsBLL(li.user, ref fName, ref lName, ref rollNo);
 }