コード例 #1
0
        public Response SaveRowDictionary(string tableName, string value, int id)
        {
            try
            {
                _WriteLineConsole($"save dictionary:{tableName}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    helper.SaveRowDictionary(tableName, value, id);
                }
                return(new Response()
                {
                    Message = "Сохранено"
                });
            }
            catch (Exception ex)
            {
                _WriteLineError($"save dictionary:{tableName}", ex.Message);
                return(new Response()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #2
0
        public Response DeleteRowDictionary(string tableName, int id)
        {
            try
            {
                _WriteLineConsole($"delte dictionary:{tableName} id:{id}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    helper.DeleteRowDictionary(tableName, id);
                }
                return(new Response()
                {
                    Message = "Удалено"
                });
            }
            catch (Exception ex)
            {
                _WriteLineError($"delete dictionary:{tableName} id:{id}", ex.Message);
                return(new Response()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #3
0
        public Response DeletePrintedDocTemplate(PrintedDocumentTemplate template)
        {
            try
            {
                _WriteLineConsole($"delete print template id:{template.Id}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    helper.DeleteTemplate(template);
                    return(new Response()
                    {
                        Message = "Печатная форма удалена"
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError($"delete printed doc template id:{template?.Id}", ex.Message);
                return(new Response()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #4
0
        public DictionaryDto GetDictionary(string tableName, IEnumerable <string> columns)
        {
            try
            {
                _WriteLineConsole($"get dictionary:{tableName}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    return(new DictionaryDto()
                    {
                        Rows = helper.GetDictionary(tableName, columns)
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError($"get dictionary:{tableName}", ex.Message);
                return(new DictionaryDto()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #5
0
        public SaveEntityResult SavePrintedDocTemplate(PrintedDocumentTemplate template)
        {
            try
            {
                _WriteLineConsole($"save printed doc template id:{template.Id}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    return(new SaveEntityResult()
                    {
                        Id = helper.SaveTemplate(template)
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError($"save printed doc template id:{template?.Id}", ex.Message);
                return(new SaveEntityResult()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #6
0
        public PrintedDocumentTemplatesListDto GetPrintedDocTemplatesList()
        {
            try
            {
                _WriteLineConsole($"get printed doc template list");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    return(new PrintedDocumentTemplatesListDto()
                    {
                        Items = helper.GetList()
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError($"get printed doc template list", ex.Message);
                return(new PrintedDocumentTemplatesListDto()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }
コード例 #7
0
        public PrintedDocumentTemplateDto GetPrintedDocTemplate(int id)
        {
            try
            {
                _WriteLineConsole($"get printed doc template {id}");

                using (var helper = new PrintedDocumentTemplateHelper())
                {
                    return(new PrintedDocumentTemplateDto()
                    {
                        Template = helper.GetTemplate(id)
                    });
                }
            }
            catch (Exception ex)
            {
                _WriteLineError($"get printed doc template {id}", ex.Message);
                return(new PrintedDocumentTemplateDto()
                {
                    Error = true,
                    Message = ex.Message
                });
            }
        }