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); }
public static List <Order> ViewActiveOrdersBL() { List <Order> activeOrders = null; try { activeOrders = OrderBL.SearchOrderForOfflineBL(); } catch (GOException ex) { throw ex; } return(activeOrders); }
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); }
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); }
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); }
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); }
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); }