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); }
private void OnResetSearch(BindItem item) { item.Name = ""; item.Address = ""; }