Esempio n. 1
0
        public void Save(TvStaffViewModel viewModel)
        {
            var model   = _mapper.Map <TvStaff>(viewModel);
            var citizen = _citizenRepository.GetByName(viewModel.Citizen.Name);

            model.Citizen = citizen;
            model.Channel = _userService.GetUser().TvStaff.Channel;
            _staffRepository.Save(model);
        }
Esempio n. 2
0
        public void SaveDirector(TvStaffViewModel viewModel)
        {
            var model = _mapper.Map <TvStaff>(viewModel);

            var citizen = _citizenRepository.GetByName(viewModel.Citizen.Name);

            model.Citizen = citizen;

            var channel = _channelRepository.GetByName(viewModel.Channel.Name);

            model.Channel = channel;

            _staffRepository.Save(model);
        }