// Подсчет секций public void CalcSections() { FCService.Init(Db); GetData(true); // Построение таблицы TableSecton tableSection = new TableSecton(this); tableSection.CreateTable(); }
/// <summary> /// !!! Перед использование не забудь вызвать первый раз FCService.Init() /// </summary> private static IClassificator GetClassificator(Entity ent, IClassTypeService classService) { IClassificator res = null; FCEntProps fcEntProps; if (FCService.GetEntityProperties(ent.Id, out fcEntProps)) { ClassType clType; if (classService == null) { clType = new ClassType(fcEntProps.Class, fcEntProps.Class, null, 0); } else { clType = classService?.GetClassType(fcEntProps.Class); } // Если класс проектируемого здания или есть параметр высоты, то это здание ???!!! Сомнительно. Нужна более строгая идентификайция зданий var height = fcEntProps.GetPropertyValue <double>(Building.PropHeight, 0); if (height != 0 || Building.IsBuildingClass(clType.ClassName)) { var building = new Building(ent, height, fcEntProps.GetProperties(), clType); res = building; } else { double area = GetArea(ent, clType.UnitFactor, clType.ClassName); if (area != 0) { var classificator = new Classificator(ent, clType, area); res = classificator; } } } return(res); }