Пример #1
0
        public HttpResponseMessage CountTicketsByStatus(TicketStatus status, int id = 0)
        {
            try
            {
                var response = manager.GetTicketsByStatusCount(status, id);

                if (response > 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, response));
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound, 0));
                }
            }
            catch (Exception ex)
            {
                GlobalVariable.log.Write(LogLevel.Error, ex);
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }