示例#1
0
        private ProfileAttributesRow CreateRow(List <ProfileAttributeCell> tRow, ref int index)
        {
            ProfileAttributesRow row = new ProfileAttributesRow();

            row.Number = index++;
            if (tRow.Count == ColumHeader.Count)
            {
                ColumHeader.Select((c, colIndex) => new { Col = c, Index = colIndex }).ToList().ForEach(c => row.Cells.Add(ProfileAttributeCell.Update(tRow[c.Index], c.Col, row)));
            }
            else
            {
                ColumHeader.ForEach(c => row.Cells.Add(ProfileAttributeCell.Update(tRow[c.Number - 1], c, row)));
            }

            return(row);
        }
        public String GetCellValue(ProfileAttributeType attribute)
        {
            ProfileAttributeCell cell = Cells.Where(c => c.Column.Attribute == attribute).FirstOrDefault();

            if (cell == null)
            {
                return("");
            }
            else if (cell.Value.Contains(lm.Comol.Core.DomainModel.Helpers.ImportCostants.MultipleItemsSeparator))
            {
                return(cell.Value.Replace(lm.Comol.Core.DomainModel.Helpers.ImportCostants.MultipleItemsSeparator, ", "));
            }
            else
            {
                return(cell.Value);
            }
        }
示例#3
0
 public static ProfileAttributeCell Update(ProfileAttributeCell cell, ProfileAttributeColumn col, ProfileAttributesRow row)
 {
     cell.Column = col;
     cell.Row    = row;
     return(cell);
 }