예제 #1
0
 private Task <bool> OnSaveAsync(EditFooTree item)
 {
     if (item.Id == 0)
     {
         item.Id = AllItems.Max(i => i.Id) + 1;
         AllItems.Add(item);
     }
     else
     {
         var oldItem = AllItems.FirstOrDefault(i => i.Id == item.Id);
         if (oldItem != null)
         {
             oldItem.ParentId = item.ParentId;
             oldItem.Name     = item.Name;
             oldItem.DateTime = item.DateTime;
             oldItem.Address  = item.Address;
             oldItem.Count    = item.Count;
         }
     }
     return(Task.FromResult(true));
 }