/// <summary> /// Handles the Click event of the btnBuffInfoAlter control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// 整理人:桂书丛 /// 整理时间:2013-03-06 private void btnBuffInfoAlter_Click(object sender, EventArgs e) { DevExpress.XtraTab.XtraTabPage tempTabPage = this.tbctrl.SelectedTabPage; if (tempTabPage == null) { return; } if (Convert.ToInt32(tempTabPage.Tag) == 1) { if (this.gridView1.SelectedRowsCount < 0) { XtraMessageBox.Show("请先选择要修改的项", "操作违规", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } tempInfo = ClassAssist.CommonOperator.GetGVSelectRowInfo(this.gridView1); if (tempInfo != null) { myfrmRoomInfoOperate = new frmRoomInfoOperate(tempInfo); } if (myfrmRoomInfoOperate.ShowDialog() == DialogResult.OK) { SelectedPageChanging(this.tbctrl.SelectedTabPage); } } else { if (this.gridViewBuffInfo.SelectedRowsCount < 0) { XtraMessageBox.Show("请先选择要修改的项", "操作违规", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } tempInfo = ClassAssist.CommonOperator.GetGVSelectRowInfo(this.gridViewBuffInfo); if (tempInfo != null) { myfrmBuffInfoOperate = new frmBuffInfoOperate(tempInfo); } if (myfrmBuffInfoOperate.ShowDialog() == DialogResult.OK) { SelectedPageChanging(this.tbctrl.SelectedTabPage); } } }
//****************************按钮的单击事件****************************// private void btnBuffInfoAdd_Click(object sender, EventArgs e) { DevExpress.XtraTab.XtraTabPage tempTabPage = this.tbctrl.SelectedTabPage; if (tempTabPage == null) { return; } if (Convert.ToInt32(tempTabPage.Tag) == 1) { myfrmRoomInfoOperate = new frmRoomInfoOperate(); if (myfrmRoomInfoOperate.ShowDialog() == DialogResult.OK) { SelectedPageChanging(this.tbctrl.SelectedTabPage); } } else { myfrmBuffInfoOperate = new frmBuffInfoOperate(); if (myfrmBuffInfoOperate.ShowDialog() == DialogResult.OK) { SelectedPageChanging(this.tbctrl.SelectedTabPage); } } }