//刷新 protected virtual void btnRefresh_Click(object sender, System.EventArgs e) { #region 刷新业务数据 this.m_bOpState = BusiOpState.None; new Thread(DoGetData).Start(); #endregion }
//删除 protected virtual void btnDel_Click(object sender, System.EventArgs e) { #region 除业务数据 if (MsgBox.ShowYesNoMsg2("确定要删除吗?") == DialogResult.Yes) { this.m_bOpState = BusiOpState.DelBusiData; UpdMDBusiData(); } #endregion }
//取消 protected virtual void btnCancel_Click(object sender, System.EventArgs e) { #region 取消操作业务数据 this.m_bOpState = BusiOpState.None; if (this.m_bmdObj.BusiDataPre != null) { this.m_bmdObj.BusiData.Clear(); this.m_bmdObj.BusiData = this.m_bmdObj.BusiDataPre.Copy(); MTableUpd(); } #endregion }
//弃审 protected virtual void btnUnAudit_Click(object sender, System.EventArgs e) { #region 弃审业务数据 this.m_bOpState = BusiOpState.UnAuditBusiData; if (this.m_dvM.Count > 0) { this.m_dvM[0].Row.EndEdit(); } UpdMDBusiData(); #endregion }
//编辑 protected virtual void btnEdit_Click(object sender, System.EventArgs e) { #region 编辑业务数据 this.m_dvM.Table.AcceptChanges(); this.m_dvD.Table.AcceptChanges(); this.m_dvM.AllowEdit = true; m_drv = m_dvM[0]; m_drv.BeginEdit(); this.m_dvD.AllowEdit = true; this.dgD.ReadOnly = false; this.m_bOpState = BusiOpState.EditBusiData; BaseHelper.SetEditMode(pnl_PageM); this.SetBtnMode(2); #endregion }
protected virtual void MTableUpd() { #region 主从表部分界面更新 //主表绑定 this.m_dvM = m_bmdObj.BusiData.Tables[0].DefaultView; //从表绑定 m_bmdObj.BusiData.Tables[1].TableName = "t1"; this.m_dvD = m_bmdObj.BusiData.Tables[1].DefaultView; this.m_dvD.AllowNew = this.m_dvD.AllowEdit = this.m_dvD.AllowDelete = false; this.dgD.DataSource = this.m_dvD; this.dgD.Enabled = this.dgD.ReadOnly = true; this.btnAddDLine.Enabled = this.btnDelDLine.Enabled = false; BaseHelper.SetReadMode(pnl_PageM); this.SetBtnMode(0); MTableDataBinding(0); MTableDataBinding2(0); this.m_bOpState = BusiOpState.None; this.statusBarPanel1.Text = ""; if (this.m_dvM != null) { this.statusBarPanel1.Text = "记录数:" + this.m_dvD.Count.ToString(); } if (this.m_bShowOnly) { ShowOnly(); } UICtrl.AppDoEvents(3); #endregion }
//新增 protected virtual void btnAdd_Click(object sender, System.EventArgs e) { #region 新增业务数据 this.m_dvM.Table.AcceptChanges(); this.m_dvD.Table.AcceptChanges(); this.m_dvM.Table.Clear(); this.m_dvM.AllowNew = true; m_drv = this.m_dvM.AddNew(); m_drv.BeginEdit(); m_drv[this.m_strPKM] = 0; this.m_dvM.AllowNew = false; this.dgD.ReadOnly = false; this.m_dvD.AllowEdit = true; this.m_dvD.Table.Clear(); this.m_bOpState = BusiOpState.AddBusiData; BaseHelper.SetEditMode(pnl_PageM); this.SetBtnMode(1); DTableColumn(); #endregion }