Esempio n. 1
0
 public static void UpdateUserAudio(this UserAudio userAudio, UserAudioViewModel userAudioVM)
 {
     userAudio.Id          = userAudioVM.Id;
     userAudio.UserId      = userAudioVM.UserId;
     userAudio.AudioTitle  = userAudioVM.AudioTitle;
     userAudio.Path        = userAudioVM.Path;
     userAudio.CreatedDate = userAudioVM.CreatedDate;
     userAudio.Text        = userAudioVM.Text;
 }
Esempio n. 2
0
        public ActionResult Edit(UserAudioViewModel userAudioViewModel)
        {
            UserAudio userAudioModel = new UserAudio();

            userAudioModel.UpdateUserAudio(userAudioViewModel);
            _userAudioService.Update(userAudioModel);
            _userAudioService.Save();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
 public ActionResult Create(UserAudioViewModel userAudioViewModel)
 {
     if (ModelState.IsValid)
     {
         UserAudio userAudioModel = new UserAudio();
         userAudioModel.UpdateUserAudio(userAudioViewModel);
         userAudioModel.CreatedDate = DateTime.Now;
         userAudioModel.UserId      = User.Identity.GetUserId();
         _userAudioService.Add(userAudioModel);
         _userAudioService.Save();
         return(RedirectToAction("Index"));
     }
     return(View());
 }