public ActionResult Petrografia() { crud = new CRUDDocumentos(); ViewBag.SampleID = crud.listaPetrografia().Select(x => new SelectListItem { Value = x.SAMPLEID.ToString(), Text = x.SAMPLEID.ToString() }).Distinct().ToList(); return(View()); }
public JsonResult GetSondPetro(string id) { crud = new CRUDDocumentos(); List <SelectListItem> sondpetroDDL = new List <SelectListItem>(); sondpetroDDL = crud.listaPetrografia().Where(x => x.SAMPLEID.Equals(id)).Select(x => x.HOLEID_ME.ToString()).Distinct().ToList().Select(x => new SelectListItem { Value = x, Text = x }).ToList(); return(Json(sondpetroDDL, JsonRequestBehavior.AllowGet)); }