private void butDel_Click(object sender, EventArgs e) { try { if (txtQueueName.Tag == null) { MessageBox.Show("请选择需要删除的队列信息。", "提示"); return; } //弹出删除确认窗口 if (MessageBox.Show("是否删除队列:" + txtQueueName.Text + "?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No) { return; } _qm.DelQueueInfo(txtQueueName.Tag.ToString()); //int rowIndex = 0; if (listView1.SelectedItems.Count > 0) { //rowIndex = listView1.SelectedItems[0].Index; listView1.Items.Remove(listView1.SelectedItems[0]); } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butNew_Click(object sender, EventArgs e) { try { if (Verify() == false) { return; } WindowInfoData windowInfo = new WindowInfoData(); windowInfo.窗体ID = SqlHelper.GetCmpUID(); windowInfo.科室ID = cbxDepartment.SelectedValue.ToString(); windowInfo.窗体名称 = txtWindowName.Text; windowInfo.分组标记 = cbxWindowGroup.Text; windowInfo.窗体信息.窗体描述 = rtbWindowDescription.Text; windowInfo.窗体信息.创建日期 = _rwm.GetServerDate(); windowInfo.窗体信息.CopyBasePro(windowInfo); _rwm.NewWindow(windowInfo); NewView(windowInfo); UpdateWindowGroup(); ButtonHint.Start(sender as Button, "OK"); //添加后定位焦点 listView1.Items.Find(windowInfo.窗体ID, false)[0].Selected = true; } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void btnRemove_Click(object sender, EventArgs e) { try { string roomName = ""; if (dgvDept.SelectedRows.Count == 1) { DataGridViewRow dvr = dgvDept.SelectedRows[0]; roomName = dvr.Cells["房间名称"].Value.ToString(); roomName = " " + roomName + " "; } else { //如果房间列表没有数据,不允许执行删除按钮功能。 MessageBox.Show("房间名称未找到,不能执行删除操作", "提示"); return; } if (MessageBox.Show("确定要删除房间" + roomName + "吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } if (RoomDel()) { ButtonHint.Start(sender as Button, "OK"); } } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (txtBodypartName.Tag == null) { MessageBox.Show("请选择需要删除的部位信息。", "提示"); return; } //删除弹出提示确认删除 if (MessageBox.Show("是否删除部位:" + txtBodypartName.Text + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _bpm.DelBodypartInfo(txtBodypartName.Tag.ToString()); int rowIndex = 0; if (listView1.SelectedItems.Count > 0) { rowIndex = listView1.SelectedItems[0].Index; listView1.Items.Remove(listView1.SelectedItems[0]); } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void btnDel_Click(object sender, EventArgs e) { iOperationRow = iRow; if (iRow < 0 || iRow > dgvDictionary.Rows.Count - 1) { return; } if (string.IsNullOrEmpty(txtDicName.Text.Trim())) { return; } if (MessageBox.Show("是否删除选择行字典项目:" + txtDicName.Text.Trim() + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { gridlist.RemoveAt(iRow); if (UpdateDictionary()) { //BindDictionaryData(cbxDictionary.Text); ClearDicItem(); ReBindDictonary(); ButtonHint.Start(sender as Button, "OK"); //如果字典项目列表行数大于删除前选择的行数,定位到下一行 if (dgvDictionary.Rows.Count > iOperationRow) { dgvDictionary.Rows[iOperationRow].Selected = true; } } } }
private void butDel_Click(object sender, EventArgs e) { try { if (treeView1.SelectedNode == null) { MessageBox.Show("请选择需要删除的项目。", "提示"); return; } TreeNode delNode = treeView1.SelectedNode; if (delNode.Tag is ReportTemplateFormatData) { //删除模板格式 ReportTemplateFormatData formatData = delNode.Tag as ReportTemplateFormatData; _rtm.DelTemplateFormat(formatData.格式ID); delNode.Parent.Nodes.Remove(delNode); } else if (delNode.Tag is ReportTemplateItemData) { if (delNode.Nodes.Count > 0) { MessageBox.Show("项目存在子项,不允许删除。", "提示"); return; } //删除模板信息 ReportTemplateItemData itemData = delNode.Tag as ReportTemplateItemData; _rtm.DelTemplateItem(itemData.模板ID); delNode.Parent.Nodes.Remove(delNode); } else { if (delNode.Nodes.Count > 0) { MessageBox.Show("项目存在子项,不允许删除。", "提示"); return; } //删除模板分类 ReportTemplateClassData classData = delNode.Tag as ReportTemplateClassData; _rtm.DelTemplateClass(classData.模板分类ID); delNode.Parent.Nodes.Remove(delNode); } ButtonHint.Start(butDel, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { if (txtWindowName.Tag == null) { MessageBox.Show("请选择需要修改的窗体信息。", "提示"); return; } WindowInfoData windowInfo = GetSelectWindowInfo(); if (windowInfo == null) { MessageBox.Show("未获取到有效的窗体信息。", "提示"); return; } if (Verify(true) == false) { return; } bool isNewGroup = false; if (cbxWindowGroup.Text.Equals(windowInfo.分组标记) == false) { isNewGroup = true; } windowInfo.窗体名称 = txtWindowName.Text; windowInfo.分组标记 = cbxWindowGroup.Text; windowInfo.窗体信息.窗体描述 = rtbWindowDescription.Text; windowInfo.窗体信息.CopyBasePro(windowInfo); _rwm.UpdateWindowInfo(windowInfo); if (isNewGroup) { listView1.Items.Remove(listView1.SelectedItems[0]); NewView(windowInfo); } else { listView1.SelectedItems[0].SubItems[0].Text = txtWindowName.Text; listView1.SelectedItems[0].SubItems[1].Text = SqlHelper.Nvl(windowInfo.分组标记, "未分组"); } UpdateWindowGroup(); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (txtAccountName.Tag == null) { MessageBox.Show("请选择需要删除的用户信息。", "提示"); return; } if (cbxDepartment.SelectedValue == null) { MessageBox.Show("未选择对应科室,不能执行此操作。", "提示"); return; } //弹出确认窗口,确认是否删除当前用户 if (MessageBox.Show("是否删除账户:" + txtAccountName.Text + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _um.DelUserInfo(cbxDepartment.SelectedValue.ToString(), txtAccountName.Tag.ToString()); int rowIndex = 0; if (dataGridView1.SelectedRows.Count > 0) { rowIndex = dataGridView1.SelectedRows[0].Index; } DataTable dtBind = (dataGridView1.DataSource as DataTable); if (dtBind.Rows.Count > 0) { DataRow[] drs = dtBind.Select("用户ID='" + txtAccountName.Tag.ToString() + "'"); foreach (DataRow dr in drs) { dtBind.Rows.Remove(dr); } } //if (dataGridView1.Rows.Count >= rowIndex ) //{ // dataGridView1.Rows[rowIndex].Selected = true; //} //else //{ // dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; //} ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void btnAdd_Click(object sender, EventArgs e) { if (RoomAdd()) { ButtonHint.Start(sender as Button, "OK"); //添加成功后点击定位到最后一行 dgvDept.Rows[dgvDept.Rows.Count - 1].Selected = true; } }
private void butApply_Click(object sender, EventArgs e) { try { UserInfoData adminUser = null; if (txtSurePwd.Text != txtPwd.Text) { MessageBox.Show("确认密码录入不一致,请重新录入。", "提示"); txtSurePwd.Focus(); return; } if (txtAdminName.Tag == null) { string userId = _um.GetUserIDWithAccountName(txtAdminName.Text); if (string.IsNullOrEmpty(userId) == false) { MessageBox.Show("账号名称已经存在。", "提示"); txtAdminName.Focus(); return; } adminUser = new UserInfoData(); adminUser.用户ID = UserModel.ADMIN_ID; adminUser.系统账号 = txtAdminName.Text; adminUser.用户名称 = "管理员"; adminUser.账号信息.密码 = UserModel.EncryPwd(txtPwd.Text); adminUser.账号信息.创建日期 = _um.GetServerDate(); _um.NewUser(adminUser, null); } else { string userId = _um.GetUserIDWithAccountName(txtAdminName.Text); if (string.IsNullOrEmpty(userId) == false && userId.Equals(UserModel.ADMIN_ID) == false) { MessageBox.Show("账号名称已经存在。", "提示"); txtAdminName.Focus(); return; } adminUser = txtAdminName.Tag as UserInfoData; adminUser.系统账号 = txtAdminName.Text; adminUser.账号信息.密码 = UserModel.EncryPwd(txtPwd.Text); _um.UpdateUserInfo(adminUser, null); } ButtonHint.Start(butApply, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (treeView1.SelectedNode == null) { MessageBox.Show("请选择需要删除的项目。", "提示"); return; } TreeNode delNode = treeView1.SelectedNode; if (delNode.Tag is ReportWordsInfoData) { //删除报告词句 ReportWordsInfoData itemData = delNode.Tag as ReportWordsInfoData; //删除项目前提示确认 if (MessageBox.Show("是否删除项目" + itemData.词句名称.ToString() + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _rwm.DelWordItem(itemData.词句ID); delNode.Parent.Nodes.Remove(delNode); } else { if (delNode.Nodes.Count > 0) { MessageBox.Show("项目存在子项,不允许删除。", "提示"); return; } //删除词句分类 ReportWordsClassData classData = delNode.Tag as ReportWordsClassData; //删除项目前提示确认 if (MessageBox.Show("是否删除分类项目" + classData.分类名称.ToString() + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _rwm.DelWordClass(classData.词句分类ID); //delNode.Parent.Nodes.Remove(delNode); //如果是根目录,解决:未将对象引用设置到对象的实例,错误。 delNode.Remove(); } ButtonHint.Start(butDel, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { if (textAlias.Tag == null) { MessageBox.Show("请选择需要修改的数据源。", "提示"); return; } ThridDBSourceData thridDBSource = GetSelectThridDBSource(); if (thridDBSource == null) { MessageBox.Show("未获取到有效的数据源信息。", "提示"); return; } if (Verify(true) == false) { return; } WriteDBSourceInfo(ref thridDBSource); //thridDBSource.数据源别名 = textAlias.Text; //thridDBSource.数据源信息.服务器类型 = cbxServerType.Text; //thridDBSource.数据源信息.驱动文件 = txtAssembly.Text; //thridDBSource.数据源信息.服务器IP = txtPort.Text; //thridDBSource.数据源信息.端口 = Convert.ToInt32(txtPort.Text); //thridDBSource.数据源信息.数据实例 = txtInstance.Text; //thridDBSource.数据源信息.授权账号 = txtUserAccount.Text; //thridDBSource.数据源信息.授权密码 = _dbSourceModel.EncryPwd(txtUserPwd.Text); //thridDBSource.数据源信息.备注描述 = rtbDescription.Text; //thridDBSource.数据源信息.CopyBasePro(thridDBSource); _dbSourceModel.UpdateThridDBSource(thridDBSource); DataRow dr = thridDBSource.GetBindRow(); dr["数据源别名"] = textAlias.Text; dr["数据源信息"] = thridDBSource.数据源信息.ToString(); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (textAlias.Tag == null) { MessageBox.Show("请选择需要删除的配置项目。", "提示"); return; } //删除配置项目前弹出提示对话框 if (MessageBox.Show("是否删除配置项目:" + textAlias.Text, "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _hsm.DelHisServerCfg(textAlias.Tag.ToString()); int rowIndex = 0; if (dataGridView1.SelectedRows.Count > 0) { rowIndex = dataGridView1.SelectedRows[0].Index; } DataTable dtBind = (dataGridView1.DataSource as DataTable); if (dtBind.Rows.Count > 0) { DataRow[] drs = dtBind.Select("HIS服务ID='" + textAlias.Tag.ToString() + "'"); foreach (DataRow dr in drs) { dtBind.Rows.Remove(dr); } } //if (dataGridView1.Rows.Count >= rowIndex ) //{ // dataGridView1.Rows[rowIndex].Selected = true; //} //else //{ // dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; //} ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void btnTest_Click(object sender, EventArgs e) { string strMsg = FtpTest(txtIp.Text.Trim(), txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (string.IsNullOrEmpty(strMsg)) { ButtonHint.Start(sender as Button, "OK"); } else { MsgBox.ShowError(strMsg); } }
private void butModify_Click(object sender, EventArgs e) { try { if (textAlias.Tag == null) { MessageBox.Show("请选择需要修改的配置项目。", "提示"); return; } HisServerCfgData cfgData = GetSelectServerCfgData(); if (cfgData == null) { MessageBox.Show("未获取到有效的配置数据。", "提示"); return; } if (Verify(true) == false) { return; } cfgData.务名称 = textAlias.Text; cfgData.务配置.HIS接口名称 = cbxInterfaceName.Text; cfgData.务配置.HIS接口文件 = txtAssemblyFile.Text; cfgData.务配置.是否停用 = chkStopUse.Checked; if (cbxInterfaceName.Tag != null) { cfgData.务配置.接口配置 = cbxInterfaceName.Tag.ToString(); } cfgData.务配置.CopyBasePro(cfgData); _hsm.UpdateHisServerCfg(cfgData); DataRow dr = cfgData.GetBindRow(); dr["服务名称"] = textAlias.Text; dr["服务配置"] = cfgData.务配置.ToString(); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { if (txtQueueName.Tag == null) { MessageBox.Show("请选择需要修改的队列信息。", "提示"); return; } QueueData queueData = GetSelectQueueData(); if (queueData == null) { MessageBox.Show("未获取到有效的队列信息。", "提示"); return; } if (Verify(true) == false) { return; } queueData.队列名称 = txtQueueName.Text; queueData.队列信息.号码前缀 = txtPrefix.Text; queueData.队列信息.号码长度 = Convert.ToInt32(txtNoLen.Text); queueData.队列信息.播放站点 = txtCallStation.Text; queueData.队列信息.呼叫格式 = rtbCallFormat.Text; queueData.队列信息.是否禁用 = chkStopUse.Checked; queueData.队列信息.备注 = txtDes.Text; queueData.队列信息.CopyBasePro(queueData); _qm.UpdateQueueInfo(queueData); listView1.SelectedItems[0].SubItems[0].Text = txtQueueName.Text; listView1.SelectedItems[0].SubItems[1].Text = txtDes.Text; ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { if (txtDepartName.Tag == null) { MessageBox.Show("请选择需要修改的科室对照。", "提示"); return; } DepartmentInfoData matchData = GetSelectDepartmentMatch(); if (matchData == null) { MessageBox.Show("未获取到有效的科室对照数据。", "提示"); return; } if (Verify(true) == false) { return; } //添加事务处理 _dmm.TransactionBegin(); matchData.科室名称 = txtDepartName.Text; matchData.附加数据.备注 = rtbAttachInfo.Text; matchData.附加数据.CopyBasePro(matchData); _dmm.UpdateDepartmentInfo(matchData); DataRow dr = matchData.GetBindRow(); dr["科室名称"] = txtDepartName.Text; dr["附加数据"] = matchData.附加数据.ToString(); _dmm.DelDepartmentMatch(matchData.科室ID); UpdatDepartmentMatch(matchData); ButtonHint.Start(sender as Button, "OK"); _dmm.TransactionCommit(); } catch (Exception ex) { _dmm.TransactionRollback(); MsgBox.ShowException(ex, "添加科室对照信息失败,参照如下描述信息,进行检查", this); } }
private void butNew_Click(object sender, EventArgs e) { try { if (Verify() == false) { return; } HisServerCfgData cfgData = new HisServerCfgData(); cfgData.HIS服务ID = SqlHelper.GetCmpUID(); cfgData.务名称 = textAlias.Text; cfgData.务配置.HIS接口名称 = cbxInterfaceName.Text; cfgData.务配置.HIS接口文件 = txtAssemblyFile.Text; cfgData.务配置.是否停用 = chkStopUse.Checked; //如果接口信息未进行配置,cbxInterfaceName.Tag的返回值未null,.toString()时会提示错误,需要单独处理 if (cbxInterfaceName.Tag == null) { cfgData.务配置.接口配置 = ""; } else { cfgData.务配置.接口配置 = cbxInterfaceName.Tag.ToString(); } cfgData.务配置.CopyBasePro(cfgData); _hsm.NewHisServerCfg(cfgData); DataTable dtBind = dataGridView1.DataSource as DataTable; DataRow drNew = dtBind.NewRow(); drNew["HIS服务ID"] = cfgData.HIS服务ID; drNew["服务名称"] = cfgData.务名称; drNew["服务配置"] = cfgData.务配置.ToString(); dtBind.Rows.Add(drNew); ButtonHint.Start(sender as Button, "OK"); //添加数据后,焦点定位到最后一行(选中新增的行) dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butApply_Click(object sender, EventArgs e) { try { JNoRuleInfo noRule = GetCurrentNoRule(); _nrm.SetNoRuleInfo(noRule, cbxDepartment.SelectedValue.ToString()); ButtonHint.Start(butApply, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butNew_Click(object sender, EventArgs e) { try { if (Verify() == false) { return; } ThridDBSourceData thridDBSource = new ThridDBSourceData(); thridDBSource.数据源ID = SqlHelper.GetNumGuid(); WriteDBSourceInfo(ref thridDBSource); //thridDBSource.数据源别名 = textAlias.Text; //thridDBSource.数据源信息.服务器类型 = cbxServerType.Text; //thridDBSource.数据源信息.驱动文件 = txtAssembly.Text; //thridDBSource.数据源信息.服务器IP = txtPort.Text; //thridDBSource.数据源信息.端口 = Convert.ToInt32(txtPort.Text); //thridDBSource.数据源信息.数据实例 = txtInstance.Text; //thridDBSource.数据源信息.授权账号 = txtUserAccount.Text; //thridDBSource.数据源信息.授权密码 = _dbSourceModel.EncryPwd(txtUserPwd.Text); //thridDBSource.数据源信息.备注描述 = rtbDescription.Text; //thridDBSource.数据源信息.CopyBasePro(thridDBSource); _dbSourceModel.NewThridDBSource(thridDBSource); DataTable dtBind = dataGridView1.DataSource as DataTable; DataRow drNew = dtBind.NewRow(); drNew["数据源ID"] = thridDBSource.数据源ID; drNew["数据源别名"] = thridDBSource.数据源别名; drNew["数据源信息"] = thridDBSource.数据源信息.ToString(); dtBind.Rows.Add(drNew); ButtonHint.Start(sender as Button, "OK"); //添加数据后,焦点定位到最后一行(选中新增的行) dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void simpleButton1_Click(object sender, EventArgs e) { try { if (_btnDesign.ClickReponse) { ButtonHint.Start(sender as Control, "···"); } DoClick(sender); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (txtWindowName.Tag == null) { MessageBox.Show("请选择需要删除的窗体信息。", "提示"); return; } //如果窗体已经并角色应用,提示删除窗体会删除角色对窗体的应用。否则提示是否删除窗口 //添加事务处理 _rwm.TransactionBegin(); if (_rwm.GetRowName(txtWindowName.Tag.ToString())) { if (MessageBox.Show("窗体:" + txtWindowName.Text + "已经使用,强制删除窗体会自动删除角色对窗体的应用,是否强制删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { _rwm.UpdateRowWindowID(txtWindowName.Tag.ToString()); } else { return; } } else { if (MessageBox.Show("是否删除窗体:" + txtWindowName.Text + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } } _rwm.DelWindowInfo(txtWindowName.Tag.ToString()); _rwm.TransactionCommit(); int rowIndex = 0; if (listView1.SelectedItems.Count > 0) { rowIndex = listView1.SelectedItems[0].Index; listView1.Items.Remove(listView1.SelectedItems[0]); } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { _rwm.TransactionRollback(); MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (txtDepartName.Tag == null) { MessageBox.Show("请选择需要删除的科室对照。", "提示"); return; } //新增提示删除窗口 if (MessageBox.Show("是否删除科室:" + txtDepartName.Text + "的对照信息?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } //删除科室增加事务处理 _dmm.TransactionBegin(); _dmm.DelDepartmentMatch(txtDepartName.Tag.ToString()); _dmm.DelDepartmentInfo(txtDepartName.Tag.ToString()); _dmm.TransactionCommit(); int rowIndex = 0; if (dataGridView1.SelectedRows.Count > 0) { rowIndex = dataGridView1.SelectedRows[0].Index; } DataTable dtBind = (dataGridView1.DataSource as DataTable); if (dtBind.Rows.Count > 0) { DataRow[] drs = dtBind.Select("科室ID='" + txtDepartName.Tag.ToString() + "'"); foreach (DataRow dr in drs) { dtBind.Rows.Remove(dr); } } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { _dmm.TransactionRollback(); MsgBox.ShowException(ex, "科室信息删除失败,请检查该科室是否已经使用,已使用的科室不能删除或参照如下描述信息,进行检查", this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (textAlias.Tag == null) { MessageBox.Show("请选择需要删除的数据源。", "提示"); return; } //删除前弹出提示对话框确认是否删除 if (MessageBox.Show("是否删除数据库别名:" + textAlias.Text, "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _dbSourceModel.DelThridDBSource(textAlias.Tag.ToString()); int rowIndex = 0; if (dataGridView1.SelectedRows.Count > 0) { rowIndex = dataGridView1.SelectedRows[0].Index; } DataTable dtBind = (dataGridView1.DataSource as DataTable); if (dtBind.Rows.Count > 0) { DataRow[] drs = dtBind.Select("数据源ID='" + textAlias.Tag.ToString() + "'"); foreach (DataRow dr in drs) { dtBind.Rows.Remove(dr); } } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void btnNew_Click(object sender, EventArgs e) { string strMsg = ValidateDicItem(0); if (strMsg != "") { MessageBox.Show(strMsg, "提示"); txtDicName.Focus(); txtDicName.SelectAll(); return; } //将新增的行添加到最后一行 try { JDictionaryItem arrnew = new JDictionaryItem(); arrnew.项目名称 = this.txtDicName.Text; arrnew.项目编码 = this.txtDicCode.Text; arrnew.项目说明 = this.txtDicDescription.Text; arrnew.创建日期 = DateTime.Now; if (chkDefaule.Checked) { for (int i = 0; i < gridlist.Count; i++) { gridlist[i].缺省 = false; } arrnew.缺省 = true; } else { arrnew.缺省 = false; } gridlist.Add(arrnew); UpdateDictionary(); ClearDicItem(); //重新绑定字典信息 ReBindDictonary(); ButtonHint.Start(sender as Button, "OK"); dgvDictionary.Rows[dgvDictionary.Rows.Count - 1].Selected = true; iRow = dgvDictionary.Rows.Count - 1; } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { if (txtKindName.Tag == null) { MessageBox.Show("请选择需要修改的设备类别。", "提示"); return; } DeviceKindData kindInfo = GetSelectDeviceKind(); if (kindInfo == null) { MessageBox.Show("未获取到有效的设备类别信息。", "提示"); return; } if (Verify(true) == false) { return; } kindInfo.类别名称 = txtKindName.Text; kindInfo.影像类别 = txtImageKind.Text; kindInfo.类别信息.类别描述 = rtbDescription.Text; kindInfo.类别信息.CopyBasePro(kindInfo); _dkm.UpdateDeviceKindInfo(kindInfo); DataRow dr = kindInfo.GetBindRow(); dr["类别名称"] = txtKindName.Text; dr["影像类别"] = txtImageKind.Text; dr["类别信息"] = kindInfo.类别信息.ToString(); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDelWay_Click(object sender, EventArgs e) { try { if (dataGridView1.SelectedRows.Count <= 0) { MessageBox.Show("未选择需要删除的检查方法,不能执行此操作。", "提示"); return; } BodypartInfoData bodypartData = listView1.SelectedItems[0].Tag as BodypartInfoData; string wayName = dataGridView1.SelectedRows[0].Cells["检查方法"].Value.ToString(); //删除弹出提示: if (MessageBox.Show("是否删除检查方法:" + wayName + "的数据?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } int delIndex = (bodypartData.部位信息.互斥方法 as List <JBodypartWay>).FindIndex(T => T.方法名称 == wayName); if (delIndex >= 0) { bodypartData.部位信息.互斥方法.RemoveAt(delIndex); } else { delIndex = (bodypartData.部位信息.共用方法 as List <JBodypartWay>).FindIndex(T => T.方法名称 == wayName); if (delIndex >= 0) { bodypartData.部位信息.共用方法.RemoveAt(delIndex); } } _bpm.UpdateBodypartWay(bodypartData); BindBodypartWay(bodypartData); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butModify_Click(object sender, EventArgs e) { try { string strMsg = Verify(true); if (string.IsNullOrEmpty(strMsg) == false) { MsgBox.ShowInf(strMsg); return; } UpdateStorage(); ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butDel_Click(object sender, EventArgs e) { try { if (txtKindName.Tag == null) { MessageBox.Show("请选择需要删除的设备类别。", "提示"); return; } if (MessageBox.Show("是否删除影像类别:" + txtImageKind.Text + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } _dkm.DelDeviceKindInfo(txtKindName.Tag.ToString()); int rowIndex = 0; if (dataGridView1.SelectedRows.Count > 0) { rowIndex = dataGridView1.SelectedRows[0].Index; } DataTable dtBind = (dataGridView1.DataSource as DataTable); if (dtBind.Rows.Count > 0) { DataRow[] drs = dtBind.Select("类别ID='" + txtKindName.Tag.ToString() + "'"); foreach (DataRow dr in drs) { dtBind.Rows.Remove(dr); } } ButtonHint.Start(sender as Button, "OK"); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }
private void butNew_Click(object sender, EventArgs e) { try { if (Verify() == false) { return; } //添加事务处理 _dmm.TransactionBegin(); DepartmentInfoData matchInfo = new DepartmentInfoData(); matchInfo.科室ID = SqlHelper.GetCmpUID(); matchInfo.科室名称 = txtDepartName.Text; matchInfo.附加数据.备注 = rtbAttachInfo.Text; matchInfo.附加数据.CopyBasePro(matchInfo); _dmm.NewDepartmentInfo(matchInfo); DataTable dtBind = dataGridView1.DataSource as DataTable; DataRow drNew = dtBind.NewRow(); drNew["科室ID"] = matchInfo.科室ID; drNew["科室名称"] = matchInfo.科室名称; drNew["附加数据"] = matchInfo.附加数据.ToString(); dtBind.Rows.Add(drNew); UpdatDepartmentMatch(matchInfo); ButtonHint.Start(sender as Button, "OK"); _dmm.TransactionCommit(); dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; } catch (Exception ex) { _dmm.TransactionRollback(); MsgBox.ShowException(ex, "添加科室对照信息失败,参照如下描述信息,进行检查", this); } }