Exemplo n.º 1
0
        public IEnumerable <AllColleges> Colleges(int id)
        {
            int val = 0;

            if (int.TryParse(id.ToString(), out val))
            {
                using (UOSEntities db = new UOSEntities())
                {
                    var data = db.bi_get_affi_clgs_with_pagination(val);
                    List <AllColleges> listobj = new List <AllColleges>();
                    foreach (var item in data)
                    {
                        AllColleges obj = new AllColleges();
                        obj.id           = item.ID.ToString();
                        obj.collegeName  = item.Ins_Name;
                        obj.isGovCollege = item.Ins_IsGov == true ? true : false;
                        obj.collegeCode  = item.Inst_code.ToString();
                        listobj.Add(obj);
                    }
                    return(listobj);
                }
            }
            else
            {
                List <AllColleges> listobj = new List <AllColleges>();
                return(listobj);
            }
        }
Exemplo n.º 2
0
 public IEnumerable <AllColleges> Colleges()
 {
     using (UOSEntities db = new UOSEntities())
     {
         var data = (from t1 in db.Affil_Ins_Info select new { t1.ID, t1.Ins_Name, t1.Ins_IsGov, t1.Inst_code }).ToList();
         List <AllColleges> listobj = new List <AllColleges>();
         foreach (var item in data)
         {
             AllColleges obj = new AllColleges();
             obj.id           = item.ID.ToString();
             obj.collegeName  = item.Ins_Name;
             obj.isGovCollege = item.Ins_IsGov == true ? true : false;
             obj.collegeCode  = item.Inst_code.ToString();
             listobj.Add(obj);
         }
         return(listobj);
     }
 }