Exemplo n.º 1
0
 public MLangPhrase(MUnitPhrase item)
 {
     ID          = item.PHRASEID;
     LANGID      = item.LANGID;
     PHRASE      = item.PHRASE;
     TRANSLATION = item.TRANSLATION;
 }
Exemplo n.º 2
0
        public async Task Update(MUnitPhrase item)
        {
            await unitPhraseDS.Update(item);

            var o = await unitPhraseDS.GetDataById(item.ID, vmSettings.Textbooks);

            o?.CopyProperties(item);
        }
Exemplo n.º 3
0
        public async Task Create(MUnitPhrase item)
        {
            int id = await unitPhraseDS.Create(item);

            var o = await unitPhraseDS.GetDataById(id, vmSettings.Textbooks);

            o?.CopyProperties(item);
            PhraseItemsAll.Add(o);
            ApplyFilters();
        }
Exemplo n.º 4
0
 public PhrasesUnitDetailViewModel(PhrasesUnitViewModel vm, MUnitPhrase item, int wordid)
 {
     item.CopyProperties(ItemEdit);
     vmSinglePhrase = new SinglePhraseViewModel(item.PHRASE, vm.vmSettings);
     ItemEdit.Save  = ReactiveCommand.CreateFromTask(async() =>
     {
         ItemEdit.CopyProperties(item);
         item.PHRASE = vm.vmSettings.AutoCorrectInput(item.PHRASE);
         if (item.ID != 0)
         {
             await vm.Update(item);
         }
         else
         {
             await vm.Create(item);
             if (wordid != 0)
             {
                 await wordPhraseDS.Associate(wordid, item.PHRASEID);
             }
         }
     }, ItemEdit.IsValid());
 }
Exemplo n.º 5
0
 public async Task Delete(MUnitPhrase item) =>
 await unitPhraseDS.Delete(item);