예제 #1
0
        public bool UpdateRates(OSHTRates newRates)
        {
            //Variables
            DataAccess da = DataAccess.Instance();

            //If the update failed return false
            if (!da.UpdateRatesTable(newRates.FTLRate, newRates.LTLRate))
            {
                return(false);
            }

            //Return success
            return(true);
        }
예제 #2
0
        ///
        /// \brief To retrieve Routes from Route table in the database
        /// \details <b>Details</b>
        ///
        /// This method interfaces with the database to retrieve the data from the routes table
        ///
        /// \param <b>void</b> - None
        ///
        /// \return List Destination Returns a list of the rows of routes in the database
        ///
        public OSHTRates GetRates()
        {
            // create objects to hold information from DAL
            DataAccess tempDA     = DataAccess.Instance();
            DataTable  ratesTable = tempDA.GetRatesTable().Tables[0];
            OSHTRates  rates      = new OSHTRates();

            DataRowCollection ratesRow = ratesTable.Rows;

            // Get the one row of data from the rowCollection
            foreach (DataRow currentRow in ratesRow)
            {
                //Fill destination
                rates.FTLRate = currentRow.Field <double>(0);
                rates.LTLRate = currentRow.Field <double>(1);
            }


            return(rates);
        }