Exemple #1
0
        public static object[] GetRateCardOfferTermLineItemFields(Offerterm lineItem)
        {
            List <object> fields = new List <object>();

            fields.Add(lineItem.Name);
            fields.Add(lineItem.Credit);
            fields.Add(lineItem.EffectiveDate);

            if (lineItem.ExcludedMeterIds != null)
            {
                fields.Add(string.Join(";", lineItem.ExcludedMeterIds));
            }
            else
            {
                fields.Add(string.Empty);
            }

            if (lineItem.TieredDiscount != null)
            {
                fields.Add(string.Join(";", lineItem.TieredDiscount.Select(x => x.Key + "=" + x.Value)));
                fields.Add(lineItem.TieredDiscount.FirstOrDefault().Value);
            }
            else
            {
                fields.Add(string.Empty);
                fields.Add(string.Empty);
            }

            return(fields.ToArray());
        }
Exemple #2
0
        public static void WriteRateCardOfferTermLineItem(int startColumnNumber, int rowNumber, Offerterm offerTermItem, 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.GetRateCardOfferTermLineItemFields(offerTermItem);
        }