Пример #1
0
        public static ABossReviewReasonResponse GetReviewReasonByAgentBoss(ABossReviewReasonRequest request)
        {
            ABossReviewReasonResponse response = new ABossReviewReasonResponse();

            try
            {
                if (!AgentBossServices.CheckAgentBoss(request.user_id, request.auth_token, response))
                {
                    return(response);
                }
                response.service_reason_rating = new List <ABossReviewReasonDto>();
                using (OrderDao dao = new OrderDao())
                {
                    int periodRange   = Common.GetAppSetting <int>(APPSETTING_REPORTPERIOD_RANGE, 6);
                    var reportDetails = dao.GetReviewReasonByAgentBoss(request.user_id, request.driver_id, request.periodical_data, periodRange);
                    if (reportDetails != null && reportDetails.Count > 0)
                    {
                        response.service_reason_rating = reportDetails.Select(r => new ABossReviewReasonDto
                        {
                            key   = r.ReasonText,
                            value = r.Value.ToDecimal()
                        }).ToList();
                    }
                    response.code         = 0;
                    response.has_resource = 1;
                    response.message      = MessagesSource.GetMessage("boss.rating.report");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
        public NegotiatedContentResult <ABossReviewReasonResponse> PostGetReviewReasonReport([FromBody] ABossReviewReasonRequest request)
        {
            ABossReviewReasonResponse resp = ReportsServices.GetReviewReasonByAgentBoss(request);

            return(Content(HttpStatusCode.OK, resp));
        }