public void CalculateTotals() { foreach (LogiNextDriver driver in driverList) { AddToTotals(driver); } LogiNextDriver totalDriver = new LogiNextDriver(cashTotal, cardTotal, onlineTotal, totalCODDelivered, orderCountTotal, otherOrderCountTotal, otherTotal, otherCodTotal); driverList.Add(totalDriver); }
public void AddTransaction(LogiNextTransaction transaction) { if (!driverDict.ContainsKey(transaction.DriverID)) { LogiNextDriver newDriver = new LogiNextDriver(transaction.DriverID, transaction.DriverName); driverDict.Add(newDriver.DriverID, newDriver); driverList.Add(newDriver); } driverDict[transaction.DriverName].AddTransaction(transaction); }
private void AddToTotals(LogiNextDriver driver) { cashTotal += driver.Cash; cardTotal += driver.Card; onlineTotal += driver.Online; otherCodTotal += driver.TotalOtherCOD; totalCODDelivered += driver.TotalDelivered; orderCountTotal += driver.OrderCount; otherOrderCountTotal += driver.OrderCountOther; otherTotal += driver.TotalOther; }
private void DgSummary_MouseDown(object sender, MouseButtonEventArgs e) { try { DataGridRow dr = (DataGridRow)sender; if (dr == null) { e.Handled = true; return; } LogiNextDriver lnd = (LogiNextDriver)dr.Item; dgTransactions.ItemsSource = lnd.Transactions; } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Error); } }