Example #1
0
        protected override void Hapus()
        {
            var index = this.gridList.SelectedIndex;

            if (!base.IsSelectedItem(index, this.Text))
            {
                return;
            }

            if (MsgHelper.MsgDelete())
            {
                using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0)))
                {
                    var beli   = _listOfBeli[index];
                    var result = _bll.Delete(beli);
                    if (result > 0)
                    {
                        GridListControlHelper.RemoveObject <BeliProduk>(this.gridList, _listOfBeli, beli);
                        ResetButton();
                    }
                    else
                    {
                        MsgHelper.MsgDeleteError();
                    }
                }
            }
        }
Example #2
0
        public void DeleteTest()
        {
            var obj = new BeliProduk
            {
                beli_produk_id = "9fdd5459-f9cb-4361-bce7-7edd32f4eb13"
            };

            var result = _bll.Delete(obj);

            Assert.IsTrue(result != 0);

            var deletedObj = _bll.GetByID(obj.beli_produk_id);

            Assert.IsNull(deletedObj);
        }