public JsonResult GetAllMusicInstruments() { var instruments = _InstrumentService.GetAll(); ICollection <MusicInstrumentViewModel> entity = new List <MusicInstrumentViewModel>(); foreach (var instrument in instruments) { entity.Add(_mapper.Map <MusicInstrumentDTO, MusicInstrumentViewModel>(instrument)); } return(Json(entity, JsonRequestBehavior.AllowGet)); }
public ActionResult MakeOrder() { var instruments = _InstrumentService.GetAll(); ICollection <MusicInstrumentViewModel> entity = new List <MusicInstrumentViewModel>(); foreach (var instrument in instruments) { entity.Add(_mapper.Map <MusicInstrumentDTO, MusicInstrumentViewModel>(instrument)); } return(View(new OrderViewModel(entity))); }
public ActionResult MakeOrder() { var currentUser = _applicationUserService.GetUserById(Guid.Parse(User.Identity.GetUserId())); _logger.Info("User " + currentUser.Id + " get url " + HttpContext.Request.Url.AbsoluteUri); var instruments = _musicInstrumentService.GetAll(); ICollection <MusicInstrumentViewModel> entity = new List <MusicInstrumentViewModel>(); foreach (var instrument in instruments) { entity.Add(_mapper.Map <MusicInstrumentDTO, MusicInstrumentViewModel>(instrument)); } return(View(new OrderViewModel(entity))); }
public ActionResult ChangeMusicInstruments() { var instruments = _InstrumentService.GetAll(); ICollection <MusicInstrumentViewModel> entity = new List <MusicInstrumentViewModel>(); foreach (var instrument in instruments) { entity.Add(_mapper.Map <MusicInstrumentDTO, MusicInstrumentViewModel>(instrument)); } MusicInstrumentForDropdown musicInstrumentForDropdown = new MusicInstrumentForDropdown() { MusicInstuments = entity }; return(View(musicInstrumentForDropdown)); }