Beispiel #1
0
        private void LoadPrint()
        {
            try
            {
                SaveFileDialog file = new SaveFileDialog();
                file.InitialDirectory = "D:\\";
                file.Filter           = "Pdf Files(*.pdf)|*.pdf";
                file.FileName         = "病案首页";
                if (file.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    WaitDialogForm m_WaitDialog = new WaitDialogForm("正在导出PDF文件...", "请稍后");
                    Document       doc          = new Document();
                    PdfWriter.GetInstance(doc, new FileStream(file.FileName, FileMode.OpenOrCreate));
                    doc.Open();

                    List <Bitmap> bitmapList = util.GetPrintImage();
                    foreach (var item in bitmapList)
                    {
                        iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(item, BaseColor.WHITE);
                        image.Alignment = iTextSharp.text.Image.MIDDLE_ALIGN;
                        image.ScalePercent(70);
                        doc.Add(image);
                    }
                    doc.Close();
                    m_WaitDialog.Close();
                    m_WaitDialog.Dispose();
                    MessageBox.Show("导出成功!");
                }
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Beispiel #2
0
        private void LoadForm()
        {
            util = new DrawMainPageUtil(info);

            pictureBox1.Width  = GetPageWidth();
            pictureBox1.Height = GetPageHeight();
            pictureBox2.Width  = GetPageWidth();
            pictureBox2.Height = GetPageHeight();
            ma = util.GetPrintImage();
            pictureBox1.BackgroundImage = ma[0];
            pictureBox2.BackgroundImage = ma[1];

            pictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
            pictureBox2.BackgroundImageLayout = ImageLayout.Stretch;

            ReLocationPicture();

            if (this.Parent != null)
            {
                if (this.Parent.AccessibleName != null &&
                    this.Parent.AccessibleName.Trim() != "")   //父窗体的AccessibleName不为空则表示没有编辑的权限
                {
                    btnBaseInfo.Visible   = false;
                    btnDialogInfo.Visible = false;
                    btnOperInfo.Visible   = false;
                    btnFeeInfo.Visible    = false;
                    btnExcInfo.Visible    = false;
                }
            }

            Employee emp = new Employee(m_Host.User.Id);

            emp.ReInitializeProperties();
            if (emp.Grade.Trim() != "")
            {
                DoctorGrade grade = (DoctorGrade)Enum.Parse(typeof(DoctorGrade), emp.Grade);
                if (grade == DoctorGrade.Nurse)
                {
                    btnDialogInfo.Enabled = false;
                    btnOperInfo.Enabled   = false;
                    btnFeeInfo.Enabled    = false;
                    btnExcInfo.Enabled    = false;
                }
            }
            else
            {
                btnBaseInfo.Enabled   = false;
                btnDialogInfo.Enabled = false;
                btnOperInfo.Enabled   = false;
                btnFeeInfo.Enabled    = false;
                btnExcInfo.Enabled    = false;
            }
        }
Beispiel #3
0
        private void LoadForm2()
        {
            manger                      = new IemMainPageManger(m_Host, CurrentInpatient);
            util                        = new DrawMainPageUtil(info);
            ma                          = util.GetPrintImage();
            pictureBox1.Width           = GetPageWidth();
            pictureBox1.Height          = GetPageHeight();
            pictureBox2.Width           = GetPageWidth();
            pictureBox2.Height          = GetPageHeight();
            pictureBox1.BackgroundImage = ma[0];
            pictureBox2.BackgroundImage = ma[1];

            ReLocationPicture();
        }