Exemple #1
0
        public FeaturesBackgroundDto GetActivateFeaturesBackground(long roomId)
        {
            var room = _roomService.Find(roomId);
            var featureBackgroundId             = _adminService.Find(room.AdminId).FeaturesBackgroundId;
            FeaturesBackgroundDto backgroundDto = new FeaturesBackgroundDto();

            backgroundDto = Mapper.Map <FeaturesBackgroundDto>(featureBackgroundId > 0 ? _backgroundService.Find(featureBackgroundId) : _backgroundService.Find(Strings.FeaturesBackgroundId));
            return(backgroundDto);
        }
Exemple #2
0
        public void AddBackground(FeaturesBackgroundDto backgroundDto, string path)
        {
            var background = Mapper.Map <FeaturesBackground>(backgroundDto);

            _backgroundService.Insert(background);
            SaveChanges();
            var admin = _adminService.Find(backgroundDto.UserId);

            admin.FeaturesBackgroundId = background.FeaturesBackgroundId;
            _adminService.Update(admin);
            SaveChanges();

            _manageStorage.UploadImage(path + "\\" + "Features Background", backgroundDto.Image, background.FeaturesBackgroundId.ToString());
        }