Ejemplo n.º 1
0
			public Aggregates(CalculationItem[] items)
			{
				Count = new SumHolder<int>(items.Sum(x => x.Count ?? 0));
				Weight = new SumHolder<float>(items.Sum(x => x.Weight ?? 0));
				Value = new SumHolder<decimal>(items.Sum(x => x.Value));
				TotalTariffCost = new SumHolder<decimal>(items.Sum(x => x.TotalTariffCost));
				TotalSenderRate = new SumHolder<decimal>(items.Sum(x => x.TotalSenderRate));
				ScotchCost = new SumHolder<decimal>(items.Sum(x => x.ScotchCost ?? 0));
				TransitCost = new SumHolder<decimal>(items.Sum(x => x.TransitCost ?? 0));
				InsuranceCost = new SumHolder<decimal>(items.Sum(x => x.InsuranceCost));
				Profit = new SumHolder<decimal>(items.Sum(x => x.Profit));
			}
Ejemplo n.º 2
0
		private static void DrawRow(ExcelWorksheet ws, CalculationItem item, int iRow)
		{
			var iColumn = 1;
			ws.Cells[iRow, iColumn++].Value = item.ClientNic;
			ws.Cells[iRow, iColumn++].Value = item.DisplayNumber;
			ws.Cells[iRow, iColumn++].Value = item.Factory;
			ws.Cells[iRow, iColumn++].Value = item.Mark;
			ws.Cells[iRow, iColumn++].Value = item.ClassId.HasValue ? item.ClassId.Value.ToLocalString() : "";
			ws.Cells[iRow, iColumn++].Value = item.Count;
			ws.Cells[iRow, iColumn++].Value = item.Weight;
			ws.Cells[iRow, iColumn++].Value = item.SenderRate;
			ws.Cells[iRow, iColumn].Style.Font.Bold = true;
			ws.Cells[iRow, iColumn++].Value = item.TotalSenderRate;
			ws.Cells[iRow, iColumn++].Value = item.Invoice;
			ws.Cells[iRow, iColumn++].Value = item.Value;
			ws.Cells[iRow, iColumn++].Value = item.TariffPerKg;
			ws.Cells[iRow, iColumn].Style.Font.Bold = true;
			ws.Cells[iRow, iColumn++].Value = item.TotalTariffCost;
			ws.Cells[iRow, iColumn++].Value = item.ScotchCost;
			ws.Cells[iRow, iColumn++].Value = item.InsuranceCost;
			ws.Cells[iRow, iColumn++].Value = item.FactureCost;
			ws.Cells[iRow, iColumn++].Value = item.FactureCostEx;
			ws.Cells[iRow, iColumn++].Value = item.PickupCost;
			ws.Cells[iRow, iColumn++].Value = item.TransitCost;
			ws.Cells[iRow, iColumn].Style.Font.Bold = true;
			ws.Cells[iRow, iColumn].Value = item.Profit;
		}