Example #1
0
 public IHttpActionResult GetOffers(string deviceId, string storeId, bool refreshFlag)
 {
     try
     {
         var promotions = _p2pBusinessLogic.GetOffers(deviceId, storeId, refreshFlag);
         return(Ok(promotions));
     }
     catch (Exception ex)
     {
         WriteLogToFile.WriteLog(ex.Message);
         return(InternalServerError());
     }
 }
Example #2
0
        public IHttpActionResult RegisterDevice([FromBody] Device device)
        {
            try
            {
                if (device == null || !ModelState.IsValid)
                {
                    WriteLogToFile.WriteLog("Device information is missing");
                    return(BadRequest("Device information is missing"));
                }


                return(Ok(_p2pBusinessLogic.RegisterDevice(device)));
            }
            catch (Exception ex)
            {
                WriteLogToFile.WriteLog(ex.Message);
                return(InternalServerError());
            }
        }