private void ReportPrediction(StreamWriter sw, DateRange past_week, BillReport report, string committees, string likelihood) { string prefix = BillUtils.NewOrChangePrefix(past_week, report); sw.WriteLine("<tr>"); sw.WriteLine($"<td>{prefix} {report.Measure} {report.Title} ({report.Author})</td>"); sw.WriteLine($"<td>{committees}</td> <td>{likelihood}</td>"); sw.WriteLine("</tr>"); }
private void ReportOneBillWithPrefix(StreamWriter sw, BillReport report, string prefix) { sw.WriteLine("<tr>"); sw.WriteLine($"<td>{prefix}{report.Measure} {report.Title} ({report.Author})</td>"); sw.WriteLine($" <td>{report.WIC}</td>"); sw.WriteLine($" <td>{report.LPS}</td>"); sw.WriteLine($" <td>{report.Position??"Null"}</td>"); sw.WriteLine($" <td>{report.OneLiner}</td>"); sw.WriteLine($" <td>{report.LastAction}</td>"); sw.WriteLine("</tr>"); }
public int CompareByMeasure(BillReport rhs) { string m_lhs = this.Measure, m_rhs = rhs.Measure; string house_lhs = House(m_lhs), house_rhs = House(m_rhs); if (house_lhs != house_rhs) { return(house_lhs.CompareTo(house_rhs)); } string bill_lhs = BillNumber(m_lhs), bill_rhs = BillNumber(m_rhs); if (!int.TryParse(bill_lhs, out int i_lhs)) { throw new ApplicationException($"BillReport.CompareByMeasure: Invalid measure {m_lhs}"); } if (!int.TryParse(bill_rhs, out int i_rhs)) { throw new ApplicationException($"BillReport.CompareByMeasure: Invalid measure {m_rhs}"); } return(i_lhs.CompareTo(i_rhs)); }
private DateTime DateFromLastAction(BillReport report) { var text_date = Regex.Match(report.LastAction, @"^\w+\s+\w+\s+\w+").ToString(); return((DateTime.TryParse(text_date, out DateTime result)) ? result : default(DateTime)); }