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

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

            if (MsgHelper.MsgDelete())
            {
                var dropshipper = _listOfDropshipper[index];

                using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0)))
                {
                    var result = _bll.Delete(dropshipper);
                    if (result > 0)
                    {
                        GridListControlHelper.RemoveObject <Dropshipper>(this.gridList, _listOfDropshipper, dropshipper);
                        ResetButton();
                    }
                    else
                    {
                        MsgHelper.MsgDeleteError();
                    }
                }
            }
        }
コード例 #2
0
        public void DeleteTest()
        {
            var obj = new Dropshipper
            {
                dropshipper_id = "810efc21-9809-4730-b18b-065e7e1b9368"
            };

            var result = _bll.Delete(obj);

            Assert.IsTrue(result != 0);

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

            Assert.IsNull(deletedObj);
        }