//添加病区对应用法 private void AddDeptUsage() { //判断是否选择了病区和用法 if (GlueDept.EditValue != null && GlueUsage.EditValue != null && (this.cbLong.Checked || this.cbTemporary.Checked)) { if (CJia.PIVAS.Tools.Message.ShowQuery("确认是否添加", CJia.PIVAS.Tools.Message.Button.YesNo) == CJia.PIVAS.Tools.Message.Result.Yes) { CJia.PIVAS.Views.DataManage.AddDeptUsageEventArgs addDeptUsage = new Views.DataManage.AddDeptUsageEventArgs(); DataRow drDept = GlueViewDept.GetFocusedDataRow(); DataRow drUsage = GlueViewUsage.GetFocusedDataRow(); addDeptUsage.OfficeId = drDept["DEPT_ID"].ToString(); addDeptUsage.OfficeName = drDept["DEPT_NAME"].ToString(); addDeptUsage.UsageId = long.Parse(drUsage["USAGE_ID"].ToString()); addDeptUsage.UsageName = drUsage["USAGE_NAME"].ToString(); addDeptUsage.UserId = User.UserId; addDeptUsage.ChecdLong = this.cbLong.Checked; addDeptUsage.ChecdTemporary = this.cbTemporary.Checked; this.OnInsertData(null, addDeptUsage); } else { return; } } else { CJia.PIVAS.Tools.Message.Show("病区、用法或医嘱类型未选择"); return; } }
/// <summary> /// 选中了病区触发加载未配置当前病区的用法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GlueDept_EditValueChanged(object sender, EventArgs e) { if (GlueDept.EditValue != null) { DataRow drDept = GlueViewDept.GetFocusedDataRow(); CJia.PIVAS.Views.DataManage.AddDeptUsageEventArgs addDeptUsage = new Views.DataManage.AddDeptUsageEventArgs(); addDeptUsage.OfficeId = drDept["DEPT_ID"].ToString(); this.OnRowClick(null, addDeptUsage); } else { return; } }