public PatternsWebPagesDetailViewModel(PatternsWebPagesViewModel vm, MPatternWebPage item)
 {
     item.CopyProperties(ItemEdit);
     ItemEdit.Save = ReactiveCommand.CreateFromTask(async() =>
     {
         ItemEdit.CopyProperties(item);
         item.PATTERN = vm.vmSettings.AutoCorrectInput(item.PATTERN);
         if (item.WEBPAGEID == 0)
         {
             await vm.CreateWebPage(item);
         }
         else
         {
             await vm.UpdateWebPage(item);
         }
         if (item.ID == 0)
         {
             await vm.CreatePatternWebPage(item);
         }
         else
         {
             await vm.UpdatePatternWebPage(item);
         }
     }, ItemEdit.IsValid());
 }
Пример #2
0
        public async Task <int> Create(MPatternWebPage item)
        {
            var item2 = new MWebPage
            {
                TITLE = item.TITLE,
                URL   = item.URL,
            };

            return(await CreateByUrl($"WEBPAGES", item2));
        }
Пример #3
0
        public async Task Update(MPatternWebPage item)
        {
            var item2 = new MWebPage
            {
                ID    = item.WEBPAGEID,
                TITLE = item.TITLE,
                URL   = item.URL,
            };

            Debug.WriteLine(await UpdateByUrl($"WEBPAGES/{item2.ID}", JsonConvert.SerializeObject(item2)));
        }
Пример #4
0
 public async Task CreateWebPage(MPatternWebPage item) =>
 item.WEBPAGEID = await webPageDS.Create(item);
Пример #5
0
 public async Task UpdateWebPage(MPatternWebPage item) =>
 await webPageDS.Update(item);
Пример #6
0
        public async Task CreatePatternWebPage(MPatternWebPage item)
        {
            item.ID = await patternWebPageDS.Create(item);

            WebPageItems.Add(item);
        }