/// <summary> /// 编辑单医疗单 /// </summary> /// <param name="emsEditParamList"></param> /// <returns></returns> protected bool EventEditSingleOrderHandle(OrderEditParamList emsEditParamList) { if (emsEditParamList != null && emsEditParamList.Count > 0) { if (CheckNewEmsView()) { return(true); } if (beLoading) { return(true); } OrderEditParameter ordEditParam = emsEditParamList[0]; if (GetSelectedEmsView().UID.Equals(ordEditParam.OrderItem.Id_or)) { return(true); } beLoading = true; bool hasError = false; try { // NAppWaiting.Instance.Show(this); ClearEmsEditorView(); var emsView = GetSelectedEmsView(); emsView.UID = ordEditParam.OrderItem.Id_or; emsView.OnEventHandle(this, AssToolEx.DictionaryEventArgsWith(EventCodeType.EVENT_EMS_ORDER_EDIT, OrderEditParameter.TAGKEY, ordEditParam) ); this.SwitchEmsContainer(this.GetSelectedEmsView()); } catch (XapServiceException e) { this.SetStatusMsg(e.ErrorMsg.Message ?? e.ErrorMsg.data); hasError = true; } catch (Exception e) { this.SetStatusMsg(e.StackTrace); hasError = true; } finally { beLoading = false; // NAppWaiting.Instance.Close(); if (hasError) { EventCloseEmsHandle(null); this.ShowInfo("打开医嘱出现异常情况,请查看日志"); } } } return(true); }
protected bool EventEditMultiEditHandle(OrderEditParamList emsEditParamList) { if (emsEditParamList != null && emsEditParamList.Count > 0) { int nCanOpenNum = 6 - this.multiEmsGroup.ButtonCount; // RemoveAllTabEms(); emsEditParamList.ToList().ForEach(order => { if (!hasOpenedOrderList.Contains(order.OrderItem.Id_or)) { if (nCanOpenNum-- > 0) { var emsView = this.multiEmsGroup.SelectedButton.ValueObj as TabEmsView; if (this.multiEmsGroup.ButtonCount == 1 && emsView.UID == "") { } else { emsView = this.AddTabEmsView(); } emsView.OnEventHandle(this, AssToolEx.DictionaryEventArgsWith(EventCodeType.EVENT_EMS_ORDER_EDIT, OrderEditParameter.TAGKEY, order) ); emsView.UID = order.OrderItem.Id_or; hasOpenedOrderList.Add(emsView.UID); } } }); this.SwitchEmsContainer(this.multiEmsGroup.SelectedButton.ValueObj as TabEmsView); if (null != this.GetSelectedEmsView()) { this.GetSelectedEmsView().SelectedIndex = 0; // 显示医嘱页签 } // 当只有一个医疗单时候,不显示多医疗单按钮 if (this.multiEmsGroup.ButtonCount == 1) { this.multiEmsGroup.SetButtonVisible(0, false); // 0, 第一个,隐藏唯一的一个按钮 } else { this.multiEmsGroup.SetButtonVisible(-1, true); // -1, 全部 } if (emsEditParamList.Count > 6) { this.SetStatusMsg("最多只能同时打开 6 个医疗单"); } } return(true); }