Esempio n. 1
0
 public ActionResult GetEthnics(string racecode)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Ethnic> ethnics = referenceRepo.GetEthnics(racecode);
     if (ethnics != null && ethnics.Any<Ethnic>())
     {
         var value = from a in ethnics
                     orderby a.EthnicDescription
                     select new
                     {
                         Code = a.EthnicCd.Trim(),
                         Name = a.EthnicDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }