コード例 #1
0
        public IActionResult Add(DocumentTypeDTOAdd documentTypeDTOAdd)
        {
            _logger.LogInformation(JsonConvert.SerializeObject(documentTypeDTOAdd));
            var result = _iDocumentTypeRepository.Add(documentTypeDTOAdd);

            _logger.LogInformation(JsonConvert.SerializeObject(result));
            return(Ok(result));
        }
コード例 #2
0
        /// <summary>
        /// For the document generation to work there has to be predefined 'document types' in database.
        /// If there aren't any this method creates types: pdf, html, odt, json, docx
        /// </summary>
        public void AddBasicDocTypesToDb()
        {
            List <string> list = new List <string> {
                "pdf", "html", "json", "odt", "docx"
            };

            foreach (string item in list)
            {
                DocumentTypeDomain docType = _documentTypeRepository.GetByName(item);
                if (docType == null)
                {
                    _documentTypeRepository.Add(new DocumentTypeDomain()
                    {
                        Name     = item,
                        Code     = item,
                        Version  = "1.0",
                        Encoding = "utf-8"
                    });
                }
            }
        }
コード例 #3
0
 public DocumentType Add(DocumentType model)
 {
     return(_Repository.Add(model));
 }
コード例 #4
0
 public void CreateDocumentType(DocumentType documentType)
 {
     _documentTypeRepository.Add(documentType);
     SaveDocumentType();
 }
コード例 #5
0
        public void Insert(DocumentTypeViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <DocumentTypeViewModel, DocumentType>(model);

            _repository.Add(contractType);
        }