public void MergeAndReduceBeginningBalances(EquityPeriod that) { this.DistributeRows(); that.DistributeRows(); foreach (InstanceReportRow ebRow in this.EBRows) { InstanceReportRow bbRow = that.BBRows.Find(bb => IsMatchingRow(ebRow, bb)); if (bbRow == null) { continue; } for (int c = 0; c < ebRow.Cells.Count; c++) { Cell ebCell = ebRow.Cells[c]; Cell bbCell = bbRow.Cells[c]; if (!ebCell.HasData && bbCell.HasData) { Cell newCell = (Cell)bbCell.Clone(); ebRow.ReplaceCell(null, c, newCell); } } that.BBRows.Remove(bbRow); } }
public bool EndDateMatchesBeginDate(EquityPeriod that) { this.DistributeRows(); that.DistributeRows(); if (this.EBRows == null || this.EBRows.Count == 0) { return(false); } if (that.BBRows == null || that.BBRows.Count == 0) { return(false); } DateTime thisLastDate = this.EBRows[0].BalanceDate.StartDate; DateTime thatFirstDate = that.BBRows[0].BalanceDate.StartDate; if (DateTime.Equals(thisLastDate, thatFirstDate)) { return(true); } return(false); }
public bool EndDateMatchesBeginDate( EquityPeriod that ) { this.DistributeRows(); that.DistributeRows(); if( this.EBRows == null || this.EBRows.Count == 0 ) return false; if( that.BBRows == null || that.BBRows.Count == 0 ) return false; DateTime thisLastDate = this.EBRows[ 0 ].BalanceDate.StartDate; DateTime thatFirstDate = that.BBRows[ 0 ].BalanceDate.StartDate; if( DateTime.Equals( thisLastDate, thatFirstDate ) ) return true; return false; }
public void MergeAndReduceBeginningBalances( EquityPeriod that ) { this.DistributeRows(); that.DistributeRows(); foreach( InstanceReportRow ebRow in this.EBRows ) { InstanceReportRow bbRow = that.BBRows.Find( bb => IsMatchingRow( ebRow, bb ) ); if( bbRow == null ) continue; for( int c = 0; c < ebRow.Cells.Count; c++ ) { Cell ebCell = ebRow.Cells[ c ]; Cell bbCell = bbRow.Cells[ c ]; if( !ebCell.HasData && bbCell.HasData ) { Cell newCell = (Cell)bbCell.Clone(); ebRow.ReplaceCell( null, c, newCell ); } } that.BBRows.Remove( bbRow ); } }