コード例 #1
0
        public IHttpActionResult Put(TransportOrdersModel model)
        {
            var transportOrder = manager.GetById(model.Id);

            transportOrder.Status = (int)OrderStatusTypes.Closed;
            manager.SaveChanges();

            return(Ok(new { id = model.Id }));
        }
コード例 #2
0
        public IHttpActionResult Put(TransportOrdersModel model)
        {
            var order = manager.GetById(model.Id);

            order.IsOffer = false;

            if (String.IsNullOrEmpty(order.OrderNumber))
            {
                //order.OrderNumber = numberProvider.GetNextTransportOrderNumber();
            }

            if (order.Customers.IsProspectiveCustomer)
            {
                order.Customers.IsProspectiveCustomer = false;
                var lastCustomerNumber = customerManager.GetEntities().Max(o => o.Number);
                order.Customers.Number = lastCustomerNumber + 1;
            }

            manager.SaveChanges();

            return(Ok(new { id = model.Id }));
        }