コード例 #1
0
        public void Reload()
        {
            IMedreferralCrudService service = XapServiceMgr.find <IMedreferralCrudService>();

            if (service != null && this.GetEnt4BannerDTO() != null)
            {
                MedReferralDO[] szMedReferralDO = service.find(" id_ent='" + this.GetEnt4BannerDTO().Id_ent + "'", "sv desc", false);
                if (szMedReferralDO != null)
                {
                    if (szMedReferralDO.Length > 0)
                    {
                        this.logicEx.CopyTo <MedReferralDO>(szMedReferralDO[0], medReferralDO);
                    }
                    else
                    {
                        FromEnt4BannerDTO(this.GetEnt4BannerDTO());
                    }
                }
            }
        }
コード例 #2
0
        public override void HandleState(object sender, DictionaryEventArgs e)
        {
            IMedreferralCrudService service = XapServiceMgr.find <IMedreferralCrudService>();
            String eventCode = AssToolEx.EventCodeOfEventArgs(e);

            if (eventCode.Equals("MedReferralSaveAction"))
            {
                if (ViewModel.MedReferralDO.Dt_referralperiodbegin > ViewModel.MedReferralDO.Dt_referralperiodend)
                {
                    EventDelegate.ShowInfo(OrdParam.MESSAGE_TIEMCHECK);
                    return;
                }

                if ((ViewModel.MedReferralDO.Str_name_di != null && ViewModel.MedReferralDO.Str_name_di.Length > 300) ||
                    (ViewModel.MedReferralDO.Reason_referral != null && ViewModel.MedReferralDO.Reason_referral.Length > 300) ||
                    (ViewModel.MedReferralDO.Des_initialdiag != null && ViewModel.MedReferralDO.Des_initialdiag.Length > 300) ||
                    (ViewModel.MedReferralDO.Des_question != null && ViewModel.MedReferralDO.Des_question.Length > 300) ||
                    (ViewModel.MedReferralDO.Diagtreatment != null && ViewModel.MedReferralDO.Diagtreatment.Length > 300))
                {
                    EventDelegate.ShowInfo("填写内容超长!");
                    return;
                }

                if (String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Str_name_di) ||
                    String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Reason_referral) ||
                    String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Name_org_referral2))
                {
                    EventDelegate.ShowInfo("请填写必填项!");
                    return;
                }

                dataSource = service.save(new MedReferralDO[] { ViewModel.GetFormDataSource() as MedReferralDO })[0];
                if (null != dataSource)
                {
                    LogicEx.GetInstance().CopyTo <MedReferralDO>(dataSource, ViewModel.MedReferralDO);
                    EventDelegate.SetStatusMsg("医保转诊单保存成功。");
                }
                else
                {
                    EventDelegate.ShowInfo("医保转诊单保存失败。");
                }
            }
            else if (eventCode.Equals("MedReferralPrintAction"))
            {
                if (ViewModel.MedReferralDO == null || ViewModel.MedReferralDO.Id_medreferral == null)
                {
                    return;
                }
                bool   res     = false;
                string strFile = "iih_report/461010_menzhenyishengzhan/YBZZD.xml";

                Dictionary <string, string> qryParams = new Dictionary <string, string>();
                qryParams.Add("$id_medreferral", ViewModel.MedReferralDO.Id_medreferral);

                res = this.rpt_viewer.PrintRptFile(strFile, qryParams, true);

                if (res)
                {
                    ViewModel.MedReferralDO.Times_print += 1;
                    ViewModel.MedReferralDO.Status       = DOStatus.UPDATED;
                    dataSource = service.save(new MedReferralDO[] { ViewModel.MedReferralDO })[0];
                    eventPrint(null, null);
                }
            }
        }