コード例 #1
0
        protected override void Hapus()
        {
            var index = this.gridList.SelectedIndex;

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

            if (MsgHelper.MsgDelete())
            {
                var userOperator = _listOfOperator[index];

                var result = _bll.Delete(userOperator);
                if (result > 0)
                {
                    GridListControlHelper.RemoveObject <Pengguna>(this.gridList, _listOfOperator, userOperator);
                    ResetButton();
                }
                else
                {
                    MsgHelper.MsgDeleteError();
                }
            }
        }
コード例 #2
0
        public void DeleteTest()
        {
            var obj = new Pengguna
            {
                pengguna_id = "27ec113f-1803-48d4-867f-c5070fa10a48"
            };

            var result = _bll.Delete(obj);

            Assert.IsTrue(result != 0);

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

            Assert.IsNull(deletedObj);
        }