public BomDataRowHolder(BomDataRowHolder copyRow)
 {
     foreach (BomDataCell cell in copyRow)
     {
         this.Add(new BomDataCell(this, cell.Column, null));
     }
 }
 public BomDataRowHolder(BomDataRowHolder copyRow, BomDataColumn replaceColumn, object newValue)
 {
     foreach (BomDataCell cell in copyRow)
     {
         if (cell.Column.Equals(replaceColumn))
         {
             this.Add(new BomDataCell(this, replaceColumn, newValue));
         }
         else
         {
             this.Add(new BomDataCell(this, cell.Column, cell.Value));
         }
     }
 }
Example #3
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 'BomDataTable.AddRow(BomDataRowHolder)'
        public void AddRow(BomDataRowHolder row)
        {
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 'BomDataTable.AddRow(BomDataRowHolder)'
            Collection <object> values = new Collection <object>();

            foreach (BomDataColumn column in GetColumns())
            {
                if (column.IsQuantity && !double.TryParse(row[column].Value.ToString(), out double outValue))
                {
                    values.Add(outValue);
                }
                else
                {
                    values.Add(row[column].Value);
                }
            }

            _dataTable.Rows.Add(values.ToArray());
        }