Example #1
0
        public async Task <int> Create(CreateBrochureViewModel item)
        {
            var createdItem   = Mapper.Map <CreateBrochureViewModel, Brochure>(item);
            int createdItemId = await _brochureRepository.Create(createdItem);

            return(createdItemId);
        }
Example #2
0
        public void Create(BrochureViewModel brochureViewModel)
        {
            var brochure = Mapper.Map <BrochureViewModel, Brochure>(brochureViewModel);

            brochure.Type = LibraryType.Brochures;

            _brochureRepository.Create(brochure);
        }
Example #3
0
        public void Create(BrochureViewModel brochureViewModel, HttpPostedFileBase uploadImage)
        {
            var brochure = Mapper.Map <BrochureViewModel, Brochure>(brochureViewModel);

            brochure.Type = LibraryType.Brochures;

            IEnumerable <Redaction> redactions = _redactionRepository.GetAll();

            brochure.RedactionName = redactions.FirstOrDefault(x => x.RedactionId == brochure.RedactionId)?.RedactionName;

            byte[] imageData = _imageHelper.GetImage(uploadImage);

            brochure.Image = imageData;

            _brochureRepository.Create(brochure);
        }