Пример #1
0
        public ActionResult Element_Select(long?ID)
        {
            IList <ElementDTO> obj = objElementRepository.GetElementsByID(ID);


            var structure_list = from e in obj
                                 select new
            {
                ID           = e.ID,
                Element_Name = e.Element_Name,
                Tag          = e.Element_Tag_Type.ToString(),
                ImgUrl       = "../Content/images/" + e.Element_Tag_Type + ".png",

                //(e.Element_Tag_Type == TagType.site) ? "../Content/images/site.png" : (e.Element_Tag_Type == TagType.equip) ? "../Content/images/equip.png" : (e.Element_Tag_Type == TagType.point) ? "../Content/images/point.png" : "", //"../Content/images/site.png",
                hasChildren = e.HasChildren
            };

            return(Json(structure_list, JsonRequestBehavior.AllowGet));

            //   return Json(obj, JsonRequestBehavior.AllowGet);
        }