Exemplo n.º 1
0
 private void btnDeleteProduct_Click(object sender, EventArgs e)
 {
     if (CheckBill())
     {
         foreach (DataGridViewCell oneCell in dgvDachon.SelectedCells)
         {
             if (oneCell.Selected)
             {
                 ChiTietHoaDon ct = _service.getBillDetail(txtIDBilltoDetail.Text, MaSP.ToString());
                 _service.DeleteBillDetail(ct);
                 dgvDachon.Rows.RemoveAt(oneCell.RowIndex);
             }
         }
         txtTotaltoFake.Text = String.Format("{0:#,0 vnđ}", calculatedBill());
         HoaDon billtoUpdate = _service.getBill(txtIDBilltoDetail.Text);
         billtoUpdate.TongTien  = calculatedBill();
         billtoUpdate.TrangThai = "Đang chờ ";
         _service.EditBill(billtoUpdate);
     }
 }