Exemplo n.º 1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc muốn sửa?", "Confirm", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         try
         {
             string   tenPhim, theLoai;
             int      maPhim = int.Parse(dgvPhim.Rows[RowEnter].Cells[0].Value.ToString());
             DateTime khoiChieu;
             tenPhim   = txtTenPhim.Text;
             theLoai   = txtTheLoai.Text;
             khoiChieu = timePickerKhoiChieu.Value.Date;
             string rowVer = dgvPhim.Rows[RowEnter].Cells[5].Value.ToString();
             if (phimBLL.UpdatePhim(maPhim, tenPhim, theLoai, khoiChieu, rowVer))
             {
                 MessageBox.Show("Update thành công!");
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         QuanLyPhim_Load(sender, e);
     }
 }