コード例 #1
0
        public void saveFun()
        {
            File.Delete("printtemp\\xpsShow.xps");

            string[] files = Directory.GetFiles("printTemp");
            for (int i = 0; i < files.Length; i++)
            {
                string path = files[i];
                File.Delete(path);
            }

            frmSelectSave.count = 0;
            IGetReport igp;

            IsHaveReport = false;
            int no = 1;

            string[] idCardsStrings = CardID.Split(';');
            string[] SelectName     = PrintType.Split(';');

            foreach (string idCardNo in idCardsStrings)
            {
                foreach (string name in SelectName)
                {
                    try
                    {
                        switch (name)
                        {
                        case "封面":
                            if (area == "淄博")
                            {
                                igp = new HealthReport();
                            }
                            else
                            {
                                igp = new ArchiveCover();
                            }
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "基本信息":
                            igp = new ArchiveBase();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "健康体检表":
                            igp = new ArchivePhysical();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "高血压随访":
                            igp = new Hypertension_Followup();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "糖尿病随访":
                            igp = new Diabetes_Followup();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "精神病信息补充":
                            igp = new Mentaldisease_Baseinfo();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "精神病随访":
                            igp = new Mentaldisease_Followup();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "居民健康档案卡":
                            igp = new ArchiveCard();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "老年人中医健康(随访)":
                            igp = new Old_Medicine_CN();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "新生儿家庭访视":
                            igp = new Child_With_NEW();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "1岁内儿童健康检查":
                            igp = new Child_With_ONE();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "1-2岁内儿童健康检查":
                            igp = new Child_With_TWO();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "3-6岁内儿童健康检查":
                            igp = new Child_With_THREE();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "第1次产前随访":
                            igp = new GRAVIDA_FRIST();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "第2-5次产前随访":
                            igp = new GRAVIDA_TWO();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "产后访视记录":
                            igp = new GRAVIDA_Postpartum();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "产后42天健康检查":
                            igp = new GRAVIDA_Postpartum42();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "脑卒中随访记录":
                            igp = new Stroke_Followup();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "冠心病随访记录":
                            igp = new CHD_Follow();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "6-18月龄儿童中医健康":
                            igp = new Child_CN_ONE();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "24-36月龄儿童中医健康":
                            igp = new Child_CN_TWO();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "3-6岁内儿童中医健康":
                            igp = new Child_CN_THREE();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "第1次肺结核随访":
                            igp = new LungerFirstVisit();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "肺结核随访":
                            igp = new ChronicLungerVisit();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "健康教育":
                            igp = new HealthEducation();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "接诊记录":
                            igp = new Medical_Receive();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "会诊记录":
                            igp = new Medical_Consulation();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "双向转诊":
                            igp = new Medical_Refferral();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "健康体检反馈单":
                            igp = new HealthFeedback();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "老年人自理能力(体检)":
                            igp = new Physical_OldSelfCare();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "65岁以上老年人健康体检反馈单":
                            if (area.Equals("淄博"))
                            {
                                igp = new OldHealthFeedback();
                            }
                            else if (community.Equals("日照街道社区"))
                            {
                                igp = new OldHealthFeedbackRiZhao();
                            }
                            else
                            {
                                igp = new OldHealthFeedbackYuCheng();
                            }

                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "档案封面":
                            igp = new HealthCoverCard();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "血生化、血常规、尿液数据":
                            igp = new Blood_Urine();
                            this.saveInvoke(igp, idCardNo, no.ToString());
                            break;

                        case "心电打印":
                            string ecgType = DrawItems.GetECGConfig();

                            if (ecgType == "2")
                            {
                                igp        = new ElectroCardioGramcs();
                                igp.CardID = idCardNo;
                                if (!igp.hasData())
                                {
                                    igp = null;
                                }
                                else
                                {
                                    this.saveInvoke(igp, idCardNo, no.ToString());
                                }
                            }
                            break;

                        case "B超打印":
                            igp        = new TypeBchao();
                            igp.CardID = idCardNo;
                            if (!igp.hasData())
                            {
                                igp = null;
                            }
                            else
                            {
                                this.saveInvoke(igp, idCardNo, no.ToString());
                            }
                            break;

                        default:
                            igp = null;
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }

                no++;
            }

            Thread.Sleep(1000);

            if (!IsHaveReport)
            {
                System.Windows.Forms.MessageBox.Show("无打印资料!", "提示",
                                                     System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk,
                                                     System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);

                CloseWin("test");

                return;
            }

            this.setMsg("开始生成合并文档");
            this.MergeInvoke();
            this.CloseWin("test");
        }