public void SetBindSource(object obj)
        {
            if (obj is ModelTets)
            {
                m_object = (ModelTets)obj;
            }

            if (m_object.pscope.Length > 0)
            {
                Label lab = new Label();
                lab.Font     = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lab.AutoSize = true;
                lab.Text     = m_object.pscope;

                Graphics g          = lab.CreateGraphics();
                SizeF    StrSize    = g.MeasureString(lab.Text, lab.Font);
                int      widthValue = (int)StrSize.Width;

                lab.Font     = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lab.Location = new Point(this.panel1.Width / 2 - widthValue / 2, 10);

                if (widthValue > 150)
                {
                    lab.Location = new Point(0, 0);
                    lab.AutoSize = false;
                    lab.Dock     = DockStyle.Fill;
                }
                this.panel1.Controls.Add(lab);
            }
        }
 public void SetBindSource(object obj)
 {
     if (obj is ModelTets)
     {
         m_object = (ModelTets)obj;
     }
     HomeFormTemp       = (HomeForm)m_object.HomeFormTemp;
     UserSelectFormTemp = (UserSelectForm)m_object.UserSelectFormTemp;
     eDZ   = (EDZ)m_object.edzTemp;
     model = (CheckoutModel)m_object.checkoutModel;
 }
Example #3
0
        public HistoryForm(CheckoutModel checkoutModel, ModelTets modelTetsTemp)
        {
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.model     = checkoutModel;
            this.modelTets = modelTetsTemp;

            InitializeComponent();

            Timer = new System.Windows.Forms.Timer()
            {
                Interval = 100
            };
            Timer.Tick  += new EventHandler(Timer_Tick);
            base.Opacity = 0;
            Timer.Start();
        }
Example #4
0
        public void BindingUserInfoData(object sender, EventArgs e)
        {
            List <DataGridViewColumnEntity> lstCulumns = new List <DataGridViewColumnEntity>();
            MyEventArgsUserInfoData         myEventArgsUserInfoData = e as MyEventArgsUserInfoData;
            List <CheckDataListModel>       dt = myEventArgsUserInfoData.data;

            int columnsWidth = this.ucDataGridView1.Width - 700;

            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "Id", HeadText = "NO", Width = 50, WidthType = SizeType.Absolute
            });
            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "propName", HeadText = "检测项", Width = 150, WidthType = SizeType.Absolute
            });

            //lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "propvalue", HeadText = "检测结果", Width = columnsWidth, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "propValue", HeadText = "检测结果", Width = columnsWidth, WidthType = SizeType.Absolute, CustomCellType = typeof(UCTestGridTable_CustomCellA), TextAlign = ContentAlignment.BottomCenter
            });

            //lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "pscope", HeadText = "参考范围", Width = 150, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "pscope", HeadText = "参考范围", Width = 150, WidthType = SizeType.Absolute, CustomCellType = typeof(UCTestGridTable_CustomCellAA), TextAlign = ContentAlignment.BottomCenter
            });

            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "endTime", HeadText = "检测时间", Width = 200, WidthType = SizeType.Absolute
            });
            lstCulumns.Add(new DataGridViewColumnEntity()
            {
                DataField = "operation", HeadText = "操作", Width = 100, WidthType = SizeType.Absolute, CustomCellType = typeof(UCTestGridTable_CustomCell), TextAlign = ContentAlignment.BottomCenter
            });
            //lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Birthday", HeadText = "生日", Width = 500, WidthType = SizeType.Absolute, Format = (a) => { return ((DateTime)a).ToString("yyyy-MM-dd"); } });
            //lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Sex", HeadText = "性别", Width = 500, WidthType = SizeType.Absolute, Format = (a) => { return ((int)a) == 0 ? "女" : "男"; } });
            this.ucDataGridView1.Columns        = lstCulumns;
            this.ucDataGridView1.IsShowCheckBox = false;

            List <object> lstSource = new List <object>();

            for (int i = 0; i < dt.Count; i++)
            {
                ModelTets model = new ModelTets()
                {
                    Id                 = i + 1,
                    propID             = dt[i].propID,
                    propValue          = dt[i].propValue + dt[i].punit,
                    pscope             = dt[i].pscope,
                    endTime            = dt[i].endTime,
                    propName           = dt[i].propName,
                    highLowMark        = dt[i].highLowMark,
                    HomeFormTemp       = myEventArgsUserInfoData.HomeFormTemp,
                    UserSelectFormTemp = myEventArgsUserInfoData.UserSelectFormTemp,
                    edzTemp            = myEventArgsUserInfoData.eDZ,
                    ReadIdCardFrmTemp  = myEventArgsUserInfoData.ReadIdCardFrmTemp,
                    checkoutModel      = myEventArgsUserInfoData.checkoutModel,
                    cellWidth          = columnsWidth,
                };
                lstSource.Add(model);
            }

            this.ucDataGridView1.DataSource = lstSource;
        }
        public void SetBindSource(object obj)
        {
            if (obj is ModelTets)
            {
                m_object = (ModelTets)obj;
            }

            if (m_object.propName == "中医体质辨识")
            {
                if (m_object.propValue.Trim().Length > 0)
                {
                    string[] strList = m_object.propValue.Split(';');
                    if (strList.Length > 0)
                    {
                        int width = m_object.cellWidth / strList.Length;
                        for (int i = 0; i < strList.Length; i++)
                        {
                            Label lab = new Label();
                            lab.Text     = strList[i];
                            lab.Size     = lab.Size = new System.Drawing.Size(width, 25);
                            lab.Location = new System.Drawing.Point(width * i, 10);
                            lab.Font     = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                            this.Controls.Add(lab);
                            lab.Click      += new EventHandler(CustomBtn_Click);
                            lab.MouseEnter += lbl_MouseEnter;
                            lab.MouseLeave += lbl_MouseLeave;
                        }
                    }
                }
            }
            else
            {
                Label lab = new Label();
                lab.Font     = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lab.AutoSize = true;
                lab.Text     = m_object.propValue;

                Graphics g          = lab.CreateGraphics();
                SizeF    StrSize    = g.MeasureString(lab.Text, lab.Font);
                int      widthValue = (int)StrSize.Width;

                lab.Location = new System.Drawing.Point(m_object.cellWidth / 2 - widthValue / 2, 10);
                this.Controls.Add(lab);


                //@ApiModelProperty("检测值与正常值标识,0为不标,-1为低,1为高")
                //private String highLowMark;
                if (m_object.highLowMark != 0)
                {
                    PictureBox pictureBox = new PictureBox();
                    if (m_object.highLowMark == 1)
                    {
                        pictureBox.Image = global::IDCardClieck.Properties.Resources.arrow_red_up_24px_5308_easyicon_net;
                    }
                    if (m_object.highLowMark == -1)
                    {
                        pictureBox.Image = global::IDCardClieck.Properties.Resources.arrow_down_download_24px_4297_easyicon_net;
                    }
                    pictureBox.Name     = "pictureBox1";
                    pictureBox.Size     = new System.Drawing.Size(10, 30);
                    pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                    pictureBox.TabStop  = false;
                    pictureBox.Location = new System.Drawing.Point(lab.Location.X + lab.Width + 10, 5);
                    this.Controls.Add(pictureBox);
                }
            }
        }