Ejemplo n.º 1
0
        public IActionResult Create()
        {
            var model = new DocumentViewModel
            {
                Genders           = _combosHelper.GetComboGenders(),
                Authors           = _combosHelper.GetComboAuthors(),
                TypeOfDocuments   = _combosHelper.GetComboTypeOfDocuments(),
                DocumentLanguages = _combosHelper.GetComboDocumentLanguages(),
                Date = DateTime.Now
            };

            return(View(model));
        }
Ejemplo n.º 2
0
 public DocumentViewModel ToDocumentViewModel(DocumentEntity documentEntity)
 {
     return(new DocumentViewModel
     {
         Id = documentEntity.Id,
         DocumentPath = documentEntity.DocumentPath,
         Title = documentEntity.Title,
         Date = documentEntity.Date.ToLocalTime(),
         PagesNumber = documentEntity.PagesNumber,
         Summary = documentEntity.Summary,
         Gender = documentEntity.Gender,
         GenderId = documentEntity.Gender.Id,
         Accepted = documentEntity.Accepted,
         Genders = _combosHelper.GetComboGenders(),
         Author = documentEntity.Author,
         AuthorId = documentEntity.Author.Id,
         Authors = _combosHelper.GetComboAuthors(),
         TypeOfDocument = documentEntity.TypeOfDocument,
         TypeOfDocumentId = documentEntity.TypeOfDocument.Id,
         TypeOfDocuments = _combosHelper.GetComboTypeOfDocuments(),
         DocumentLanguage = documentEntity.DocumentLanguage,
         DocumentLanguageId = documentEntity.DocumentLanguage.Id,
         DocumentLanguages = _combosHelper.GetComboDocumentLanguages(),
     });
 }