private void FillGridCodes() { GridRow row; GridCodes.BeginUpdate(); GridCodes.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "Code"), 50); GridCodes.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Description"), 0); GridCodes.ListGridColumns.Add(col); GridCodes.ListGridRows.Clear(); for (int i = 0; i < _listPrePaySupportCodes.Count; i++) { row = new GridRow(); row.Cells.Add(_listPrePaySupportCodes[i].ProcCode); row.Cells.Add(_listPrePaySupportCodes[i].Descript); row.Tag = _listPrePaySupportCodes[i]; GridCodes.ListGridRows.Add(row); } GridCodes.EndUpdate(); }
public IDictionary <string, string> GetMaterialProperties(MaterialTypes materialType, Guid materialId) { var dictionary = new Dictionary <string, string>(); var holder = Resolver.Resolve <IRisa3DMetadataHolder>(); GridCodes gridCode = GridCodes.NONE; switch (materialType) { case MaterialTypes.HOT_ROLLED_STEEL_MATL: gridCode = GridCodes.HRSTL_GRID_NUMBER; break; case MaterialTypes.COLD_FORMED_STEEL_MATL: gridCode = GridCodes.CFSTL_GRID_NUMBER; break; case MaterialTypes.ALUMINUM_MATL: gridCode = GridCodes.AL_MATL_GRID_NUMBER; break; case MaterialTypes.CONCRETE_MATL: gridCode = GridCodes.CONC_MATL_GRID_NUMBER; break; case MaterialTypes.NDS_WOOD_MATL: gridCode = GridCodes.WOOD_PROP_GRID_NUMBER; break; case MaterialTypes.STAINLESS_STEEL_MATL: gridCode = GridCodes.SS_GRID_NUMBER; break; case MaterialTypes.GENERAL_MATL: gridCode = GridCodes.MATL_GRID_NUMBER; break; } var propertyInfoHolders = holder.GetGridProperty(Risa3DTypeKind.SpreadsheetModel, gridCode); foreach (var propertyInfo in propertyInfoHolders) { if (propertyInfo.ColumnIndex >= 0) { var name = (propertyInfo.GetAttribute(typeof(PropertyTitleAttribute)) as PropertyTitleAttribute)?.Title; if (propertyInfo.Name == "Label") { name = "Material"; } var units = string.Empty; if (propertyInfo.HasAttribute(typeof(UnitLabelAttribute))) { units = (propertyInfo.GetAttribute(typeof(UnitLabelAttribute)) as UnitLabelAttribute)?.TitleSuffix; } else if (propertyInfo.HasAttribute(typeof(CompositeUnitLabelAttribute))) { units = (propertyInfo.GetAttribute(typeof(CompositeUnitLabelAttribute)) as CompositeUnitLabelAttribute)?.TitleSuffix; } if (!string.IsNullOrEmpty(units)) { units = $" ({units})"; } var value = " "; // DetailReportService.GetMaterialValues(materialId, gridCode, propertyInfo.ColumnIndex); dictionary.Add($"{name}{units}:", value); } } return(dictionary); }