Esempio n. 1
0
        public async Task <Result> UpdatePictureTypeAsync(PictureTypeViewModel model)
        {
            var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model);

            var saveChange = await _iPictureTypeRepository.UpdatePictureTypeAsync(data);

            if (saveChange > 0)
            {
                return(Result.Ok(MessageHelper.Update));
            }
            else
            {
                return(Result.Fail(MessageHelper.UpdateFail));
            }
        }
Esempio n. 2
0
        public async Task <Result> InsertPictureTypeAsync(PictureTypeViewModel model)
        {
            try
            {
                var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model);

                var saveChange = await _iPictureTypeRepository.InsertPictureTypeAsync(data);

                if (saveChange > 0)
                {
                    return(Result.Ok(MessageHelper.Save));
                }
                else
                {
                    return(Result.Fail(MessageHelper.SaveFail));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 3
0
        public async Task <int> InsertOrUpdatetPictureTypeAsync(PictureTypeViewModel model)
        {
            var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model);

            return(await _iPictureTypeRepository.InsertOrUpdatetPictureTypeAsync(data));
        }