예제 #1
0
        public bool dismissOrder(int orderId, string justification)
        {
            using (var ctx = new ChocolateStoreUkEntities2())
            {
                PendingOrder po = ctx.PendingOrders.Find(orderId);
                HQServiceReference.HQServiceClient client =
                    new HQServiceReference.HQServiceClient();

                bool logRet =
                    client.logLocalOrder(po.OrderID, po.ClientID, po.ProductID, po.Date.ToShortDateString(), po.Quantity, po.ShipperID, false, justification);
                logDismissedLocalOrder(po, justification);
                ctx.PendingOrders.Remove(po);
                int ret = ctx.SaveChanges();
                return(logRet && ret > 0);
            }
        }
예제 #2
0
        public bool acceptOrder(int orderId)
        {
            using (var ctx = new ChocolateStoreUkEntities2())
            {
                var result = ctx.spConfirmPendingOrder(orderId);
                if (result > 0)
                {
                    Order o = ctx.Orders.Find(orderId);

                    HQServiceReference.HQServiceClient client =
                        new HQServiceReference.HQServiceClient();
                    bool logRet =
                        client.logLocalOrder(o.OrderID, o.ClientID, o.ProductID, o.Date.ToShortDateString(), o.Quantity, o.ShipperID, true, "");
                    return(logRet);
                }
                else
                {
                    return(false);
                }
            }
        }