예제 #1
0
 public ActionResult UpdateTrackingNumber(int packageId, string trackingNumber)
 {
     var request = new ChangeTrackingNumberRequest { PackageId = packageId, TrackingNumber = trackingNumber };
     var response = this.packagesService.ChangePackageTrackingNumber(request);
     var jsonNetResult = new JsonNetResult
     {
         Formatting = (Formatting)Newtonsoft.Json.Formatting.Indented,
         Data = new { response.Message, MessageType = response.MessageType.ToString() }
     };
     return jsonNetResult;
 }
예제 #2
0
 /// <summary>
 /// The change package tracking number.
 /// </summary>
 /// <param name="request">
 /// The request.
 /// </param>
 /// <returns>
 /// The <see cref="ChangeTrackingNumberResponse"/>.
 /// </returns>
 public ChangeTrackingNumberResponse ChangePackageTrackingNumber(ChangeTrackingNumberRequest request)
 {
     try
     {
         var package = this.packageRepository.GetPackageById(request.PackageId);
         package.TrackingNumber = request.TrackingNumber;
         this.packageRepository.UpdatePackage(package);
         var response = new ChangeTrackingNumberResponse
             { Message = DashboardViewResources.TrackingNumberUpdated, MessageType = MessageType.Success };
         return response;
     }
     catch (Exception ex)
     {
         this.Logger.Log(ex.Message);
         return new ChangeTrackingNumberResponse
                    {
                        Message = DashboardViewResources.TrackingNumberUpdateError,
                        MessageType = MessageType.Error
                    };
     }
 }