示例#1
0
 private bool OnSave(BindItem item)
 {
     // 增加数据演示代码
     if (Items != null)
     {
         if (item.Id == 0)
         {
             lock (_objectLock)
             {
                 item.Id = Items.Max(i => i.Id) + 1;
                 Items.Add(item);
             }
         }
         else
         {
             var oldItem = Items.FirstOrDefault(i => i.Id == item.Id);
             oldItem.Name    = item.Name;
             oldItem.Address = item.Address;
         }
     }
     return(true);
 }
示例#2
0
 private void OnResetSearch(BindItem item)
 {
     item.Name    = "";
     item.Address = "";
 }