Exemplo n.º 1
0
        public ActionResult GetUsersPackages(bool includeAssembling, bool includePaid, bool includeSent)
        {
            if (!includeAssembling && !includePaid && !includeSent)
            {
                return null;
            }

            var request = new GetUsersPackagesRequest { IncludeAssembling = includeAssembling, IncludePaid = includePaid, IncludeSent = includeSent };
            var response = this.packagesService.GetUsersPackages(request);

            var jsonNetResult = new JsonNetResult
            {
                Formatting = (Formatting)Newtonsoft.Json.Formatting.Indented,
                Data = response.ConvertToUsersPackagesViewModel()
            };
            return jsonNetResult;
        }
Exemplo n.º 2
0
 /// <summary>
 /// The get users packages.
 /// </summary>
 /// <param name="request">
 /// The request.
 /// </param>
 /// <returns>
 /// The <see cref="GetUsersPackagesResponse"/>.
 /// </returns>
 public GetUsersPackagesResponse GetUsersPackages(GetUsersPackagesRequest request)
 {
     try
     {
         var packages = this.packageRepository.GetShoppersPackages(request.IncludeAssembling, request.IncludePaid, request.IncludeSent);
         var result = packages.ConvertToUsersPackagesCollection();
         return result;
     }
     catch (Exception ex)
     {
         this.Logger.Log(ex.Message);
         return new GetUsersPackagesResponse { MessageType = MessageType.Error, Message = ex.Message };
     }
 }