コード例 #1
0
 public AttributePreviewStruct()
 {
     this.Id          = 0;
     this.Name        = "";
     this.Description = "";
     this.Unit        = new ItemStruct();
     this.DataType    = "";
     this.Constraints = new Dictionary <long, string>();
     this.inUse       = false;
 }
コード例 #2
0
ファイル: UnitDimenstionModel.cs プロジェクト: payamad/Core
        public List <ItemStruct> getUnitListByDimenstion(long dimensionId)
        {
            try
            {
                unitmanager = new UnitManager();
                List <Unit> units          = unitmanager.DimensionRepo.Get(dimensionId).Units.ToList();
                ItemStruct  tempUnitStruct = new ItemStruct();
                foreach (Unit u in units)
                {
                    tempUnitStruct.Id   = u.Id;
                    tempUnitStruct.Name = u.Name;
                    UnitStructs.Add(tempUnitStruct);
                }

                return(UnitStructs);
            }
            finally
            {
                unitmanager.Dispose();
            }
        }
コード例 #3
0
ファイル: UnitDimenstionModel.cs プロジェクト: payamad/Core
        public List <ItemStruct> getUnitListByDimenstionAndDataType(long dimensionId, long dataTypeId)
        {
            try
            {
                unitmanager = new UnitManager();
                List <Unit> units          = unitmanager.DimensionRepo.Get(dimensionId).Units.ToList();
                ItemStruct  tempUnitStruct = new ItemStruct();
                foreach (Unit u in units)
                {
                    if (u.Name.ToLower() != "none")
                    {
                        foreach (DataType dt in u.AssociatedDataTypes)
                        {
                            if (dt.Id == dataTypeId)
                            {
                                tempUnitStruct.Id   = u.Id;
                                tempUnitStruct.Name = u.Name;
                                UnitStructs.Add(tempUnitStruct);
                                break;
                            }
                        }
                    }
                    else
                    {
                        tempUnitStruct.Id   = u.Id;
                        tempUnitStruct.Name = u.Name;
                        UnitStructs.Add(tempUnitStruct);
                    }
                }

                return(UnitStructs);
            }
            finally
            {
                unitmanager.Dispose();
            }
        }