Example #1
0
 /// <summary>
 /// 删除书本
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void skinButton4_Click(object sender, EventArgs e)
 {
     try
     {
         //删除书本
         if (BooksBLL.DeleteBooks(id))
         {
             MessageBox.Show("删除成功", "温馨提示");
         }
         else
         {
             MessageBox.Show("请选择您要删除的书本", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("请联系管理员" + ex, "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         throw;
     }
     finally
     {
         //绑定数据源
         //初始化文本框数据
         this.dgv_goods.DataSource = BooksBLL.GetBooksandType();
         this.txt_goodsname.Text   = null;
         this.txt_jinjia.Text      = null;
         this.txt_kucun.Text       = null;
         this.txt_shoujia.Text     = null;
         this.txt_tiaoxingma.Text  = null;
         this.txt_zhekou.Text      = null;
     }
 }
Example #2
0
 public int DeleteBooks(int bookid)
 {
     return(bookBLL.DeleteBooks(bookid));
 }