Ejemplo n.º 1
0
        public void LoadRecipt()
        {
            var ExamRegistered = DropDownManager.GetRegistrationsById(lblID.Text);

            //DataTable dt = new DataTable();
            //dt.Columns.Add("SN");
            //dt.Columns.Add("Type");
            //dt.Columns.Add("Student");
            //dt.Columns.Add("Date");
            //dt.Columns.Add("Amount");

            foreach (var item in ExamRegistered)
            {
                lblInvoiceNo.Text     = "234245453";
                lblDate.Text          = item.DateRegistered.ToLongDateString();
                lblSchoolAddress.Text = item.School.Address;
                lblSchoolEmail.Text   = item.School.Email;
                lblSchoolLGA.Text     = item.School.LocalGovernment.LocalGovernment1;
                lblschoolName.Text    = item.School.Name;
                int nostudent = int.Parse(noOfStudent.Text);
                var fee       = int.Parse(item.Examination.Fee) * nostudent;
                lblDateFReg.Text   = item.DateRegistered.ToLongDateString();
                lblFeeAmount.Text  = fee.ToString();
                lblSubTotal.Text   = fee.ToString();
                lblFeesType.Text   = lblExamCode1.Text;
                lblNoFStudent.Text = nostudent.ToString();
                lblTotal.Text      = Convert.ToDecimal(fee).ToString();
                LoadBarcode(item.Examination.ExamCode + "" + item.StudentId + "" + item.SchoolId);
                return;
            }
        }
Ejemplo n.º 2
0
        public void LoadAllStudent()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("Name");
            dt.Columns.Add("Sex");
            dt.Columns.Add("Date");
            dt.Columns.Add("School");
            dt.Columns.Add("Status");

            var student = DropDownManager.GetAllStudents(null);

            if (student != null)
            {
                int sn = 0;
                foreach (var item in student)
                {
                    string status = GetStatus(item.StudentId);
                    string Name   = item.FirstName + "" + item.MiddleName + " " + item.LastName.ToString();
                    string sex    = item.Sex.ToString();
                    string Date   = item.DateOfBirth.ToString();
                    string school = item.School.Name;
                    sn++;

                    dt.Rows.Add(sn, Name, sex, Date, school, status);
                }

                gvStudents.DataSource = dt;
                gvStudents.DataBind();
            }
        }
Ejemplo n.º 3
0
        protected void tblGeneral_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int    tempsessionId = GeneralUtility.GetCurrentSessionId();
            string SessionId     = ddlyear.SelectedValue.ToString();
            string Lga           = ddlLgda.SelectedValue.ToString();
            string id            = e.CommandArgument.ToString();

            lblSchoolId.Text = id;
            if (e.CommandName.ToLower() == "doapprove")
            {
                string CountApproved = GeneralUtility.ApproveSchool(int.Parse(id), tempsessionId);
                int    i             = 0;
                if (int.TryParse(CountApproved, out i) && int.Parse(CountApproved) > 0)
                {
                    DropDownManager.ShowPopUp("Operation Successful, " + CountApproved + " Records Approved");
                    return;
                }
                else
                {
                    DropDownManager.ShowPopUp("Operation Not Successful, No Records Approved");
                    return;
                }
            }
            else if (e.CommandName.ToLower() == "doview")
            {
                LoadAllStudents(tempsessionId, int.Parse(id));
                panelStudent.Visible = true;
                PnlSchool.Visible    = false;
            }
        }
Ejemplo n.º 4
0
        public void PopulateExam()
        {
            var userId = HttpContext.Current.User.Identity.GetUserId();
            var school = DropDownManager.GetSchoolByUserId(userId);

            if (school != null)
            {
                lblSchoolId.Text   = school.Id.ToString();
                lblSchoolType.Text = school.SchoolTypeId.ToString();
                lblSchoolCat.Text  = school.CategoryId.ToString();
                string catId = school.CategoryId.ToString();

                var dt = new DataTable();
                dt.Columns.Add("SN");
                dt.Columns.Add("ID");
                dt.Columns.Add("EXAM");
                dt.Columns.Add("EXAMCODE");
                dt.Columns.Add("FEE");

                var Exams = DropDownManager.GetExaminations(catId);
                int sn    = 0;
                foreach (var item in Exams)
                {
                    string examId     = item.ExamId.ToString();
                    string examName   = item.Name.ToString();
                    string examCode   = item.ExamCode.ToString();
                    string examFee    = item.Fee.ToString();
                    string examStatus = item.Activated.ToString();
                    sn++;
                    dt.Rows.Add(sn, examId, examName, examCode, examFee);
                }
                gvExam.DataSource = dt;
                gvExam.DataBind();
            }
        }
Ejemplo n.º 5
0
 protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlState.SelectedIndex > 0)
     {
         DropDownManager.GetLGA(ddlLGA, ddlState.SelectedValue.TrimEnd());
     }
 }
Ejemplo n.º 6
0
        public void PopulateExamDetails()
        {
            var dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("NAME");
            dt.Columns.Add("SCHOOL");
            dt.Columns.Add("EXAMINATION");
            dt.Columns.Add("FEES");
            dt.Columns.Add("EXAMID");


            var Exams = DropDownManager.GetRegisteredStudents();
            int sn    = 0;

            foreach (var item in Exams)
            {
                string id         = item.StudentID.ToString();
                string Name       = item.StudentName;
                string schoolName = item.SchoolName;
                string Exam       = item.ExamCode;
                string ExamId     = item.ExamId.ToString() + "," + item.StudentID.ToString() + "," + item.SchoolId.ToString();
                string Fee        = item.Fee;
                sn++;
                dt.Rows.Add(sn, Name, schoolName, Exam, Fee, ExamId);
            }
            gvSubject.DataSource = dt;
            gvSubject.DataBind();
        }
Ejemplo n.º 7
0
        public void LoadAllStudent()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("ID");
            dt.Columns.Add("Name");
            dt.Columns.Add("Sex");
            dt.Columns.Add("Date");
            dt.Columns.Add("School");
            dt.Columns.Add("Status");

            var student = DropDownManager.GetAllStudents(null);

            if (student != null)
            {
                int sn = 0;
                foreach (var item in student)
                {
                    string id     = item.StudentId.ToString();
                    string status = GetStatus(item.StudentId);
                    string Name   = item.FirstName + " " + item.MiddleName + " " + item.LastName.ToString();
                    string sex    = item.Sex.ToString();
                    string Date   = item.DateCreated ?? DateTime.Now.ToLongDateString();
                    string school = item.School.Name;
                    sn++;

                    dt.Rows.Add(sn, id, Name, sex, Date, school, status);
                }
                gvStudents.DataSource = dt;
                gvStudents.DataBind();
                gvStudents.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
Ejemplo n.º 8
0
 protected void btnSecEntryReject_Click(object sender, EventArgs e)
 {
     if (inspectorServices.ApproveOrRejectSchedule(false, SessionUser.SchoolId, ddlExam1.SelectedValue, ddlYear1.SelectedValue))
     {
         DropDownManager.ShowPopUp("Approved Successfully !!!");
         //PopulateAttendancePri(SessionUser.SchoolId.ToString());
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropDownManager.PopulateExam(ddlExam, SessionUser.CategoryId);
         DropDownManager.PopulateYear(ddlYear);
     }
 }
Ejemplo n.º 10
0
        //DropDownManager dropDownManager = new DropDownManager();

        //public LgaInspector(InspectorServices inspectorServicesParam)
        //{
        //    inspectorServices = inspectorServicesParam;
        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DropDownManager.GetTitle(ddlTitle);
                loadTable();
            }
        }
Ejemplo n.º 11
0
 protected void btnAttendApprove_Click(object sender, EventArgs e)
 {
     if (inspectorServices.ApproveOrRejectAttendance(true, SessionUser.SchoolId, ddlExam.SelectedValue, ddlSubject.SelectedValue, ddlYear.SelectedValue))
     {
         DropDownManager.ShowPopUp("Approved Successfully !!!");
         PopulateAttendancePri(SessionUser.SchoolId.ToString());
     }
 }
Ejemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropDownManager.PopulateYear(ddlYear);
         DropDownManager.PopulateSchool(ddlSchool);
         DropDownManager.GetLGA(ddlLocalGovt, "ED");
     }
 }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (SessionUser == null)
     {
         Response.Redirect("~/Account/Login");
     }
     DropDownManager.PopulateExam(ddlExam, SessionUser.CategoryId);
     DropDownManager.PopulateYear(ddlYear);
 }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
0
        //DropDownManager dropDownManager = new DropDownManager();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DropDownManager.PopulateRelation(ddlRelation);
                DropDownManager.GetLGA(ddlLGA, null);
                DropDownManager.GetState(ddlState);
                DropDownManager.GetGender(ddlSex);
            }
        }
Ejemplo n.º 16
0
        private void createDropDownForErrorType()
        {
            DropDownManager dropDownManager = new DropDownManager();

            ViewBag.Machine  = dropDownManager.getErrorTypeForD5DropDown("Machine");
            ViewBag.Method   = dropDownManager.getErrorTypeForD5DropDown("Method");
            ViewBag.Men      = dropDownManager.getErrorTypeForD5DropDown("Men");
            ViewBag.Material = dropDownManager.getErrorTypeForD5DropDown("Material");
            ViewBag.Monde    = dropDownManager.getErrorTypeForD5DropDown("Monde");
        }
Ejemplo n.º 17
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (ValidateInputs())
     {
         var manager       = Context.GetOwinContext().GetUserManager <ApplicationUserManager>();
         var signInManager = Context.GetOwinContext().Get <ApplicationSignInManager>();
         var user          = new ApplicationUser()
         {
             UserName = txtEmail.Value, Email = txtEmail.Value, PhoneNumber = txtMobileNo.Value
         };
         IdentityResult result = manager.Create(user, "@1234567");
         if (result.Succeeded)
         {
             // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
             //string code = manager.GenerateEmailConfirmationToken(user.Id);
             //string callbackUrl = IdentityHelper.GetUserConfirmationRedirectUrl(code, user.Id, Request);
             manager.AddToRole(user.Id, "School");
             //manager.SendEmail(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>.");
             int selectedRadio = 0;
             if (radPublic.Checked == true)
             {
                 selectedRadio = int.Parse(radPublic.Value);
             }
             else
             {
                 selectedRadio = int.Parse(radPrivate.Value);
             }
             var school = new Models.School()
             {
                 Name                = txtname.Value,
                 Address             = txtAddress.Value,
                 Email               = txtEmail.Value,
                 MobileNo            = Convert.ToDecimal(txtMobileNo.Value),
                 NameOfPrincipal     = ddlTitle.SelectedItem.Text + " " + txtPrincipal.Value,
                 DateOfIncorporation = Convert.ToDateTime(txtdate.Value),
                 SchoolTypeId        = selectedRadio,
                 CategoryId          = int.Parse(ddlSchoolCat.SelectedValue),
                 LocalGovernmentID   = int.Parse(ddlLGA.SelectedValue),
                 UserId              = user.Id,
                 CreatedBy           = "",
                 DateCreated         = DateTime.Now
             };
             unitOfWork.School.Insert(school);
             unitOfWork.Save();
             //signInManager.SignIn(user, isPersistent: false, rememberBrowser: false);
             DropDownManager.ShowPopUp("School Added Successfully !!!");
             //IdentityHelper.RedirectToReturnUrl("Registration/School", Response);
             ClearInput();
         }
         else
         {
             ErrorMessage.Text = result.Errors.FirstOrDefault();
         }
     }
 }
Ejemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Page.Title = "Add New School";
     if (!Page.IsPostBack)
     {
         DropDownManager.GetLGA(ddlLGA, "ED");
         DropDownManager.GetCategory(ddlSchoolCat);
         DropDownManager.GetTitle(ddlTitle);
         ddlLGA.SelectedValue = SessionUser.LgaId.ToString();
     }
 }
Ejemplo n.º 19
0
        public BookViewModel BookDropdowns(int id = 0)
        {
            DropDownManager ddManager = new DropDownManager();
            BookViewModel   bookView  = new BookViewModel();

            bookView.ListOfFloors    = ddManager.FloorDropdown();
            bookView.ListOfOffices   = ddManager.OfficeDropDown();
            bookView.ListOfWorkpoint = ddManager.WorkpointsDropdown();
            bookView.ListOfUsers     = ddManager.UsersDropdown();
            return(bookView);
        }
Ejemplo n.º 20
0
        protected void gvExam_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            string[] Ids       = id.Split(',');
            string   ExamId    = Ids[0];
            string   StudentId = Ids[1];
            string   schoolId  = Ids[2];

            DropDownManager.ShowPopUp(ExamId + " " + StudentId + " " + schoolId);
        }
Ejemplo n.º 21
0
 protected void btnAttendenceList_Click(object sender, EventArgs e)
 {
     try
     {
         string filename = "Attendance For -" + lblExamName.Text;
         DropDownManager.GenerateExcel(GetTableForExecl(), filename, "Attendance", Response);
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
Ejemplo n.º 22
0
 protected void btnPriEntry_Click(object sender, EventArgs e)
 {
     try
     {
         string filename = "Entry Schedule For-" + lblExamName.Text;
         DropDownManager.GenerateExcel(BuildTableForExcelPrimary(), filename, "Pri_Entry", Response);
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.Message;
     }
 }
Ejemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (SessionUser.SchoolType == 1)
     {
         var result = GeneralUtility.HasSchoolBeenAssignedQuota(SessionUser.SchoolId);
         if (!result)
         {
             DropDownManager.ShowPopUp("Quota Has not been Assigned For this Year");
             return;
         }
     }
 }
Ejemplo n.º 24
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(xlsxSchol.PostedFile.FileName))
            {
                DataTable table = new DataTable();
                table.Columns.Add("ID");
                table.Columns.Add("SN");
                table.Columns.Add("REG_NUM");
                table.Columns.Add("FULLNAME");
                table.Columns.Add("DATE_OF_BIRTH");
                table.Columns.Add("GENDER");
                table.Columns.Add("EXAM_YEAR");
                table.Columns.Add("ADDRESS");
                table.Columns.Add("PICTURES");

                lblFileName.Text = GeneralUtility.GetExcelFile(xlsxSchol);
                string extenstion = Path.GetExtension(lblFileName.Text);
                if (extenstion != ".xml")
                {
                    DataSet ds = new DataSet();
                    ds.ReadXml(lblFileName.Text);
                    int counter = 0;
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        string ID            = ds.Tables[0].Rows[i]["ID"].ToString();
                        string RegNum        = ds.Tables[0].Rows[i]["REG_NUMBER"].ToString();
                        string LastName      = ds.Tables[0].Rows[i]["SURNAME"].ToString();
                        string FirstName     = ds.Tables[0].Rows[i]["LASTNAME"].ToString();
                        string OtherName     = ds.Tables[0].Rows[i]["OTHERNAME"].ToString();
                        string FullName      = ds.Tables[0].Rows[i]["FULLNAME"].ToString();
                        string DateofBirth   = ds.Tables[0].Rows[i]["DATE_OF_BIRTH"].ToString();
                        string Gender        = ds.Tables[0].Rows[i]["GENDER"].ToString();
                        string ExamYear      = ds.Tables[0].Rows[i]["EXAM_YEAR"].ToString();
                        string Address       = ds.Tables[0].Rows[i]["ADDRESS"].ToString();
                        string Base64Picture = $"data:image/png;base64,{ ds.Tables[0].Rows[i]["PICTURE"].ToString()}";
                        //  SponosorId = int.Parse(ds.Tables[0].Rows[i]["SPONOSORID"].ToString())
                        Base64Picture = $"<img src=\"{Base64Picture}\">";

                        ++counter;
                        table.Rows.Add(ID, counter, RegNum, FullName, DateofBirth, Gender, ExamYear, Address, Base64Picture);
                    }
                    gvResults.DataSource = table;
                    gvResults.DataBind();
                    excelDiv.Visible = true;
                    gvResults.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
            }
            else
            {
                DropDownManager.ShowPopUp("Please Upload a file");
            }
        }
Ejemplo n.º 25
0
        public string GetStatus(int studentId)
        {
            bool isRegistered = DropDownManager.IsStudentRegistered(studentId);

            if (isRegistered == true)
            {
                return("Registered");
            }
            else
            {
                return("Not Registered");
            }
        }
Ejemplo n.º 26
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);
        }
Ejemplo n.º 27
0
        public void LoadSchool(string id)
        {
            if (id != null)
            {
                var school = DropDownManager.GetSchool(id);

                lblEmail.Text     = school.Email;
                lblDate.Text      = school.DateOfIncorporation.ToLongDateString();
                lblPrincipal.Text = school.NameOfPrincipal;
                lblStudent.Text   = statManager.GetStudentCount(int.Parse(id));
                lblLga.Text       = school.LocalGovernment.LocalGovernment1;
                lblDate1.Text     = school.DateOfIncorporation.Year.ToString();
                lblDate2.Text     = school.DateOfIncorporation.ToLongDateString();
            }
        }
Ejemplo n.º 28
0
        public string GetSchoolId()
        {
            string userId = HttpContext.Current.User.Identity.GetUserId();

            if (userId != null)
            {
                var schoolId = DropDownManager.GetSchoolId(userId);
                return(schoolId.ToString());
            }
            else
            {
                var schoolId = 1;   //dropDownManager.GetSchoolId(null);
                return(schoolId.ToString());
            }
        }
Ejemplo n.º 29
0
        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);
        }
Ejemplo n.º 30
0
        public void LoadAllStudent()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("ID");
            dt.Columns.Add("Name");
            dt.Columns.Add("Email");
            dt.Columns.Add("Address");
            dt.Columns.Add("students");
            dt.Columns.Add("Status");

            var student = DropDownManager.GetAllSchools();

            if (student != null)
            {
                int sn = 0;
                foreach (var item in student)
                {
                    string id       = item.Id.ToString();
                    string status   = GetStatus(item.Id);
                    string Name     = item.Name;
                    string Email    = item.Email.ToString();
                    string students = stat.GetStudentCount(item.Id);
                    string Address  = item.Address;
                    sn++;

                    dt.Rows.Add(sn, id, Name, Email, Address, students, status);
                }

                gvSchools.DataSource = dt;
                gvSchools.DataBind();

                foreach (GridViewRow row in gvSchools.Rows)
                {
                    Label lblStatus = (Label)row.FindControl("lblStatus");
                    if (lblStatus.Text == "Registered")
                    {
                        lblStatus.CssClass = "btn btn-success";
                    }
                    else
                    {
                        lblStatus.CssClass = "btn btn-danger";
                    }
                }
            }
        }