예제 #1
0
        protected override void OnXapFormControl_RefResult(object sender, RefResultEventArgs e)
        {
            if (e.BindingFieldName.Equals("Name_srv"))
            {
                var orDrug = e.DataObject as EmsOrDrug;
                if (string.IsNullOrEmpty(orDrug.Id_srv))
                {
                    this.SetStatusMsg("提示:参照操作过快,不能正常查询数据");
                    return;
                }


                Ent4BannerDTO            patDo = this.GetViewModel().GetEnt4BannerDTO();
                List <MedicalSharingDTO> infoMedicalSharing = null;
                //医保共享验证
                CiEnContextDTO ciEnContextDto = CiEnContextUtil.GetCiEnContext(patDo, EmsAppModeEnum.SVEMSAPPMODE, this.Context);//诊断是否保外的
                if (patDo != null && ciEnContextDto != null && ciEnContextDto.Eu_hpbeyond == HpBeyondEnum.HPDIAG && !EnDictCodeConst.SD_ENTP_EMERGENCY.Equals(patDo.Code_entp) && patDo.No_hp != null && patDo.Sd_hptp != null && patDo.Sd_hptp.StartsWith("1"))
                {
                    MedicalSharingDTO[] arrMedicalSharingDtos = new MedicalSharingDTO[1];
                    MedicalSharingDTO   medicalSharing        = new MedicalSharingDTO();
                    medicalSharing.Code      = orDrug.Code_hpsrvorca;
                    medicalSharing.Name_srv  = orDrug.Name_srv;
                    medicalSharing.Sd_srvtp  = orDrug.Sd_srvtp;
                    arrMedicalSharingDtos[0] = medicalSharing;
                    infoMedicalSharing       = MedicalSharingDateRule.MedicalSharingValidate(this.Context, arrMedicalSharingDtos, patDo);
                }
                if (infoMedicalSharing != null && infoMedicalSharing.Count > 0)
                {   //弹出医保共享信息
                    using (MedicalSharingInfoForm from = new MedicalSharingInfoForm(infoMedicalSharing))
                    {
                        if (from.ShowDialog() == DialogResult.OK)
                        {
                            orDrug.Fg_selfpay = FBoolean.True;
                            AsynchronousHandle(orDrug);
                        }
                        else
                        {
                            GetLogicEx().clearEmsOrDrugPropety(orDrug);
                            LoadData();
                        }
                    }
                }
                else
                {
                    AsynchronousHandle(orDrug);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 引用参照结果处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnXapFormControl_RefResult(object sender, RefResultEventArgs e)
        {
            RefDataCollection data = e.RefResultSet;
            var drug = e.DataObject as EmsOrDrug;

            if (!this.GetViewModel().IsEmpty() && this.GetViewModel().OnRefResultData(e.BindingFieldName, drug))
            {
                this.updateCustomerControlInfo(this.GetGridControl().GetFocusedRow(), drug);
                this.SentNotify(EventCodeType.NM_EMS_ORSRV_DATACHANGED);
                return;
            }
            // 判断是否清空参照数据,则执行清空医疗单数据操作
            if (e.BindingFieldName.Equals("Name_srv"))
            {
                // 如果清空了参照服务内容
                if (data.IsEmpty && (this.GetViewModel().IsEmpty() || this.GetViewModel().GetCountWithOutDelete() <= 1))
                {
                    // 新建 或者 存储模型的id_or为空,则直接关闭
                    var emsUIDTO = this.GetViewModel().GetEmsUIDTO() as EmsUIDTO;
                    if (null == emsUIDTO || emsUIDTO.IsNEW || String.IsNullOrEmpty(this.GetViewModel().getCiEmsDTO().Id_or))
                    {
                        SentNotify(EventCodeType.NM_EMS_CLOSE);
                    }
                    return;
                }

                if (string.IsNullOrEmpty(drug.Id_srv))
                {
                    this.UnRegFormEvent_DataChanged();
                    string id_orsrv = drug.Id_orsrv;
                    GetLogicEx().Clear <EmsOrDrug>(drug, new String[] { "Status" });
                    drug.Id_orsrv = id_orsrv;

                    this.RegFormEvent_DataChanged();
                    return;
                }

                // 获取 BDSrvDO 数据
                //var service = XapServiceMgr.find<IMedsrvMDOCrudService>();
                //var medSrvDO = service.findById((e.DataObject as EmsOrDrug).Id_srv);

                var orDrug = e.DataObject as EmsOrDrug;
                //Ent4BannerDTO patDo = this.Context["banner"] as Ent4BannerDTO;
                Ent4BannerDTO            patDo = this.GetViewModel().GetEnt4BannerDTO();
                List <MedicalSharingDTO> infoMedicalSharing = null;
                CiEnContextDTO           ciEnContextDto     = CiEnContextUtil.GetCiEnContext(patDo, EmsAppModeEnum.SVEMSAPPMODE, this.Context);//诊断是否保外的
                if (patDo != null && ciEnContextDto != null && ciEnContextDto.Eu_hpbeyond == HpBeyondEnum.HPDIAG && !EnDictCodeConst.SD_ENTP_EMERGENCY.Equals(patDo.Code_entp) && patDo.No_hp != null && patDo.Sd_hptp != null && patDo.Sd_hptp.StartsWith("1"))
                {
                    MedicalSharingDTO[] arrMedicalSharingDtos = new MedicalSharingDTO[1];
                    MedicalSharingDTO   medicalSharing        = new MedicalSharingDTO();
                    medicalSharing.Code      = orDrug.Code_hpsrvorca;
                    medicalSharing.Name_srv  = orDrug.Name_srv;
                    medicalSharing.Sd_srvtp  = orDrug.Sd_srvtp;
                    arrMedicalSharingDtos[0] = medicalSharing;
                    infoMedicalSharing       = MedicalSharingDateRule.MedicalSharingValidate(this.Context, arrMedicalSharingDtos, patDo);
                }
                if (infoMedicalSharing != null && infoMedicalSharing.Count > 0)
                {   //弹出医保共享信息
                    using (MedicalSharingInfoForm from = new MedicalSharingInfoForm(infoMedicalSharing))
                    {
                        if (from.ShowDialog() == DialogResult.OK)
                        {
                            orDrug.Fg_selfpay = FBoolean.True;
                            AsynchronousHandle(orDrug);
                        }
                        else
                        {
                            GetLogicEx().clearEmsOrDrugPropety(orDrug);
                        }
                    }
                }
                else
                {
                    // 异步调用
                    //delegateRunnable.DelayCall(AsynchronousHandle, orDrug);
                    AsynchronousHandle(orDrug);
                }
            }
            else
            {
                this.SentNotify(EventCodeType.NM_EMS_ORSRV_DATACHANGED, e.BindingFieldName, "Name_freq");
            }
        }