コード例 #1
0
        public static void UpdateAction(Api api, Action action)
        {
            var updateSellToId = $"403/entity/{action.CustomerReference}";
            var updateShipTo   = $"403/entity/{action.Reference}";

            action.ShipTo.Id = updateShipTo;
            action.SellTo.Id = updateSellToId;
            var updatedAction = action;
            // var uploadAction = new SaveAction(api.Context, updatedAction);
        }
コード例 #2
0
 private void ActionLoad(Api api, Action loadedAction)
 {
     if (loadedAction != null)
     {
         if (ActionIds.Contains(loadedAction.Id))
         {
             Actions.Add(loadedAction);
         }
     }
 }
コード例 #3
0
        public static void WriteToFile(Api api, Action action)
        {
            var list     = new List <string>();
            var fileName = "Actions.csv";
            //var data = $"{action.Id},{action.Reference},{action.Nature},{action.CustomerReference},{action.ActionTypeId},{action.Status}," +
            //    $"{action.RouteId},{action.CreatedOn},{action.ReceivedOn},{action.SellTo},{action.ShipTo},{action.ShipTo.Address}";
            var data = $"{action.ActionTypeName}";

            list.Add(data);
            //File.AppendAllLines(fileName, new[] { data });
        }
コード例 #4
0
 public static Action Delivery(string clientId,
     OLocation location, string reference)
 {
     var action = new Action
                      {
                          Id = $"{clientId}/{reference}",
                          Reference = reference,
                          ClientId = clientId,
                          ExpectedDelivery = DateTime.UtcNow,
                          Instructions = "Action instructions",
                          Pallets = 1,
                          Weight = 120,
                          VolumetricMass = 3,
                          Value = 400,
                          Name = reference,
                          AmountEx = 12,
                          AmountIncl = 13,
                          ActionTypeId = $"{clientId}/delivery",
                          ActionTypeName = "Delivery"
                      };
     return action;
 }
コード例 #5
0
 private void DeleteAction(Api api, Trackmatic.Rest.Routing.Model.Action action)
 {
     var deleteAction = api.ExecuteRequest(new DeleteAction(api.Context, action.Id));
 }