Example #1
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         db.UpdateSach(masach, Convert.ToInt32(txtSoluong.Text), Convert.ToInt32(txtGia.Text));
         DialogResult a = MessageBox.Show("Sửa thành công!", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         if (a == DialogResult.OK)
         {
             txtGia.Enabled     = false;
             txtSoluong.Enabled = false;
             btnSave.Visible    = false;
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Lỗi!", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }