protected override void Hapus() { var index = this.gridList.SelectedIndex; if (!base.IsSelectedItem(index, this.Text)) { return; } if (MsgHelper.MsgDelete()) { var kasbon = _listOfKasbon[index]; var result = _bll.Delete(kasbon); if (result > 0) { GridListControlHelper.RemoveObject <Kasbon>(this.gridList, _listOfKasbon, kasbon); GridListHandleSelectionChanged(this.gridList); ResetButton(); } else { MsgHelper.MsgDeleteError(); } } }
public void DeleteTest() { var obj = new Kasbon { kasbon_id = "034f800f-5dd6-4173-82cf-88f3879aedb9" }; var result = _bll.Delete(obj); Assert.IsTrue(result != 0); var deletedObj = _bll.GetByID(obj.kasbon_id); Assert.IsNull(deletedObj); }