コード例 #1
0
        public static int ConfirmOrderSalesBL(int confirmOrderID, int salesManID)
        {
            int confirmedOrderID = 0;

            try
            {
                foreach (Order item in OrderBL.SearchOrderForOfflineBL())
                {
                    if (item.OrderID == confirmOrderID)
                    {
                        item.Status = "Delivered";
                        if (OrderBL.UpdateOrderBL(item))
                        {
                            confirmedOrderID = item.OrderID;
                            if (AddSalesBL(confirmOrderID, salesManID))
                            {
                                Console.WriteLine("Sale complete!");
                            }
                        }
                    }
                }
            }


            catch (GOException ex)
            {
                throw ex;
            }

            return(confirmedOrderID);
        }
コード例 #2
0
        public static List <Order> ViewActiveOrdersBL()
        {
            List <Order> activeOrders = null;

            try
            {
                activeOrders = OrderBL.SearchOrderForOfflineBL();
            }


            catch (GOException ex)
            {
                throw ex;
            }

            return(activeOrders);
        }
コード例 #3
0
        public static List <Order> GetAllSalesBL()
        {
            List <Order> salesList = null;

            try
            {
                foreach (SalesUser salesman in SalesDAL.salesmen)
                {
                    foreach (int item in salesman.SalesIDs)
                    {
                        salesList.Add(OrderBL.SearchOrderBL(item));
                    }
                }
            }
            catch (GOException ex)
            {
                throw ex;
            }
            return(salesList);
        }
コード例 #4
0
        public static Order SearchSalesOrderBL(int searchSalesID)
        {
            Order searchOrder = null;

            try
            {
                foreach (SalesUser salesman in SalesDAL.salesmen)
                {
                    foreach (int item in salesman.SalesIDs)
                    {
                        searchOrder = OrderBL.SearchOrderBL(item);
                    }
                }
            }

            catch (GOException ex)
            {
                throw ex;
            }
            return(searchOrder);
        }
コード例 #5
0
        public static bool ModifyOrderSalesBL(Order updatedOrder)
        {
            bool orderModified = false;

            try
            {
                foreach (Order item in OrderBL.GetAllOrdersBL())
                {
                    if (item.OrderID == updatedOrder.OrderID)
                    {
                        orderModified = OrderBL.UpdateOrderBL(updatedOrder);
                    }
                }
            }


            catch (GOException ex)
            {
                throw ex;
            }

            return(orderModified);
        }
コード例 #6
0
        public static bool AddSalesOrderBL(Order newOrder, int salesManID)
        {
            bool orderUploaded = false;

            try
            {
                if (OrderBL.AddOrderBL(newOrder))
                {
                    if (AddSalesBL(newOrder.OrderID, salesManID))
                    {
                        Console.WriteLine("Order uploaded succesfully!");
                    }
                    orderUploaded = true;
                }
            }

            catch (GOException ex)
            {
                throw ex;
            }

            return(orderUploaded);
        }
コード例 #7
0
        public static bool AcceptOrderSalesBL(int activeOrderID)
        {
            bool orderAccepted = false;

            try
            {
                foreach (Order item in OrderBL.SearchOrderForOfflineBL())
                {
                    if (item.OrderID == activeOrderID)
                    {
                        item.Status   = "Under Processing";
                        orderAccepted = OrderBL.UpdateOrderBL(item);
                    }
                }
            }


            catch (GOException ex)
            {
                throw ex;
            }

            return(orderAccepted);
        }