public bool OnChildNotify(object sender, xap.rui.engine.DictionaryEventArgs e) { bool result = false; // 费用保存消息,需要转发到医疗单容器中进行处理 var eventCode = AssToolEx.EventCodeOfEventArgs(e); switch (eventCode) { case EventCodeType.NM_EMS_ORSRV_DATACHANGED: //this.XTabPages[0].HasError = GetEmsView().ExistErrors(); //if (HasExpenseView()) { // result = this.GetExpenseView().OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_ORSRV_DATACHANGED)); //} this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_ORSRV_DATACHANGED)); break; case EventCodeType.NM_EXPENSE_DATACHANGED: this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EXPENSE_DATACHANGED)); result = true; break; } if (!result) { return(mEeventDelegate.OnChildNotify(sender, e)); } else { return(true); } }
/// <summary> /// 处理内部的通知消息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> public override bool OnChildNotify(object sender, DictionaryEventArgs e) { if (this.ent4BannerDTO == null) { return(base.OnChildNotify(sender, e)); } // 分拣消息通知事件 switch (AssToolEx.EventCodeOfEventArgs(e)) { case EventCodeType.NM_ORDI_EDIT: OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_ORDI_EDIT)); return(true); case EventCodeType.NM_EMS_ORSRV_SELECTCHANGED: return(GetEmsView().OnEventHandle(sender, e)); case EventCodeType.NM_UIMSG_LAYOUTCHANGED: GetEmsView().AdjustLayout(); return(true); case EventCodeType.EVENT_EMS_REFRESH: OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_REFRESH)); return(true); case EventCodeType.EVENT_EMS_ORSRV_HP_DATACHANGED: EmsHpDataChangedForMappingExpensView(sender, e); break; case EventCodeType.NM_EMS_REFRESULT: GetEmsView().OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_REFRESULT)); break; } return(base.OnChildNotify(sender, e)); }
public bool OnEventHandle(object sender, xap.rui.engine.DictionaryEventArgs e) { bool result = false; switch (AssToolEx.EventCodeOfEventArgs(e)) { case EventCodeType.EVENT_EMS_ORDER_EDIT: GetEmsView().OnEventHandle(sender, e); this.XTabPages[0].HasError = GetEmsView().HasErrors(); if (this.HasExpenseView()) { this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); } break; // 处理删除医疗单消息 case EventCodeType.EVENT_EMS_DELETE: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } result = GetEmsView().OnEventHandle(sender, e); this.XTabPages[0].HasError = GetEmsView().HasErrors(); if (this.HasExpenseView()) { GetExpenseView().SetNeedRefresh(1); } break; // 处理保存医疗单消息 case EventCodeType.EVENT_EXPENSE_SAVE: case EventCodeType.EVENT_EMS_SAVE: //开立医嘱(点击医疗单确认按钮),判断诊断是否为空,诊断是否更改 bool rst = true; if (RelativeUIParam.RELATIVERATIO > RelativeUIParam.TEMPLETECHANGEDRATIO) { var DiListView = this.Context.Config.GetInstance("DiListView") as DiListView; if (null != DiListView) { rst = DiListView.CheckDiEditable(true); } } else { var DiBannerView = this.Context.Config.GetInstance("DiBannerView") as DiBannerView; if (null != DiBannerView) { rst = DiBannerView.CheckDiEditable(); } } if (rst) { if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } result = GetEmsView().OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_SAVE)); } break; // 处理保存医疗单成功时候的消息 case EventCodeType.EVENT_EMS_SAVESUCCESS: result = GetEmsView().OnEventHandle(sender, e); if (this.HasExpenseView()) { GetExpenseView().OnEventHandle(sender, e); } break; // 处理医疗单添加空白行消息 case EventCodeType.EVENT_EMS_APPEND: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } result = GetEmsView().OnEventHandle(sender, e); this.XTabPages[0].HasError = GetEmsView().HasErrors(); // 新增空行,医疗单的数据源内容改变,需要刷新费用页签 if (this.HasExpenseView()) { GetExpenseView().SetNeedRefresh(1); this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); } break; case EventCodeType.EVENT_EMS_ORSRV_DATACHANGED: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } this.XTabPages[0].HasError = GetEmsView().HasErrors(); if (HasExpenseView()) { GetExpenseView().OnEventHandle(sender, e); this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); } // 设置后台重算费用标志 GetEmsView().SetClearFeeSrv(true); // 删除费用项目 GetExpenseDatasource().ToList().ForEach(p => { GetExpenseDatasource().Delete(p, p.IsNEW); }); break; // 处理医疗单添加用血消息 case EventCodeType.EVENT_EMS_APBU_ADD: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } this.XTabPages[0].HasError = GetEmsView().HasErrors(); result = GetEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EXPENSE_ADD: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } if (HasExpenseView()) { GetExpenseView().OnEventHandle(sender, e); this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); } break; case EventCodeType.EVENT_EXPENSE_DELETE: if (GetEmsViewType() == EmsViewType.EmptyEmsViewType) { return(result); } if (HasExpenseView()) { GetExpenseView().OnEventHandle(sender, e); this.XTabPages[1].HasError = GetExpenseView().ExistErrors(); } break; case EventCodeType.EVENT_EXPENSE_DATACHANGED: result = GetEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_CLOSE: GetEmsView().OnEventHandle(sender, e); this.UID = ""; this.XTabPages[0].HasError = false; if (HasExpenseView()) { this.XTabPages[1].HasError = false; GetExpenseView().OnEventHandle(sender, e); } break; default: result = GetEmsView().OnEventHandle(sender, e); break; } return(result); }
/// <summary> /// 处理上层控件发出的消息通知 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> public override bool OnChildNotify(object sender, xap.rui.engine.DictionaryEventArgs e) { bool result = true; // 费用保存消息,需要转发到医疗单容器中进行处理 switch (AssToolEx.EventCodeOfEventArgs(e)) { case EventCodeType.NM_EMS_CREATE: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_CREATE)); break; case EventCodeType.NM_EMS_APPEND: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_APPEND)); break; case EventCodeType.NM_EMS_DELETE: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_DELETE)); break; case EventCodeType.NM_EMS_SAVE: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_SAVE)); break; case EventCodeType.NM_EMS_CLOSE: this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_CLOSE)); break; case EventCodeType.NM_EMS_APBU_ADD: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_APBU_ADD)); break; case EventCodeType.NM_EMS_SAVESUCCESS: this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_SAVESUCCESS)); break; // 费用通知 case EventCodeType.NM_EXPENSE_SAVE: if (!GetSelectedEmsView().GetExpenseView().ExistErrors()) { result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_SAVE)); } else { this.ShowInfo("费用中含有存在必填项目,请填写完整后在保存!"); } break; case EventCodeType.NM_EXPENSE_ADD: result = this.GetSelectedEmsView().OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EXPENSE_ADD)); break; case EventCodeType.NM_EXPENSE_DELETE: result = this.GetSelectedEmsView().OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EXPENSE_DELETE)); break; case EventCodeType.NM_EXPENSE_REFRESH: this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EXPENSE_REFRESH)); break; case EventCodeType.NM_UIMSG_DISABLE_EDIT: this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_DISABLE_EDIT)); break; case EventCodeType.NM_UIMSG_ALLOW_EDIT: this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_ALLOW_EDIT)); break; case EventCodeType.NM_ORDLIST_DELETEORDER: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_ORDLIST_DELETEORDER)); break; case EventCodeType.NM_EMS_SAVE_FOCUS: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_SAVE_FOCUS)); break; case EventCodeType.NM_EMS_CARDFOCUS: result = this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_CARDFOCUS)); break; default: result = false; break; } return(result); }
/// <summary> /// 内部分发事件处理方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> public override bool OnEventHandle(object sender, xap.rui.engine.DictionaryEventArgs e) { bool bRet = true; switch (AssToolEx.EventCodeOfEventArgs(e)) { // 处理删除按钮和签署按钮发出的消息 case EventCodeType.EVENT_ACTION_ORDERDELETE: // UIEvent.DELETE://删除 case EventCodeType.EVENT_ACTION_ORDERSUBMIT: // "CiSubmit"://签署 case EventCodeType.EVENT_ACTION_REVETSUBMIT: if (!IsEmptyEms()) { // this.SentNotify(EventCodeType.NM_EMS_CLOSE); } break; case EventCodeType.EVENT_ACTION_HPTRANSFORMFILE: EventOpenMedReferralHandle(); break; // 切换到分方页签 case EventCodeType.EVENT_ORDLIST_SWITCH2PRESS: //切换到分方页面 case EventCodeType.EVENT_ORDLIST_SWITCH2FEEBILL: if (this.Visible) { orgSize = this.Size; this.Size = new System.Drawing.Size(this.Size.Width, 0); this.Visible = false; } break; // 切换到医嘱页面 case EventCodeType.EVENT_ORDLIST_SWITCH2ORDLIST: //切换到分方页面 if (!this.Visible) { this.Size = orgSize; this.Visible = true; } break; case EventCodeType.EVENT_EMS_TMPL_EDIT: // "ordertemplate": bRet = EventOrderTmplHandle(AssToolEx.ObjectOfEventArgs(e, "order") as MoreEmsParamDTO); break; // 处理创建医疗单消息 case EventCodeType.EVENT_EMS_CREATE: bRet = EventCreateMultiEmsHandle(AssToolEx.ObjectOfEventArgs(e, EmsCreatedParamList.TAGKEY) as EmsCreatedParamList); break; // 处理编辑医嘱消息 case EventCodeType.EVENT_EMS_ORDER_EDIT: // 处理多医疗单编辑逻辑 bRet = EventEditSingleOrderHandle(AssToolEx.ObjectOfEventArgs(e, OrderEditParamList.TAGKEY) as OrderEditParamList); break; // 处理删除医疗单消息 case EventCodeType.EVENT_EMS_DELETE: bRet = this.GetSelectedEmsView().OnEventHandle(sender, e); break; // 处理关闭医疗单消息 case EventCodeType.EVENT_EMS_CLOSE: bRet = this.EventCloseEmsHandle(this.GetSelectedEmsView()); break; // 处理保存医疗单消息 case EventCodeType.EVENT_EMS_SAVE: bRet = this.GetSelectedEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_SAVESUCCESS: this.GetSelectedEmsView().OnEventHandle(sender, e); EventCloseEmsHandle(this.GetSelectedEmsView()); this.buttonGroupView.ShowEmsButtonGroup(this.GetSelectedEmsView().GetEmsViewType(), GetSelectedEmsView().AllowEdit()); GetSelectedEmsView().SetSelectDefault(); break; /*诊断保存成功消息事件*/ case EventCodeType.EVENT_ORDI_SAVESUCCE: case EventCodeType.EVENT_ORDI_CHECK: bRet = this.GetSelectedEmsView().OnEventHandle(sender, e); BaseEmsView.EmptyPatDIInfo = AssToolEx.CheckPatDiInfo(this.ent4BannerDTO); //重置医疗单上下文中的就诊上下文信息 resetCiEnContextDTOFromBaseEmsContext(); break; case EventCodeType.EVENT_EMS_ALLOW_EDIT: this.GetSelectedEmsView().SetEditEnable(true); bRet = buttonGroupView.OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_DISABLE_EDIT: this.GetSelectedEmsView().SetEditEnable(false); bRet = buttonGroupView.OnEventHandle(sender, e); break; case EventCodeType.EVENT_ORDLIST_DELETEORDER: AssToolEx.SentMessage(this, AssToolEx.ResetEventOfEventArgs(e, UIEvent.DELETE)); break; case EventCodeType.EVENT_EMS_ADD: if (!CheckNewEmsView()) { this.OnEventHandle(sender, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_CLOSE)); } break; case EventCodeType.EVENT_EMS_SAVE_FOCUS: bRet = buttonGroupView.OnEventHandle(sender, e); break; //case EventCodeType.EVENT_EMS_CARDFOCUS: // AssToolEx.SentMessage(this, AssToolEx.ResetEventOfEventArgs(e, EventCodeType.EVENT_EMS_CARDFOCUS)); // break; default: bRet = this.GetSelectedEmsView().OnEventHandle(sender, e); break; } return(bRet); }