//保存商家
 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;
 }
示例#2
0
 public void Update(Store item, string name)
 {
     item.Name = name;
 }
示例#3
0
 public void Remove(Store item)
 {
     this._data.Remove(item);
 }
示例#4
0
 public void AddNew(Store item)
 {
     item.ID = Guid.NewGuid();
     this._data.Add(item);
 }