Example #1
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;
            }
        }
        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();
            }
        }
        public void LoadAllStudent(string schoolId)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("ID");
            dt.Columns.Add("Name");
            dt.Columns.Add("Address");
            dt.Columns.Add("Sex");
            dt.Columns.Add("Date");
            dt.Columns.Add("State");

            var student = DropDownManager.GetAllStudents(schoolId);

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

                    dt.Rows.Add(sn, id, Name, Address, sex, Date, state);
                }

                tblGeneral.DataSource = dt;
                tblGeneral.DataBind();
                tblGeneral.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
        public void PopulateStudent()
        {
            var dt = new DataTable();

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

            var Students = DropDownManager.GetAllStudents(lblSchoolId.Text);
            int sn       = 0;

            foreach (var item in Students)
            {
                string Name = item.FirstName + " " + item.LastName + " " + item.MiddleName.ToString();
                string sex  = item.Sex.ToString();
                string id   = item.StudentId.ToString();
                // string subjectStatus = item..ToString();
                sn++;
                dt.Rows.Add(sn, id, Name, sex);
            }
            gvStudents.DataSource = dt;
            gvStudents.DataBind();
        }
 public IHttpActionResult GetAllStudent(int?id)
 {
     return(Ok(DropDownManager.GetAllStudents(null)));
 }