예제 #1
0
        public void Update(FooterViewModel footerVm)
        {
            var footer = _footerRepository.FindById(footerVm.Id);

            if (footer != null)
            {
                footer.Name        = footerVm.Name;
                footer.Description = footer.Description;
                footer.Order       = footerVm.Order;
                _footerRepository.Update(footer);
            }
        }
예제 #2
0
 public void Update(Footer Footer)
 {
     _footerRepository.Update(Footer);
 }
예제 #3
0
 public void Update(IElementSettings settings, IUnitOfWork unitOfWork = null)
 {
     _footerRepository.Update((FooterSettings)settings, unitOfWork);
 }
예제 #4
0
 public async Task Update(Footer footer)
 {
     _footerRepository.Update(footer);
     await Task.FromResult <object>(null);
 }
        public void TestFooterIsUpdatedCorrectlyFromDatabase()
        {
            User user = new User
            {
                UserName      = "******",
                Password      = "******",
                Name          = "name",
                LastName      = "lastname",
                Email         = Guid.NewGuid().ToString(),
                Administrator = true
            };

            UserRepository.Add(user);

            StyleClass StyleClassF1 = new StyleClass
            {
                Name    = "StyleClassF1",
                BasedOn = null
            };

            StyleClassRepository.Add(StyleClassF1);

            Document document = new Document
            {
                Id               = Guid.NewGuid(),
                Title            = "title1",
                Creator          = user,
                CreationDate     = DateTime.Now,
                LastModification = DateTime.Now,
                StyleClass       = StyleClassF1
            };

            DocumentRepository.Add(document);

            Content content = new Content
            {
                Id = Guid.NewGuid(),
            };

            ContentRepository.Add(content);

            Footer footer = new Footer
            {
                Id                  = Guid.NewGuid(),
                Content             = content,
                DocumentThatBelongs = document,
                StyleClass          = StyleClassF1
            };

            FooterRepository.Add(footer);

            Footer updatedFooter = new Footer
            {
                Id                  = footer.Id,
                Content             = content,
                DocumentThatBelongs = document,
                StyleClass          = null
            };

            FooterRepository.Update(updatedFooter);

            Footer fromDatabase = FooterRepository.GetById(updatedFooter.Id);

            StyleClassRepository.Delete(StyleClassF1.Name);
            DocumentRepository.Delete(document.Id);
            UserRepository.Delete(user.Email);
            ContentRepository.Delete(content);

            Assert.AreEqual(updatedFooter.Id, fromDatabase.Id);
            Assert.AreEqual(updatedFooter.Content.Id, fromDatabase.Content.Id);
            Assert.IsNull(updatedFooter.StyleClass);
            Assert.AreEqual(updatedFooter.DocumentThatBelongs.Id, fromDatabase.DocumentThatBelongs.Id);
        }
예제 #6
0
 public void UpdateFooter(Footer footer)
 {
     _footerRepository.Update(footer);
 }
예제 #7
0
 public void Update(Footer Footer)
 {
     sizeRepository.Update(Footer);
 }