protected override void Hapus() { var index = this.gridList.SelectedIndex; if (!base.IsSelectedItem(index, this.Text)) { return; } if (MsgHelper.MsgDelete()) { var retur = _listOfRetur[index]; var result = _bll.Delete(retur); if (result > 0) { GridListControlHelper.RemoveObject <ReturJualProduk>(this.gridList, _listOfRetur, retur); ResetButton(); } else { MsgHelper.MsgDeleteError(); } } }
public void DeleteTest() { var obj = new ReturJualProduk { retur_jual_id = "a1597295-c11d-4ea2-b074-e8c6369bf028" }; var result = _bll.Delete(obj); Assert.IsTrue(result != 0); var deletedObj = _bll.GetByID(obj.retur_jual_id); Assert.IsNull(deletedObj); }