예제 #1
0
        /// <summary>
        /// Robert Forbes
        /// Created: 2017/04/19
        /// </summary>
        /// <param name="pickupLineId"></param>
        /// <returns></returns>
        public PickupLine RetrievePickupLineById(int?pickupLineId)
        {
            PickupLine result = null;

            try
            {
                result = PickupLineAccessor.RetrievePickupLine(pickupLineId);
            }
            catch
            {
                throw;
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Eric Walton
        /// 5/10/2017
        /// </summary>
        /// <param name="pickupLine"></param>
        /// <returns></returns>
        public int CreatePickupLine(PickupLine pickupLine)
        {
            int pickupLineId = 0;

            try
            {
                pickupLineId = PickupLineAccessor.CreatePickupLine(pickupLine);
            }
            catch (Exception)
            {
                throw;
            }
            return(pickupLineId);
        }
예제 #3
0
        /// <summary>
        /// Robert Forbes
        /// Created: 2017/04/30
        /// </summary>
        /// <param name="pickupId"></param>
        /// <returns></returns>
        public List <PickupLine> RetrievePickupLinesByPickupId(int?pickupId)
        {
            List <PickupLine> result = new List <PickupLine>();

            try
            {
                result = PickupLineAccessor.RetrievePickupLinesForPickup(pickupId);
            }
            catch
            {
                throw;
            }

            return(result);
        }
예제 #4
0
        public bool DeletePickupLine(PickupLine pickupLine)
        {
            bool result = false;

            try
            {
                result = (PickupLineAccessor.DeletePickupLine(pickupLine) >= 1);
            }
            catch
            {
                throw;
            }

            return(result);
        }
예제 #5
0
        /// <summary>
        /// Robert Forbes
        /// Created: 2017/04/19
        /// </summary>
        /// <param name="oldLine"></param>
        /// <param name="newLine"></param>
        /// <returns></returns>
        public bool UpdatePickupLine(PickupLine oldLine, PickupLine newLine)
        {
            bool result = false;

            try
            {
                result = (PickupLineAccessor.UpdatePickupLine(oldLine, newLine) >= 1);
            }
            catch
            {
                throw;
            }

            return(result);
        }
예제 #6
0
        /// <summary>
        /// Ryan Spurgetis
        /// 4/27/2017
        ///
        /// Retrieves a list of pickup lines, adding only those picked up
        /// </summary>
        /// <returns></returns>
        public List <PickupLineAndProductName> RetrievePickupLinesReceived()
        {
            List <PickupLineAndProductName> pickupList = new List <PickupLineAndProductName>();
            bool pickupStatus = true;

            try
            {
                pickupList = PickupLineAccessor.RetrievePickupLinesReceived(pickupStatus);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(pickupList);
        }
예제 #7
0
        /// <summary>
        /// Robert Forbes
        /// 2017/04/13
        /// </summary>
        /// <param name="driverId"></param>
        /// <returns></returns>
        public List <Pickup> RetrievePickupsForDriver(int?driverId)
        {
            List <Pickup> pickups = new List <Pickup>();

            try
            {
                pickups = PickupAccessor.RetrievePickupsForDriver(driverId);
                foreach (Pickup p in pickups)
                {
                    p.PickupLineList = PickupLineAccessor.RetrievePickupLinesForPickup(p.PickupId);
                    foreach (PickupLine line in p.PickupLineList)
                    {
                        line.productName = ProductAccessor.RetrieveProduct((int)line.ProductId).Name;
                    }
                    p.address = SupplierAccessor.RetrieveUserAddressBySupplier(p.SupplierId);
                }
            }
            catch
            {
                throw;
            }

            return(pickups);
        }