Пример #1
0
        private string StructureItemName(string name, object id)
        {
            switch (name)
            {
            case "FactoryName":
                if (_idToFactoryConverter == null)
                {
                    _idToFactoryConverter = new IdToFactoryConverter();
                }
                return((string)_idToFactoryConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")));

            case "WorkUnitName":
                if (_idToWorkUnitConverter == null)
                {
                    _idToWorkUnitConverter = new IdToWorkUnitConverter();
                }
                return((string)_idToWorkUnitConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")));

            case "WorkSectionName":
                if (_idToWorkSectionConverter == null)
                {
                    _idToWorkSectionConverter = new IdToWorkSectionConverter();
                }
                return((string)_idToWorkSectionConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")));

            case "WorkSubsectionName":
                if (_idToWorkSubsectionConverter == null)
                {
                    _idToWorkSubsectionConverter = new IdToWorkSubSectionConverter();
                }
                return((string)_idToWorkSubsectionConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")));
            }
            return(string.Empty);
        }
        private string StructureItemName(int index, object id)
        {
            switch (index)
            {
            case 6:
                if (_idToWorkerGroupConverter == null)
                {
                    _idToWorkerGroupConverter = new IdToWorkerGroupConverter();
                }
                return(_idToWorkerGroupConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")).ToString());

            case 7:
                if (_idToFactoryConverter == null)
                {
                    _idToFactoryConverter = new IdToFactoryConverter();
                }
                return(_idToFactoryConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")).ToString());

            case 8:
                if (_idToWorkUnitConverter == null)
                {
                    _idToWorkUnitConverter = new IdToWorkUnitConverter();
                }
                return(_idToWorkUnitConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")).ToString());

            case 9:
                if (_idToWorkSectionConverter == null)
                {
                    _idToWorkSectionConverter = new IdToWorkSectionConverter();
                }
                return(_idToWorkSectionConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")).ToString());

            case 10:
                if (_idToWorkSubsectionConverter == null)
                {
                    _idToWorkSubsectionConverter = new IdToWorkSubSectionConverter();
                }
                return(_idToWorkSubsectionConverter.Convert(id, typeof(string), string.Empty, new CultureInfo("ru-RU")).ToString());
            }
            return(string.Empty);
        }