Ejemplo n.º 1
0
        public ProductionPlanningReportGetProject GetProjectList(CustomUserInfoVM vm)
        {
            ProductionPlanningReportGetProject projectItem = new ProductionPlanningReportGetProject();
            Dictionary <int, string>           plantDir    = new Dictionary <int, string>();
            Dictionary <int, string>           opTypeDir   = new Dictionary <int, string>();
            Dictionary <int, string>           funPlantDir = new Dictionary <int, string>();

            var plantList = systemOrgRepository.GetMany(m => m.Organization_ID.Contains("1000")).OrderBy(m => m.Organization_ID).ToList();

            foreach (var item in plantList)
            {
                plantDir.Add(item.Organization_UID, item.Organization_Desc);
            }

            var id           = plantDir.First().Key;
            var childUIDList = systemOrgBomRepository.GetMany(m => m.ParentOrg_UID == id).Select(m => m.ChildOrg_UID).ToList();
            var optypeList   = systemOrgRepository.GetMany(m => childUIDList.Contains(m.Organization_UID)).ToList();

            foreach (var item in optypeList)
            {
                opTypeDir.Add(item.Organization_UID, item.Organization_Desc);
            }
            opTypeDir.Add(StructConstants.ReportStatus.AllKey, StructConstants.ReportStatus.AllValue);

            var funPlantList = systemOrgRepository.GetChildByParentUID(vm.OPType_OrganizationUIDList.FirstOrDefault());

            foreach (var item in funPlantList)
            {
                funPlantDir.Add(item.Organization_UID, item.Organization_Name);
            }

            projectItem.plantDir  = plantDir;
            projectItem.opTypeDir = opTypeDir;
            //projectItem.FunPlantDir = funPlantDir;
            //projectItem.partTypeDir = partTypeDir;
            return(projectItem);
        }
Ejemplo n.º 2
0
        //获取父节点相关信息
        public KeyValuePair <int?, string> GetFatherOrgInfo(int?childUid = null)
        {
            var result = new System_OrganizationBOM();

            if (childUid != null)
            {
                result = systemOrgBomRepository.GetMany(m => m.ChildOrg_UID == childUid).FirstOrDefault();
            }
            var Dresult = new Dictionary <int?, string>();

            if (result != null)
            {
                Dresult.Add(result.ParentOrg_UID, result.System_Organization.Organization_Name);
            }
            return(Dresult.FirstOrDefault());
        }