Example #1
0
        public ClientReports GetClientReports()
        {
            try
            {
                _WriteLineConsole("get client reports");

                using (var helper = new ClientReportHelper())
                {
                    return(helper.GetClientReports());
                }
            }
            catch (Exception ex)
            {
                _WriteLineError("get client reports", ex.Message);
                return(new ClientReports(ex));
            }
        }
Example #2
0
        public ClientReport GetClientReport(int id)
        {
            try
            {
                _WriteLineConsole($"get client report id: {id}");

                using (var helper = new ClientReportHelper())
                {
                    return(helper.GetClientReport(id));
                }
            }
            catch (Exception ex)
            {
                _WriteLineError("get client report", ex.Message);
                return(new ClientReport()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
Example #3
0
        public Response SaveClientReport(ClientReportDocument document)
        {
            try
            {
                _WriteLineConsole($"save client report identity: {document.Identity}");
                using (var helper = new ClientReportHelper())
                {
                    helper.SaveDocument(document);
                }

                return(new Response()
                {
                    Message = "Данные успешно сохраненны"
                });
            }
            catch (Exception ex)
            {
                _WriteLineError($"save client report identity: {document?.Identity}", ex.Message);
                return(new Response(ex));
            }
        }
Example #4
0
        public Response DeleteClientReport(ClientReportDocument document)
        {
            try
            {
                _WriteLineConsole($"delete client report identity: {document.Identity}");
                using (var helper = new ClientReportHelper())
                {
                    helper.DeleteDocument(document);
                }

                return(new Response()
                {
                    Message = "Документ удален"
                });
            }
            catch (Exception ex)
            {
                _WriteLineError($"delete client report identity: {document?.Identity}", ex.Message);
                return(new Response(ex));
            }
        }
Example #5
0
        public ExcelPrintedDocumentDto GetClientReportPrintedDocument(ClientReports reports)
        {
            try
            {
                _WriteLineConsole("get client report printed document");

                using (var printedService = new ClientReportHelper())
                {
                    return(new ExcelPrintedDocumentDto()
                    {
                        Document = printedService.GetPrintedReportList(reports)
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError("get client report printed document", ex.Message);
                return(new ExcelPrintedDocumentDto()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }