public static object[] GetCspRateCardMeterLineItemFields(CspMeter lineItem) { List <object> fields = new List <object>(); fields.Add(lineItem.id); fields.Add(lineItem.name); fields.Add(lineItem.category); fields.Add(lineItem.subcategory); fields.Add(lineItem.unit); fields.Add(lineItem.region); if (lineItem.rates != null) { fields.Add(string.Join(";", lineItem.rates.Select(x => x.Key + "=" + x.Value))); fields.Add(lineItem.rates.FirstOrDefault().Value); } else { fields.Add(string.Empty); fields.Add(string.Empty); } if (lineItem.tags != null) { fields.Add(string.Join(";", lineItem.tags)); } else { fields.Add(string.Empty); } fields.Add(lineItem.effectiveDate); fields.Add(lineItem.includedQuantity); fields.Add(lineItem.status); return(fields.ToArray()); }
public static void WriteCspRateCardMeterLineItem(int startColumnNumber, int rowNumber, CspMeter meterItem, int numberOfColumns, Microsoft.Office.Interop.Excel.Worksheet activeWorksheet) { Microsoft.Office.Interop.Excel.Range c1 = (Microsoft.Office.Interop.Excel.Range)activeWorksheet.Cells[rowNumber, startColumnNumber]; Microsoft.Office.Interop.Excel.Range c2 = (Microsoft.Office.Interop.Excel.Range)activeWorksheet.Cells[rowNumber, startColumnNumber + numberOfColumns - 1]; Microsoft.Office.Interop.Excel.Range currentRow = activeWorksheet.get_Range(c1, c2); currentRow.Value2 = BillingUtils.GetCspRateCardMeterLineItemFields(meterItem); }