예제 #1
0
        public void Test_ApprovedGetMarketOffer()
        {
            var result    = AssetOfferService.GetApprovedAssetOffer(1013726, "IRU");
            var dataTable = (DataTable)JsonConvert.DeserializeObject(result, (typeof(DataTable)));
            var AssetId   = Int32.Parse(dataTable.Rows[0][0].ToString());

            Assert.True(AssetId > 1);
        }
 public IActionResult Get(int legalEntityId, string assetCode)
 {
     try
     {
         var result = AssetOfferService.GetApprovedAssetOffer(legalEntityId, assetCode);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
 public IActionResult Put(int legalEntityId, string assetCode, [FromBody] string dateTimeString)
 {
     try
     {
         DateTime?closedDateTime = DateTime.TryParse(dateTimeString, out DateTime tDateTime)
             ? tDateTime
             : (DateTime?)null;
         var result = AssetOfferService.UpdateApprovedAssetOffer(legalEntityId, assetCode, closedDateTime);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }