Ejemplo n.º 1
0
        public override void DoDelete(IButtonInfo sender)
        {
            AssertFocusedRow();//检查是否选择一条记录
            if (!Msg.AskQuestion("真的要删除?"))
            {
                return;
            }

            //调用业务逻辑类删除记录
            DataRow summary = _SummaryView.GetDataRow(_SummaryView.FocusedRowHandle);
            bool    b       = _BLL.Delete(summary[_BLL.KeyFieldName].ToString());

            AssertEqual(b, true, "删除记录时发生错误!");

            base.DoDelete(sender);
            this.DeleteSummaryRow(_SummaryView.FocusedRowHandle); //删除Summary资料行
            if (_SummaryView.FocusedRowHandle < 0)                //删除了最後一条记录. 显示Summary页面.
            {
                ShowSummaryPage(true);
            }
            else
            {
                _BLL.CreateDataBinder(_SummaryView.GetDataRow(_SummaryView.FocusedRowHandle));
                this.DoViewContent(sender);
                base.DoDelete(sender);
            }
        }
Ejemplo n.º 2
0
        public override void DoDelete(IButtonInfo sender)
        {
            AssertFocusedRow();//检查是否选择一条记录
            if (!Msg.AskQuestion("真的要删除?"))
            {
                return;
            }

            //调用业务逻辑类删除记录
            DataRow summary = _SummaryView.GetDataRow(_SummaryView.FocusedRowHandle);
            string  sFdes   = "删除菜单" + summary[tb_sys_Function.FName] + "(" + summary[tb_sys_Function.FNumber] + ")";
            bool    b       = _BLL.Delete(summary[_BLL.KeyFieldName].ToString());

            AssertEqual(b, true, "删除记录时发生错误!");

            bllComDataBaseTool.WriteLogOp(_FunctionID, "0", sFdes);
            base.DoDelete(sender);
            this.DeleteSummaryRow(_SummaryView.FocusedRowHandle); //删除Summary资料行
            if (_SummaryView.FocusedRowHandle < 0)                //删除了最後一条记录. 显示Summary页面.
            {
                ShowSummaryPage(true);
            }
            else
            {
                _BLL.CreateDataBinder(_SummaryView.GetDataRow(_SummaryView.FocusedRowHandle));
                this.DoViewContent(sender);
                base.DoDelete(sender);
            }
        }