//保存商家 private bool SaveStore(string name) { try { if (name == "") { MessageBox.Show("商家名称不能为空!"); return false; } else { Store store = new Store() { Name = name }; App.storeHelper.AddNew(store); } } catch (Exception e) { MessageBox.Show(e.Message); return false; } ToastPrompt tp = new ToastPrompt(); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255)); tp.Foreground = brush; tp.Background = PageTitle.Foreground; tp.Message = "保存成功"; tp.Show(); return true; }
public void Update(Store item, string name) { item.Name = name; }
public void Remove(Store item) { this._data.Remove(item); }
public void AddNew(Store item) { item.ID = Guid.NewGuid(); this._data.Add(item); }