Esempio n. 1
0
        public static TerminalConfiguration GetTerminalConfiguration(string agentNumber)
        {
            //Return a single terminal configuration
            TerminalConfiguration config = null;

            DriverCompDS.TerminalConfigurationTableRow[] configs = (DriverCompDS.TerminalConfigurationTableRow[])_TerminalConfigs.TerminalConfigurationTable.Select("AgentNumber='" + agentNumber + "'");
            if (configs.Length > 0)
            {
                config = new TerminalConfiguration(configs[0]);
            }
            return(config);
        }
Esempio n. 2
0
        public static TerminalConfiguration GetTerminalConfiguration(string agentNumber)
        {
            //Return a single terminal configuration
            TerminalConfiguration   configuration = null;
            DriverCompServiceClient client        = null;

            try {
                client        = new DriverCompServiceClient();
                configuration = client.GetTerminalConfiguration(agentNumber);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <DriverCompensationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(configuration);
        }
Esempio n. 3
0
 public DriverComp(string terminalID, string terminal, DateTime start, DateTime end, Mediator mediator)
 {
     //Constructor
     try {
         this.mMediator       = mediator;
         this.mAgentNumber    = terminalID;
         this.mAgentName      = terminal;
         this.mStart          = start;
         this.mEnd            = end;
         this.mRoutesDS       = new DriverCompDS();
         this.mCompDS         = new DriverCompDS();
         this.mRates          = new DriverRates(this.mEnd, this.mAgentNumber, this.mAgentName);
         this.mTerminalConfig = FinanceFactory.GetTerminalConfiguration(this.mAgentNumber);
         RefreshDriverRoutes();
         RefreshRoadshowRoutes();
     }
     catch (ApplicationException ex) { throw ex; }
     catch (Exception ex) { throw new ApplicationException("Failed to instantiate a new ship schedule.", ex); }
 }
Esempio n. 4
0
 //Interface
 public CompensationAgent(string agentNumber, string agentName, DateTime startDate, DateTime endDate)
 {
     //Constructor
     try {
         this.mAgentNumber    = agentNumber;
         this.mAgentName      = agentName;
         this.mBeginDate      = startDate;
         this.mEndDate        = endDate;
         this.mCompensation   = new DriverCompDataset();
         this.mRoutes         = new DriverCompDataset();
         this.mRates          = new AgentRates(this.mAgentNumber, this.mAgentName, this.mEndDate);
         this.mTerminalConfig = FinanceGateway.GetTerminalConfiguration(this.mAgentNumber);
         this.mFuelCost       = FinanceGateway.GetFuelCost(this.mEndDate, this.mAgentNumber);
         ViewCompensation();
         ImportRoutes();
     }
     catch (ApplicationException ex) { throw ex; }
     catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
 }
Esempio n. 5
0
        public TerminalConfiguration GetTerminalConfiguration(string agentNumber)
        {
            //Return a single terminal configuration
            TerminalConfiguration configuration = null;
            DataSet configurations = ReadTerminalConfigurations(agentNumber);

            DataRow[] configs = configurations.Tables["TerminalConfigurationTable"].Select("AgentNumber='" + agentNumber + "'");
            if (configs.Length > 0)
            {
                configuration               = new TerminalConfiguration();
                configuration.AgentNumber   = configs[0]["AgentNumber"].ToString();
                configuration.AgentName     = configs[0]["AgentName"].ToString();
                configuration.GLNumber      = configs[0]["GLNumber"].ToString();
                configuration.AdminGLNumber = configs[0]["AdminGLNumber"].ToString();
                configuration.AdminFee      = decimal.Parse(configs[0]["AdminFee"].ToString());
                configuration.FSBase        = decimal.Parse(configs[0]["FSBase"].ToString());
                configuration.BonusRate     = decimal.Parse(configs[0]["BonusRate"].ToString());
            }
            return(configuration);
        }