Ejemplo n.º 1
0
        public string GetPersonalNumber(SettingsWorkwearItemsViewModel settings, SheetRowWorkwearItems row, int columnIndex)
        {
            var original = settings.ConvertPersonnelNumber ?
                           EmployeeParse.ConvertPersonnelNumber(row.CellStringValue(columnIndex)) : row.CellStringValue(columnIndex);

            return(original?.Trim());
        }
Ejemplo n.º 2
0
        private bool TryParseSizeAndGrowth(
            IUnitOfWork uow,
            SheetRowWorkwearItems row,
            List <ImportedColumn <DataTypeWorkwearItems> > columns,
            out SizeAndGrowth sizeAndGrowth)
        {
            sizeAndGrowth = new SizeAndGrowth();
            var sizeAndGrowthColumn = columns.FirstOrDefault(x => x.DataType == DataTypeWorkwearItems.SizeAndGrowth);
            var sizeColumn          = columns.FirstOrDefault(x => x.DataType == DataTypeWorkwearItems.Size);
            var growthColumn        = columns.FirstOrDefault(x => x.DataType == DataTypeWorkwearItems.Growth);

            if (sizeAndGrowthColumn != null)
            {
                var sizeAndGrowthValue = row.CellStringValue(sizeAndGrowthColumn.Index);
                if (!String.IsNullOrEmpty(sizeAndGrowthValue))
                {
                    sizeAndGrowth = SizeParser.ParseSizeAndGrowth(sizeAndGrowthValue, uow, sizeService);
                }
            }
            ;
            if (sizeColumn != null && sizeAndGrowth.Size != null)
            {
                sizeAndGrowth.Size = SizeParser.ParseSize(uow, row.CellStringValue(sizeColumn.Index), sizeService, CategorySizeType.Size);
            }
            if (growthColumn != null && sizeAndGrowth.Growth != null)
            {
                sizeAndGrowth.Growth = SizeParser.ParseSize(uow, row.CellStringValue(growthColumn.Index), sizeService, CategorySizeType.Height);
            }
            return(sizeAndGrowth.Size != null || sizeAndGrowth.Growth != null);
        }