コード例 #1
0
 public HttpResponseMessage CurrencyRate()
 {
     try
     {
         var data = new SaleBL().GetLatestCurrencyRate();
         return(Request.CreateResponse(HttpStatusCode.OK, data));
     }
     catch (Exception ex)
     {
         LogManager.Instance.Error(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError));
     }
 }
コード例 #2
0
 public HttpResponseMessage GetSales(string query)
 {
     try
     {
         var cmd        = JsonConvert.DeserializeObject <SaleCommand>(query);
         int pagesCount = 0;
         var data       = new SaleBL().GetSales(cmd, ref pagesCount);
         var result     = Request.CreateResponse(HttpStatusCode.OK, data);
         result.Headers.Add(Consts.PAGES_COUNT, pagesCount.ToString());
         return(result);
     }
     catch (Exception ex)
     {
         LogManager.Instance.Error(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError));
     }
 }
コード例 #3
0
 public SaleWCF()
 {
     SalBL = new SaleBL();
 }