Esempio n. 1
0
        public void ImportRoutes()
        {
            //Get a list of all Roadshow routes for this terminal and date range
            try {
                this.mRoutes.Clear();
                this.mRoutes.Merge(FinanceGateway.ImportRoutes(this.mAgentNumber, this.mBeginDate, this.mEndDate));

                //Check-off new routes (those that don't exist in the driver's compensation)
                for (int i = 0; i < this.mRoutes.RoadshowRouteTable.Rows.Count; i++)
                {
                    int      termID    = this.mRoutes.RoadshowRouteTable[i].DepotNumber;
                    string   oper      = this.mRoutes.RoadshowRouteTable[i].Operator;
                    string   routeName = this.mRoutes.RoadshowRouteTable[i].Rt_Name;
                    DateTime routeDate = this.mRoutes.RoadshowRouteTable[i].Rt_Date;
                    DriverCompDataset.DriverRouteTableRow[] driverRoutes = (DriverCompDataset.DriverRouteTableRow[]) this.mCompensation.DriverRouteTable.Select("AgentNumber=" + termID + " AND Operator='" + oper + "' AND RouteName='" + routeName + "' AND RouteDate='" + routeDate + "'");
                    this.mRoutes.RoadshowRouteTable[i].New = (driverRoutes.Length == 0);
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            finally { if (this.RoutesChanged != null)
                      {
                          this.RoutesChanged(this, EventArgs.Empty);
                      }
            }
        }