示例#1
0
        public void Update(PutMagazineViewModel magazineView)
        {
            Magazine magazine = Mapper.Map <PutMagazineViewModel, Magazine>(magazineView);

            magazine.PublicationType = PublicationType.Magazine;
            _magazineRepository.Update(magazine);
        }
示例#2
0
 public IHttpActionResult ModifyMagazineProduct(int id, int count)
 {
     using (var repository = new MagazineRepository())
     {
         repository.Update(id, count);
     }
     return(Ok());
 }
        public void Update(MagazineViewModel magazineViewModel)
        {
            var magazine = Mapper.Map <MagazineViewModel, Magazine>(magazineViewModel);
            int id       = magazine.MagazineId;

            magazine.Type = LibraryType.Magazines;
            _magazineRepository.Update(magazine);
        }
        public void Put(PutMagazineView magazine)
        {
            Magazine magazineModel = _magazineRepository.Get(magazine.Id);

            magazineModel.Name             = magazine.Name;
            magazineModel.Number           = magazine.Number;
            magazineModel.YearOfPublishing = magazine.YearOfPublishing;
            _magazineRepository.Update(magazineModel);
        }
示例#5
0
        public Magazine UpdateMagazine(EditMagazineViewModel view)
        {
            var Magazine = GetMagazineById(view.Id);

            Magazine.MagazineNumber  = view.MagazineNumber;
            Magazine.PublicationDate = view.PublicationDate;
            var publication = _publications.Where(x => x.Id == Magazine.Publication.Id).FirstOrDefault();

            publication.Name = view.PublicationName;
            _publicationRepository.Update(publication);
            _publicationRepository.Save();
            _magazineRepository.Update(Magazine);
            _magazineRepository.Save();
            return(Magazine);
        }
 public void Edit(PostMagazineViewModel magazineViewModel)
 {
     _magazineRepository.Update(ToMagazine(magazineViewModel));
 }
        public /*async*/ void Update(GetMagazineView magazineView)
        {
            var magazine = Mapper.Map <GetMagazineView, Magazine>(magazineView);

            /*await*/ magazineRepository.Update(magazine);
        }
示例#8
0
 public async Task Update(UpdateMagazineViewModel item)
 {
     var updatedItem = Mapper.Map <UpdateMagazineViewModel, Magazine>(item);
     await _magazineRepository.Update(updatedItem);
 }