Exemplo n.º 1
0
        private List <TemplateItem> GetExItems(IEnumerable <TemplateItem> items)
        {
            TemplateManBLL      tmBLL = new TemplateManBLL();
            List <TemplateItem> list  = new List <TemplateItem>();

            foreach (TemplateItem item in items)
            {
                if (!string.IsNullOrEmpty(item.ITEMCODE))
                {
                    var standVal = tmBLL.GetStandVal(item.ITEMCODE);
                    if (standVal != null)
                    {
                        item.MAXVALUE = standVal.MAXVALUE;
                        item.MINVALUE = standVal.MINVALUE;
                        item.NAMEENG  = standVal.NAMEENG;
                        item.UNIT     = standVal.UNIT;
                    }
                }

                list.Add(item);
            }

            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检验目的数据获取
        /// </summary>
        /// <returns></returns>
        public IHttpActionResult Get()
        {
            TemplateManBLL tmBLL = new TemplateManBLL();

            //获取检验目的列表
            PageInfo pageInfo = new PageInfo()
            {
                PageIndex  = 1,
                PageSize   = 150,
                Order      = OrderEnum.desc,
                OrderField = "CREATEDATETIME"
            };

            //获取检验目对应的详细项目
            IEnumerable <ExamineTemplate> list = tmBLL.GetTemplatesList(pageInfo, null);

            foreach (ExamineTemplate item in list)
            {
                IEnumerable <TemplateItem> _items = tmBLL.GetTemplateItemList(item.TEMPLATEID).OrderBy(p => p.SORT);
                item.TemplateItems = GetExItems(_items);
            }

            return(Ok(list));
        }