Пример #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Button     btnShow = (Button)sender;
            string     btnName = btnShow.Name;
            IGetReport igp;
            string     path = "printtemp\\" + DateTime.Now.ToString("yyyyMMddHHmmss") + "\\";

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            string[] idCardStrings = IDCard.Split(';');

            if (idCardStrings.Length > 1)
            {
                try
                {
                    frmShowBatch frm = new frmShowBatch();
                    frm.CardID    = IDCard;
                    frm.PrintType = btnName;
                    frm.Path      = path;
                    frm.ShowDialog();
                    if (!frm.IsHaveReport)
                    {
                        return;
                    }

                    frmPrint frmShow = new frmPrint();
                    frmShow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    frmShow.WindowState           = WindowState.Maximized;
                    frmShow.DocName = path + "xpsShow.xps";
                    frmShow.ShowDialog();
                }
                catch (Exception d)
                {
                    MessageBox.Show(d.ToString());
                }
            }
            else
            {
                switch (btnName)
                {
                case "btnFengmian":
                    if (area == "淄博")
                    {
                        igp = new HealthReport();
                    }
                    else
                    {
                        igp = new ArchiveCover();
                    }
                    break;

                case "btnBaseInfo":
                    igp = new ArchiveBase();
                    break;

                case "btnHyper":
                    igp = new Hypertension_Followup();
                    break;

                case "btnDiabetes":
                    igp = new Diabetes_Followup();
                    break;

                case "btnMentaldisease_Baseinfo":
                    igp = new Mentaldisease_Baseinfo();
                    break;

                case "btnMentalFollow":
                    igp = new Mentaldisease_Followup();
                    break;

                case "btnPhysical":
                    igp = new ArchivePhysical();
                    break;

                case "btnArchiveCard":
                    igp = new ArchiveCard();
                    break;

                case "btnChildInOne":
                    igp = new Child_With_ONE();
                    break;

                case "btnChildNEW":
                    igp = new Child_With_NEW();
                    break;

                case "btnChildTWO":
                    igp = new Child_With_TWO();
                    break;

                case "btnChildTHREE":
                    igp = new Child_With_THREE();
                    break;

                case "btnGRAVIDA_FRIST":
                    igp = new GRAVIDA_FRIST();
                    break;

                case "btnGRAVIDA_TWO":
                    igp = new GRAVIDA_TWO();
                    break;

                case "btnGRAVIDA_POST":
                    igp = new GRAVIDA_Postpartum();
                    break;

                case "btnGRAVIDA_POST42":
                    igp = new GRAVIDA_Postpartum42();
                    break;

                case "btnOLDMEDICINECN":
                    igp = new Old_Medicine_CN();
                    break;

                case "btnChildCNOne":
                    igp = new Child_CN_ONE();
                    break;

                case "btnChildCNOne2Three":
                    igp = new Child_CN_TWO();
                    break;

                //case "btnChildCNThree2Six":
                //    igp = new Child_CN_THREE();
                //    break;
                case "btnChd":
                    igp = new CHD_Follow();
                    break;

                case "btStroke":
                    igp = new Stroke_Followup();
                    break;

                case "btnOnePTBVisit":
                    igp = new LungerFirstVisit();
                    break;

                case "btnPTBVisit":
                    igp = new ChronicLungerVisit();
                    break;

                case "btnHealth":
                    igp = new HealthEducation();
                    //igp = new HealthExamination();
                    break;

                case "btnMReceiveTreat":
                    igp = new Medical_Receive();
                    break;

                case "btnMConsulation":
                    igp = new Medical_Consulation();
                    break;

                case "btnMReferral":
                    igp = new Medical_Refferral();
                    break;

                case "btnHealthFeedback":
                    igp = new HealthFeedback();
                    break;

                case "btnPhyOLDSelf":
                    igp = new Physical_OldSelfCare();
                    break;

                //case "btnPhyMedicine":
                //    igp = new Physical_MedicineCN();
                //    break;
                case "btnOldHealthFeedback":
                    if (area.Equals("淄博"))
                    {
                        igp = new OldHealthFeedback();
                    }
                    else if (community.Equals("日照街道社区"))
                    {
                        igp = new OldHealthFeedbackRiZhao();
                    }
                    else
                    {
                        igp = new OldHealthFeedbackYuCheng();
                    }
                    break;

                case "btnCoverCard":
                    igp = new HealthCoverCard();
                    break;

                case "btnBloodUrine":
                    igp = new Blood_Urine();
                    break;

                case "btnCoverCard_2":
                    igp = new HealthCoverCard_Colour();
                    break;

                case "btnECG":
                    string ecgType = DrawItems.GetECGConfig();

                    if (ecgType == "2")
                    {
                        igp        = new ElectroCardioGramcs();
                        igp.CardID = IDCard;

                        if (!igp.hasData())
                        {
                            igp = null;
                        }
                    }
                    else
                    {
                        igp = null;
                    }
                    break;

                case "btnTypeBUI":
                    igp        = new TypeBchao();
                    igp.CardID = IDCard;

                    if (!igp.hasData())
                    {
                        igp = null;
                    }
                    break;

                case "btnPhyicalRe":
                    igp = new PhyicalReport();
                    break;

                case "btnOldCover":
                    igp = new OldHealthReport();
                    break;

                default:
                    igp = null;
                    break;
                }

                if (igp == null)
                {
                    MessageBox.Show("无打印资料!");
                    return;
                }

                igp.CardID    = IDCard;
                igp.BaseModel = new RecordsBaseInfoBLL().GetModel(IDCard);

                if (igp.BaseModel == null)
                {
                    MessageBox.Show("无此人个人档案,身份证号:" + IDCard);
                    return;
                }

                try
                {
                    frmPrint frm = new frmPrint();
                    FixedDocumentSequence fsq = igp.getReport();

                    if (!DrawItems.SaveReport(path + igp.PrintName, fsq))
                    {
                        MessageBox.Show("打印文件正在被占用,请稍后重试");
                    }
                    else
                    {
                        frm.DocName = path + igp.PrintName;
                        frm.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                        frm.WindowState           = WindowState.Maximized;
                        frm.ShowDialog();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Пример #2
0
        public void saveFun()
        {
            //if (File.Exists("printtemp\\xpsShow.xps"))
            //{
            //    File.Delete("printtemp\\xpsShow.xps");
            //}

            //foreach (string strFile in Directory.GetFiles("printTemp"))
            //{
            //    File.Delete(strFile);
            //}

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

            count        = 0;
            IsHaveReport = false;

            IGetReport igp;

            //int i = 0;
            //int n = 0;

            foreach (string idCardNo in idCardsStrings)
            {
                //n ++;

                //if (n != idCardsStrings.Length)
                //{
                //    if (PrintType == "btnOLDMEDICINECN")
                //    {
                //        RecordsCustomerBaseInfoModel modelc = new RecordsCustomerBaseInfoDAL().GetMaxModel(idCardNo);
                //        if (modelc == null )
                //        {
                //            continue;
                //        }
                //        RecordsMediPhysDistModel modelMdist = new RecordsMediPhysDistDAL().GetModelByOutKey(modelc.ID);
                //        if (modelMdist != null)
                //        {
                //            RecordsMedicineCnModel model2 = new RecordsMedicineCnBLL().GetModel(modelMdist.MedicineID);

                //            if (model2 == null || model2.FollowUpDoctor == "")
                //            {
                //                continue;
                //            }
                //        }
                //    }
                //}
                //else
                //{
                //    if (i != 0)
                //    {
                //        if (PrintType == "btnOLDMEDICINECN")
                //        {
                //            RecordsCustomerBaseInfoModel modelc = new RecordsCustomerBaseInfoDAL().GetMaxModel(idCardNo);
                //            if (modelc == null)
                //            {
                //                continue;
                //            }
                //            RecordsMediPhysDistModel modelMdist = new RecordsMediPhysDistDAL().GetModelByOutKey(modelc.ID);
                //            if (modelMdist != null)
                //            {
                //                RecordsMedicineCnModel model2 = new RecordsMedicineCnBLL().GetModel(modelMdist.MedicineID);

                //                if (model2 == null || model2.FollowUpDoctor == "")
                //                {
                //                    continue;
                //                }
                //            }
                //        }
                //    }
                //}

                //i++;

                switch (PrintType)
                {
                case "btnFengmian":
                    if (area == "淄博")
                    {
                        igp = new HealthReport();
                        saveInvoke(igp, idCardNo);
                    }
                    else
                    {
                        igp = new ArchiveCover();
                        saveInvoke(igp, idCardNo);
                    }
                    break;

                case "btnBaseInfo":
                    igp = new ArchiveBase();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnHyper":
                    igp = new Hypertension_Followup();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnDiabetes":
                    igp = new Diabetes_Followup();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnMentaldisease_Baseinfo":
                    igp = new Mentaldisease_Baseinfo();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnMentalFollow":
                    igp = new Mentaldisease_Followup();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnPhysical":
                    igp = new ArchivePhysical();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnArchiveCard":
                    igp = new ArchiveCard();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildInOne":
                    igp = new Child_With_ONE();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildNEW":
                    igp = new Child_With_NEW();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildTWO":
                    igp = new Child_With_TWO();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildTHREE":
                    igp = new Child_With_THREE();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnGRAVIDA_FRIST":
                    igp = new GRAVIDA_FRIST();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnGRAVIDA_TWO":
                    igp = new GRAVIDA_TWO();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnGRAVIDA_POST":
                    igp = new GRAVIDA_Postpartum();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnGRAVIDA_POST42":
                    igp = new GRAVIDA_Postpartum42();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnOLDMEDICINECN":

                    igp = new Old_Medicine_CN();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildCNOne":
                    igp = new Child_CN_ONE();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnChildCNOne2Three":
                    igp = new Child_CN_TWO();
                    saveInvoke(igp, idCardNo);
                    break;

                //case "btnChildCNThree2Six":
                //    igp = new Child_CN_THREE();
                //    saveInvoke(igp, idCardNo);
                //    break;
                case "btnChd":
                    igp = new CHD_Follow();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btStroke":
                    igp = new Stroke_Followup();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnOnePTBVisit":
                    igp = new LungerFirstVisit();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnPTBVisit":
                    igp = new ChronicLungerVisit();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnHealth":
                    igp = new HealthEducation();
                    //igp = new HealthExamination();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnHealthFeedback":
                    igp = new HealthFeedback();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnMReceiveTreat":
                    igp = new Medical_Receive();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnMConsulation":
                    igp = new Medical_Consulation();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnMReferral":
                    igp = new Medical_Refferral();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnPhyOLDSelf":
                    igp = new Physical_OldSelfCare();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnOldHealthFeedback":
                    if (area.Equals("淄博"))
                    {
                        igp = new OldHealthFeedback();
                    }
                    else if (community.Equals("日照街道社区"))
                    {
                        igp = new OldHealthFeedbackRiZhao();
                    }
                    else
                    {
                        igp = new OldHealthFeedbackYuCheng();
                    }
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnCoverCard":
                    igp = new HealthCoverCard();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnBloodUrine":
                    igp = new Blood_Urine();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnCoverCard_2":
                    igp = new HealthCoverCard_Colour();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnECG":
                    string ecgType = DrawItems.GetECGConfig();

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

                case "btnTypeBUI":
                    igp        = new TypeBchao();
                    igp.CardID = idCardNo;
                    if (!igp.hasData())
                    {
                        igp = null;
                    }
                    else
                    {
                        this.saveInvoke(igp, idCardNo);
                    }
                    break;

                case "btnPhyicalRe":
                    igp = new PhyicalReport();
                    saveInvoke(igp, idCardNo);
                    break;

                case "btnOldCover":
                    igp = new OldHealthReport();
                    saveInvoke(igp, idCardNo);
                    break;

                default:
                    igp = null;
                    break;
                }
            }

            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;
            }

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