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));
        }
示例#2
0
        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)));
        }
示例#3
0
        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)));
        }
示例#4
0
        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));
        }