Exemplo n.º 1
0
        private DataTable GetTableForExecl()
        {
            DataTable table = new DataTable();

            table.Columns.Add("StudentID");
            table.Columns.Add("SN");
            table.Columns.Add("NAME OF CANDIDATE");
            table.Columns.Add("Exam NO");
            table.Columns.Add("Subject");
            table.Columns.Add("Present");
            table.Columns.Add("Mark");
            table.Columns.Add("Remarks");
            table.Columns.Add("ExaminationID");
            table.Columns.Add("Examination");
            table.Columns.Add("SessionID");
            table.Columns.Add("Session");
            table.Columns.Add("SchoolId");
            table.Columns.Add("SubjectId");

            int    exam    = int.Parse(ddlExam.SelectedValue.ToString());
            int    session = int.Parse(ddlYear.SelectedValue.ToString());
            string subject = ddlSubject.SelectedValue.ToString();
            //string userId = string.Empty;
            //try
            //{
            //    userId = User.Identity.GetUserId();
            //}
            //catch (Exception ex)
            //{
            //    Response.Redirect("~/Account/Login");
            //}

            //Models.School school = dropManager.GetSchoolByUserId(userId);
            var registration = DropDownManager.GetRegistrations(SessionUser.SchoolId, session, exam, subject);

            if (registration.Count() > 0 && registration != null)
            {
                int counter = 1;
                foreach (var item in registration)
                {
                    int    studentId   = item.StudentId;
                    string name        = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                    string examNum     = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                    string attendance  = item.Attendance?.ToString();
                    string mark        = item.TotalScore.ToString() ?? "";
                    string subjectName = item.Subject.Name;
                    string remark      = item.AttendanceRemarks ?? "";
                    string examName    = item.Examination.Name;
                    string examId      = item.ExamId.ToString();
                    int    sessionId   = item.SessionId.Value;
                    string year        = item.Session.Name;
                    table.Rows.Add(studentId, counter, name, examNum, subjectName, attendance, mark, remark, examId, examName, sessionId, session, SessionUser.SchoolId, item.SubjectId);
                    counter++;
                }
            }
            return(table);
        }
Exemplo n.º 2
0
        public bool ApproveOrRejectSchedule(bool status, int schoolId, string examId, string session)
        {
            int exam      = 0;
            int sessionId = 0;

            int.TryParse(session, out sessionId);
            int.TryParse(examId, out exam);
            var registeredExam = DropDownManager.GetRegistrations(schoolId, sessionId, exam).FirstOrDefault();

            registeredExam.EntyScheduleApprovedByInspector = status;
            unitOfWork.ExamRegistered.Update(registeredExam);
            unitOfWork.Save();
            return(true);
        }
        public DataTable BuildTableForExcelSecondary()
        {
            DataTable table = new DataTable();

            table.Columns.Add("StudentID");
            table.Columns.Add("SN");
            table.Columns.Add("Name Of Student");
            table.Columns.Add("Exam NO");
            table.Columns.Add("Sex");
            table.Columns.Add("ENG. STUDIES");
            table.Columns.Add("MATHS");
            table.Columns.Add("BASIC SCIENCE & TECHNOLOGY");
            table.Columns.Add("RELIGION & NATIONAL VALUES");
            table.Columns.Add("CULTURAL & CREATIVE ARTS");
            table.Columns.Add("NIGERIA LANGUAGE(EDO)");
            table.Columns.Add("PRE-VOCATIONAL");
            table.Columns.Add("FRENCH LANGUAGE");
            table.Columns.Add("BUSINESS STUDIES");
            table.Columns.Add("ARABIC");
            table.Columns.Add("PRATICAL 5MRKS");
            table.Columns.Add("NO OF SUBJECTS ENTERED FOR");
            table.Columns.Add("STUDENTS SIGNATURE");
            table.Columns.Add("REMARKS");
            table.Columns.Add("ExaminationID");
            table.Columns.Add("SessionID");
            table.Columns.Add("SchoolId");

            int    exam         = int.Parse(ddlExam.SelectedValue.ToString());
            int    session      = int.Parse(ddlYear.SelectedValue.ToString());
            string userId       = string.Empty;
            var    registration = DropDownManager.GetRegistrations(SessionUser.SchoolId, session, exam);

            if (registration.Count() > 0 && registration != null)
            {
                int counter = 1;
                foreach (var item in registration)
                {
                    int    studentId = item.StudentId;
                    string name      = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                    string examNum   = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                    string sex       = item.Student.Sex;

                    table.Rows.Add(studentId, counter, name, examNum, sex, "", "", "", "", "", "", "", "", "", "", "", "", "", "", item.ExamId, item.SessionId, SessionUser.SchoolId);
                }
            }
            return(table);
        }
Exemplo n.º 4
0
        public bool ApproveOrRejectAttendance(bool status, int schoolId, string examId, string subjectId, string session)
        {
            int exam      = 0;
            int sessionId = 0;

            int.TryParse(session, out sessionId);
            int.TryParse(examId, out exam);
            var registeredExam = DropDownManager.GetRegistrations(schoolId, sessionId, exam, subjectId);

            foreach (var item in registeredExam)
            {
                item.AttendanceApprovedByInspector = status;
                unitOfWork.ExamRegistered.Update(item);
                unitOfWork.Save();
            }
            return(true);
        }
Exemplo n.º 5
0
        public void PopulateTable()
        {
            DataTable table = new DataTable();

            table.Columns.Add("SN");
            table.Columns.Add("Name");
            table.Columns.Add("Exam_NO");
            table.Columns.Add("Present");
            table.Columns.Add("Mark");
            table.Columns.Add("Remarks");

            int    exam    = int.Parse(ddlExam.SelectedValue.ToString());
            int    session = int.Parse(ddlYear.SelectedValue.ToString());
            string subject = ddlSubject.SelectedValue.ToString();

            lblExamName.Text = ddlSubject.SelectedItem.Text;


            var registration = DropDownManager.GetRegistrations(SessionUser.SchoolId, session, exam, subject);

            if (registration.Count() > 0 && registration != null)
            {
                int counter = 1;
                foreach (var item in registration)
                {
                    string name       = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                    string examNum    = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                    string attendance = item.Attendance?.ToString();
                    string mark       = item.TotalScore.ToString() ?? "";
                    string remark     = item.AttendanceRemarks ?? "";

                    table.Rows.Add(counter, name, examNum, attendance, mark, remark);
                    counter++;
                }
                gvSchool.DataSource = table;
                gvSchool.DataBind();
                divBtn.Visible = true;
            }
            else
            {
                table.Rows.Add("", " No Record found ", "", "", "", "");
                gvSchool.DataSource = table;
                gvSchool.DataBind();
                divBtn.Visible = false;
            }
        }
        void PopulateTable()
        {
            DataTable table = new DataTable();

            table.Columns.Add("SN");
            table.Columns.Add("Name");
            table.Columns.Add("Exam NO");
            table.Columns.Add("Sex");
            lblExamName.Text = ddlExam.SelectedItem.Text;
            if (SessionUser.CategoryId == 1)
            {
                table.Columns.Add("Eng");
                table.Columns.Add("Maths");
                table.Columns.Add("Gen");
                table.Columns.Add("C.R.S");
                table.Columns.Add("I.R.S");
                table.Columns.Add("VOC");
                table.Columns.Add("Num");
                table.Columns.Add("Sign");
                table.Columns.Add("Remarks");

                int    exam         = int.Parse(ddlExam.SelectedValue.ToString());
                int    session      = int.Parse(ddlYear.SelectedValue.ToString());
                string userId       = string.Empty;
                var    registration = DropDownManager.GetRegistrations(SessionUser.SchoolId, session, exam);
                if (registration.Count() > 0 && registration != null)
                {
                    int counter = 1;
                    foreach (var item in registration)
                    {
                        //int studentId = item.StudentId;
                        string name    = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                        string examNum = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                        string sex     = item.Student.Sex;

                        table.Rows.Add(counter, name, examNum, sex, "", "", "", "", "", "", "", "", "");
                        ++counter;
                    }
                    gvPrimary.DataSource = table;
                    gvPrimary.DataBind();
                    divSec.Visible = false;
                    divPri.Visible = true;
                }
            }
            else
            {
                table.Columns.Add("Eng");
                table.Columns.Add("Maths");
                table.Columns.Add("SciTech");
                table.Columns.Add("Rel");
                table.Columns.Add("Arts");
                table.Columns.Add("Nig");
                table.Columns.Add("Pre");
                table.Columns.Add("French");
                table.Columns.Add("Bus");
                table.Columns.Add("Arabic");
                table.Columns.Add("Pratical");
                table.Columns.Add("Num");
                table.Columns.Add("Sign");
                table.Columns.Add("Remarks");

                int    exam         = int.Parse(ddlExam.SelectedValue.ToString());
                int    session      = int.Parse(ddlYear.SelectedValue.ToString());
                string userId       = string.Empty;
                var    registration = DropDownManager.GetRegistrations(SessionUser.SchoolId, session, exam);
                if (registration.Count() > 0 && registration != null)
                {
                    int counter = 1;
                    foreach (var item in registration)
                    {
                        //int studentId = item.StudentId;
                        string name    = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                        string examNum = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                        string sex     = item.Student.Sex;

                        table.Rows.Add(counter, name, examNum, sex, "", "", "", "", "", "", "", "", "", "", "", "", "", "");
                    }
                    gvSchool.DataSource = table;
                    gvSchool.DataBind();
                    divSec.Visible = true;
                    divPri.Visible = false;
                }
            }
        }
Exemplo n.º 7
0
        public void PopulateAttendancePri(string SchoolId)
        {
            int schoolId = 0;

            int.TryParse(SchoolId, out schoolId);
            DataTable table = new DataTable();

            table.Columns.Add("ID");
            table.Columns.Add("SN");
            table.Columns.Add("Name");
            table.Columns.Add("Exam_NO");
            table.Columns.Add("Present");
            table.Columns.Add("Mark");
            table.Columns.Add("Remarks");
            table.Columns.Add("Status");
            int    exam    = int.Parse(ddlExam.SelectedValue.ToString());
            int    session = int.Parse(ddlYear.SelectedValue.ToString());
            string subject = ddlSubject.SelectedValue.ToString();
            // lblExamName.Text = ddlSubject.SelectedItem.Text;


            var registration = DropDownManager.GetRegistrations(schoolId, session, exam, subject);

            if (registration.Count() > 0 && registration != null)
            {
                int counter = 1;
                foreach (var item in registration)
                {
                    string id         = item.SubjectId.ToString();
                    string name       = $"{item.Student.LastName} {item.Student.FirstName} {item.Student.MiddleName ?? ""}";
                    string examNum    = item.StudentRegNum ?? $"{item.Examination.ExamCode}00{counter} ";
                    string attendance = item.Attendance?.ToString();
                    string mark       = item.TotalScore.ToString() ?? "";
                    string remark     = item.AttendanceRemarks ?? "";
                    string status     = item.AttendanceApprovedByInspector?.ToString() ?? "False";
                    table.Rows.Add(counter, name, examNum, attendance, mark, remark);
                    counter++;
                }
                gvAttendance.DataSource = table;
                gvAttendance.DataBind();
                gvAttendance1.DataSource = table;
                gvAttendance1.DataBind();
                gvAttendance1.HeaderRow.TableSection = TableRowSection.TableHeader;
                gvAttendance.HeaderRow.TableSection  = TableRowSection.TableHeader;

                int RowCount = gvAttendance.Rows.Count - 1;
                btnAttendApprove.Enabled = false;
                btnAttendReject.Enabled  = false;
                if (gvAttendance.Rows[RowCount - 1].Cells[7].Text.ToUpper() != "TRUE")
                {
                    btnAttendApprove.Enabled = true;
                }
                else
                {
                    btnAttendReject.Enabled = true;
                }

                int RowCount1 = gvAttendance1.Rows.Count - 1;
                btnSecAttendApprove.Enabled = false;
                btnSecAttendReject.Enabled  = false;
                if (gvAttendance1.Rows[RowCount - 1].Cells[7].Text.ToUpper() != "TRUE")
                {
                    btnSecAttendApprove.Enabled = true;
                }
                else
                {
                    btnSecAttendReject.Enabled = true;
                }
                divBtn.Visible  = true;
                divBtn1.Visible = true;
            }
            else
            {
                table.Rows.Add("", "", " No Record found ", "", "", "");
                gvAttendance1.DataSource = table;
                gvAttendance1.DataBind();
                gvAttendance.DataSource = table;
                gvAttendance.DataBind();
                gvAttendance1.Visible = true;
                gvAttendance.Visible  = true;
                divBtn.Visible        = false;
                divBtn1.Visible       = false;
            }
        }