Exemplo n.º 1
0
        public ConsItemViewModel(String id_ent)
        {
            QryService      = XapServiceMgr.find <ICiOrdQryService>();
            consAggService  = XapServiceMgr.find <ICiorappconsultCrudService>();
            saveService     = XapServiceMgr.find <ICiOrdMaintainService>();
            this.rptService = XapServiceMgr.find <IConsrptCrudService>();
            OrdApConsDO[] ordappcons = QryService.getTreeOrdApConsDO(id_ent);
            //consItems = new XapDataList<OrdApConsDO>();
            XapDataList <OrdApConsDO> list = new XapDataList <OrdApConsDO>();

            ordappcons.ToList().ForEach(p => { list.Add(p); });
            //consItems= apvm.GetApConsItem();

            KeyNodeDataAdapterFactory <OrdApConsDO> moduleAdapter =
                new KeyNodeDataAdapterFactory <OrdApConsDO>("Id_apcons");

            moduleAdapter.CustomCaptionFunc =
                (dataobj => dataobj.Name_constp + "(" + dataobj.Dt_plan.Value.ToString("yy-MM-dd HH:mm") + ")");

            this.TreeModel        = new TreeKeyModel <OrdApConsDO>(moduleAdapter);
            this.TreeModel.Loader = new OTreeKeyLoader();
            this.TreeModel.AddRange(list);
        }