Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="flush"></param>
        /// <returns></returns>
        public McrData GetMcrDetails(bool flush)
        {
            var mcrDetails = NeeoVoipApi.GetMcrDetails(_userID, flush);

            if (flush == true)
            {
                DbManager dbManager = new DbManager();
                if (!dbManager.ResetOfflineCount(_userID, OfflineCount.MCR))
                {
                    LogManager.CurrentInstance.ErrorLogger.LogError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, " ==> " + _userID + " : Mcr count reset operation failed.", System.Reflection.MethodBase.GetCurrentMethod().Name);
                }
            }
            return(mcrDetails);
        }
Ejemplo n.º 2
0
        public async Task <HttpResponseMessage> GetDetails(McrDetailsRequest request)
        {
            if (!ModelState.IsValid || request == null)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            try
            {
                var result = await Task.Factory.StartNew(() => NeeoVoipApi.GetMcrDetails(request.Uid, request.Flush));

                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (ApplicationException applicationException)
            {
                return(SetCustomResponseMessage("", (HttpStatusCode)(Convert.ToInt32(applicationException.Message))));
            }
            catch (Exception exception)
            {
                LogManager.CurrentInstance.ErrorLogger.LogError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, exception.Message, exception);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }