Exemplo n.º 1
0
        /// <summary>
        /// NAME: Jesse Tomash
        /// DATE: 3/30/2020
        ///
        /// Approver: Brandyn T. Coverdill
        /// Approver:
        ///
        /// This is the method used to test inserting a new order to the list
        /// </summary>
        /// <remarks>
        /// UPDATED BY:
        /// UPDATE DATE:
        /// WHAT WAS CHANGED:
        /// </remarks>
        /// <param name="newOrderInvoice">The new invoice to be added</param>
        /// <returns></returns>
        public int InsertSpecialOrder(SpecialOrder newOrder)
        {
            int result = 0;
            FakeSpecialOrderAccessor   fakeOrderAccessor = new FakeSpecialOrderAccessor();
            IEnumerable <SpecialOrder> orders            = fakeOrderAccessor.SelectSpecialOrders();
            List <SpecialOrder>        invoiceList       = orders.ToList();

            if (!invoiceList.Contains(newOrder))
            {
                invoiceList.Add(newOrder);
                result = 1;
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// NAME: Jesse Tomash
        /// DATE: 3/30/2020
        ///
        /// Approver: Brandyn T. Coverdill
        /// Approver:
        ///
        /// This is the method used to test deleting an order from the list
        /// </summary>
        /// <param name="orderInvoiceID">The ID of the invoice to be deleted</param>
        /// <returns></returns>
        public int DeleteSpecialOrder(int specialOrderID)
        {
            int result = 0;
            FakeSpecialOrderAccessor   fakeOrderAccessor = new FakeSpecialOrderAccessor();
            IEnumerable <SpecialOrder> orders            = fakeOrderAccessor.SelectSpecialOrders();
            List <SpecialOrder>        invoiceList       = orders.ToList();

            foreach (SpecialOrder order in orders)
            {
                if (order.SpecialOrderID.Equals(specialOrderID))
                {
                    invoiceList.Remove(order);
                    result = 1;
                }
            }

            return(result);
        }