public ReportsResponse GetReports(ReportsRequest request)
        {
            var response = new ReportsResponse {
                ResponseStatus = ResponseStatus.Success
            };

            var clientsProvider = new ClientsProvider();

            try
            {
                if (request.ActionType == ActionType.Select)
                {
                    response.Reports = clientsProvider.GetClientReports(request);
                }
                else
                {
                    response.ResponseStatus      = ResponseStatus.Failure;
                    response.ResponseDescription = "Not update action";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus      = ResponseStatus.Failure;
                response.ResponseDescription = ex.Message;
            }

            return(response);
        }
Esempio n. 2
0
        private void Submit(object sender, EventArgs e)
        {
            var req = new ReportsRequest
            {
                date_from = Request.Form["date_from"],
                date_to   = Request.Form["date_to"]
            };
            var resp = new Reports().Post(req);

            if (resp.Error != null)
            {
                DataError   = resp.Error.ErrorMessage;
                DataErrorId = resp.Error.RequestId;
            }
            else
            {
                if (resp.response.Count == 0)
                {
                    DataNoList = "No data";
                }
                Data = resp;
            }
        }