Example #1
0
        private void GetBitmap()
        {
            List <Bitmap> bitmaps = new List <Bitmap>();
            Bitmap        bit1    = new Bitmap(@"E:\一丹EMR文件\一丹图片\传染病.JPG");
            Bitmap        bit2    = new Bitmap(@"E:\一丹EMR文件\一丹图片\登陆后.JPG");
            Bitmap        bit3    = new Bitmap(@"E:\一丹EMR文件\一丹图片\界面.JPG");

            bitmaps.Add(bit1);
            bitmaps.Add(bit2);
            bitmaps.Add(bit3);
            panelContainer.Controls.Clear();
            var           m_iPrintNurse = AbstractorFactry.GetNurseRecord(m_printInCommonView.PrintFileName);
            List <Bitmap> BitmapList    = m_iPrintNurse.GetPreview(m_printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList, m_printInCommonView.PrintInpatientView);

            if (bitmaps == null)
            {
                return;
            }
            for (int i = 0; i < bitmaps.Count; i++)
            {
                PictureBox picImg = new PictureBox();
                picImg.BackgroundImage       = bitmaps[i];
                picImg.Width                 = bitmaps[i].Width;
                picImg.Height                = bitmaps[i].Height;
                picImg.BackgroundImageLayout = ImageLayout.Stretch;
                int x = (panelContainer.Width - picImg.Width) / 2;
                int y = (picImg.Height + 10) * i;
                picImg.Location = new Point(x, y);
                panelContainer.Controls.Add(picImg);
            }
        }
Example #2
0
        private void tabcontrol_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (tabcontrol.SelectedTabPage != tabPagePrint)
            {
                return;
            }
            WaitDialogForm waitDialog = new WaitDialogForm("正在组织打印数据……", "请稍等。");

            try
            {
                PrintInCommonView printInCommonView = ConvertPrintEntity();
                iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                SetWaitDialogCaption("正在绘制预览界面……", waitDialog);
                if (iPrintNurse != null && iPrintNurse.IsCustomPrint == true)
                {
                    tabPagePrint.Controls.Clear();
                    PrintForm1 printForm1 = new PrintForm1(printInCommonView);
                    printForm1.Dock            = DockStyle.Fill;
                    printForm1.TopLevel        = false;
                    printForm1.FormBorderStyle = FormBorderStyle.None;
                    printForm1.Show();
                    tabPagePrint.Controls.Add(printForm1);
                }
                else
                {
                    if (ucPrintRecord == null)
                    {
                        ucPrintRecord = new UCPrintRecord();
                        tabPagePrint.Controls.Add(ucPrintRecord);
                        ucPrintRecord.Dock = DockStyle.Fill;
                    }
                    ucPrintRecord.LoadPrint(printInCommonView);
                }
                waitDialog.Hide();
                waitDialog.Close();
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                YiDanCommon.Ctrs.DLG.YiDanMessageBox.Show(ex.Message);
            }
        }
Example #3
0
        /// <summary>
        /// 将数据对象转诊打印对象 用于绑定到控件进行打印预览
        /// </summary>
        /// <returns></returns>
        private PrintInCommonView ConvertPrintEntity()
        {
            inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
            PrintInCommonView printInCommonView = new CommonNoteUse.PrintInCommonView();

            printInCommonView.PrintFileName = m_inCommonNote.PrinteModelName;
            printInCommonView.RecordName    = m_commonNoteEntity.CommonNoteName;
            //病人的基本信息构造
            if (inCommonNoteBiz == null)
            {
                inCommonNoteBiz = new InCommonNoteBiz(m_app);
            }
            DataTable          inpatientDt        = inCommonNoteBiz.GetInpatient(m_inCommonNote.NoofInpatient);
            PrintInpatientView printInpatientView = new CommonNoteUse.PrintInpatientView();

            printInpatientView.HospitalName    = m_app.CurrentHospitalInfo.Name;
            printInpatientView.SubHospitalName = m_app.CurrentHospitalInfo.Subname;
            printInpatientView.AdmitDiagnosis  = inpatientDt.Rows[0]["DIAGNOSISNAME"].ToString();
            printInpatientView.Depart          = m_inCommonNote.CurrDepartName;
            printInpatientView.InBedNo         = inpatientDt.Rows[0]["OUTBED"].ToString();
            if (inpatientDt.Rows[0]["INWARDDATE"].ToString().Length >= 10)
            {
                printInpatientView.InDateTime = inpatientDt.Rows[0]["INWARDDATE"].ToString().Substring(0, 10);
            }
            printInpatientView.InNo              = inpatientDt.Rows[0]["PATID"].ToString();
            printInpatientView.InpatientAge      = inpatientDt.Rows[0]["AGESTR"].ToString();
            printInpatientView.InpatientName     = m_inCommonNote.InPatientName;
            printInpatientView.Sex               = inpatientDt.Rows[0]["SEX"].ToString();
            printInpatientView.Ward              = m_inCommonNote.CurrWardName;
            printInCommonView.PrintInpatientView = printInpatientView;
            if (m_inCommonNote.InCommonNoteTabList == null)
            {
                return(printInCommonView);
            }
            for (int i = 0; i < m_inCommonNote.InCommonNoteTabList.Count; i++)
            {
                CommonNote_TabEntity commonNote_TabEntity = null;
                foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                {
                    if (itemTab.CommonNote_Tab_Flow == m_inCommonNote.InCommonNoteTabList[i].CommonNote_Tab_Flow)
                    {
                        commonNote_TabEntity = itemTab;
                        break;
                    }
                }
                PrintInCommonTabView printInCommonTabView = new CommonNoteUse.PrintInCommonTabView();  //主要目的是给这个对象复制
                Dictionary <string, List <InCommonNoteItemEntity> > dicitemList;
                List <string> strNames = InCommonNoteBiz.ConvertInCommonTabToPrint(m_inCommonNote.InCommonNoteTabList[i], printInCommonTabView, out dicitemList, commonNote_TabEntity, m_app, m_inCommonNote);

                string proName = "PrintInCommonTabViewList";
                proName = proName + (i + 1);
                PropertyInfo property = printInCommonView.GetType().GetProperty(proName);
                if (property != null)
                {
                    property.SetValue(printInCommonView, printInCommonTabView, null);
                }

                if (i == 0 && m_inCommonNote.InCommonNoteTabList[i] != null)
                {
                    ConverToDuoRow(printInCommonView);
                    //ConvertForDuoLie(printInCommonView);
                    //  ConvertForChangeRow(printInCommonView);
                    IPrintNurse iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                    if (iPrintNurse != null)
                    {
                        printInCommonView.PrintInCommonTabViewList1.PrintInCommonItemViewList = iPrintNurse.JiSuanZongLiang(printInCommonView);
                    }
                    //xll 2013-01-12 处理相同时间数据
                    //ConvertForDateTime(printInCommonView);
                }
            }
            return(printInCommonView);
        }