public void PopulateSubject()
        {
            var dt = new DataTable();

            dt.Columns.Add("SN");
            dt.Columns.Add("ID");
            dt.Columns.Add("Subject");
            dt.Columns.Add("SubjectCode");

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

            foreach (var item in Exams)
            {
                string subjectId     = item.ID.ToString();
                string subject       = item.Name.ToString();
                string subjectCode   = item.Code.ToString();
                string subjectStatus = item.Activated.ToString();
                sn++;
                dt.Rows.Add(sn, subjectId, subject, subjectCode);
            }
            gvSubject.DataSource = dt;
            gvSubject.DataBind();
        }
Beispiel #2
0
 public IHttpActionResult GetAllSubject(int?id)
 {
     return(Ok(DropDownManager.GetAllSubject()));
 }