private void btn_Save_Click(object sender, EventArgs e) { VipSoft.Model.Shop shopModel = new Model.Shop(); shopModel.Name = this.txt_ShopName.Text.Trim(); shopModel.TelPhone = this.txt_Tel.Text.Trim(); shopModel.ShopLink = this.txt_Link.Text.Trim(); shopModel.Remark = this.txt_Remark.Text.Trim(); if (CurrentShopID != -1) { shopModel.ID = CurrentShopID; if (bllShop.Update(shopModel)) { this.myTabControl1.SelectedIndex = 0; BindShopList(); MessageBox.Show("修改店铺成功!"); } else { MessageBox.Show("修改店铺失败!"); } } else { if (bllShop.Add(shopModel) > 0) { this.myTabControl1.SelectedIndex = 0; BindShopList(); MessageBox.Show("新增店铺成功!"); } else { MessageBox.Show("新增店铺失败!"); } } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(VipSoft.Model.Shop model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(VipSoft.Model.Shop model) { return(dal.Add(model)); }