Example #1
0
        private void ReLocationEditButton()
        {
            DataHelper  help   = new DataHelper();
            string      cansee = help.GetConfigValueByKey("EmrInputConfig");
            XmlDocument doc1   = new XmlDocument();

            doc1.LoadXml(cansee);
            int    m_AnOtherHeight = 0;
            string changeHeight    = doc1.GetElementsByTagName("IemPageContorlVisable")[0].InnerText;//可见诊断符合的一些栏位


            simpleButton1.Visible  = false;
            simpleButton1.Height   = Convert.ToInt32(percentHeight1 * GetPageHeight());
            simpleButton1.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y);

            if (changeHeight == "1")
            {
                simpleButton2.Height   = 389;
                simpleButton2.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height);
            }
            else
            {
                simpleButton2.Height   = Convert.ToInt32(percentHeight2 * GetPageHeight());
                simpleButton2.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height);
            }

            if (changeHeight == "1")
            {
                //simpleButton3.Height = 634;
                simpleButton3.Height   = Convert.ToInt32(GetPageHeight() - simpleButton2.Height);
                simpleButton3.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height + simpleButton2.Height);
            }
            else
            {
                simpleButton3.Height   = Convert.ToInt32(percentHeight3 * GetPageHeight());
                simpleButton3.Location = new Point(pictureBox1.Location.X - simpleButton1.Width, pictureBox1.Location.Y + simpleButton1.Height + simpleButton2.Height);
            }

            if (changeHeight == "1")
            {
                simpleButton4.Height   = 214;
                simpleButton4.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y);
            }
            else
            {
                simpleButton4.Height   = Convert.ToInt32(percentHeight4 * GetPageHeight());
                simpleButton4.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y);
            }

            if (info.IemObstetricsBaby != null)
            {
                //simpleButton5.Visible = true;
                if (changeHeight == "1")//可见修改,修改病案管理阅览时的BUG  edit by ywk  2013年3月16日10:29:01
                {
                    //simpleButton5.Visible = true;
                    simpleButton5.Height = 144;
                }
                else
                {
                    simpleButton5.Height = Convert.ToInt32(percentHeight5 * GetPageHeight());
                }
                simpleButton5.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height);

                //simpleButton6.Height = Convert.ToInt32(percentHeight6 * GetPageHeight());
                simpleButton6.Height   = Convert.ToInt32(GetPageHeight() - simpleButton4.Height - simpleButton5.Height);
                simpleButton6.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height + simpleButton5.Height);
            }
            else
            {
                simpleButton5.Visible  = false;
                simpleButton6.Height   = Convert.ToInt32(GetPageHeight() - simpleButton4.Height);
                simpleButton6.Location = new Point(pictureBox2.Location.X - simpleButton1.Width, pictureBox2.Location.Y + simpleButton4.Height);
            }
        }
Example #2
0
        private void LoadForm()
        {
            if (manger == null)
            {
                manger = new IemMainPageManger(m_Host, CurrentInpatient);
            }
            info = manger.GetIemInfo();
            DeleteMetaFile();
            util = new DrawMainPageUtil(info);

            pictureBox1.Width  = GetPageWidth();
            pictureBox1.Height = GetPageHeight();
            pictureBox2.Width  = GetPageWidth();
            pictureBox2.Height = GetPageHeight();

            pictureBox1.BackgroundImage = util.MF1;
            pictureBox2.BackgroundImage = util.MF2;

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

            ReLocationPicture();
            BindParentFormCloseEvent();

            if (this.Parent != null)
            {
                if (this.Parent.AccessibleName != null &&
                    this.Parent.AccessibleName.Trim() != "")   //父窗体的AccessibleName不为空则表示没有编辑的权限
                {
                    simpleButton1.Visible = false;
                    simpleButton2.Visible = false;
                    simpleButton3.Visible = false;
                    simpleButton4.Visible = false;
                    simpleButton5.Visible = false;
                    simpleButton6.Visible = false;
                }
            }

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

            emp.ReInitializeProperties();
            DataHelper help    = new DataHelper();
            string     hoscode = help.GetConfigValueByKey("HosCode");

            if (hoscode == "1")
            {
                string static_save = help.GetStatic_SaveValue(info.IemBasicInfo.NoOfInpat);
                if (static_save == "1")
                {
                    simpleButton1.Enabled = false;
                    simpleButton2.Enabled = false;
                    simpleButton3.Enabled = false;
                    simpleButton4.Enabled = false;
                    simpleButton5.Enabled = false;
                    simpleButton6.Enabled = false;
                }
            }
            if (emp.Grade.Trim() != "")
            {
                DoctorGrade grade = (DoctorGrade)Enum.Parse(typeof(DoctorGrade), emp.Grade);
                if (grade == DoctorGrade.Nurse)
                {
                    simpleButton3.Enabled = false;
                    simpleButton4.Enabled = false;
                    simpleButton5.Enabled = false;
                    simpleButton6.Enabled = false;
                }
            }
            else
            {
                simpleButton1.Enabled = false;
                simpleButton2.Enabled = false;
                simpleButton3.Enabled = false;
                simpleButton4.Enabled = false;
                simpleButton5.Enabled = false;
                simpleButton6.Enabled = false;
            }
        }