Esempio n. 1
0
        void lblcauhinh_click(object sender, EventArgs e)
        {
            frmManHinhLCD_thongso fr = new frmManHinhLCD_thongso();

            fr.ShowDialog();
            //frmManHinhLCD_Load(null, null);
        }
Esempio n. 2
0
        private void frmManHinhLCD_Load(object sender, EventArgs e)
        {
            this.Controls.Clear();
            _ts = new frmManHinhLCD_thongso();
            _ts.frmManHinhLCD_thongso_Load(null, null);

            //this.Location = new Point(10, 10);
            this.Location = new Point(int.Parse(_ts.ToaDo_X.ToString()), int.Parse(_ts.ToaDo_Y.ToString()));
            this.Width    = int.Parse(_ts.ChieuRong.ToString());
            this.Height   = int.Parse(_ts.ChieuCao.ToString());

            lblkethuc.Visible     = false;
            lblkethuc.AutoSize    = true;
            lblkethuc.Text        = "Tắt màn hình";
            lblkethuc.Font        = new Font("Arial", 18, FontStyle.Bold);
            lblkethuc.ForeColor   = Color.Red;
            lblkethuc.Location    = new Point(0, 0);
            lblkethuc.Click      += new EventHandler(lblketthuc_click);
            lblkethuc.MouseEnter += new EventHandler(lblkethuc_MouseEnter);
            lblkethuc.MouseLeave += new EventHandler(lblkethuc_MouseLeave);
            lblkethuc.Cursor      = Cursors.Hand;

            lblcauhinh.Visible     = false;
            lblcauhinh.AutoSize    = true;
            lblcauhinh.Text        = "Thông số LCD";
            lblcauhinh.Font        = new Font("Arial", 18, FontStyle.Bold);
            lblcauhinh.ForeColor   = Color.Yellow;
            lblcauhinh.Location    = new Point(0, lblkethuc.Height + lblkethuc.Location.Y);
            lblcauhinh.Click      += new EventHandler(lblcauhinh_click);
            lblcauhinh.MouseEnter += new EventHandler(lblcauhinh_MouseEnter);
            lblcauhinh.MouseLeave += new EventHandler(lblcauhinh_MouseLeave);
            lblcauhinh.Cursor      = Cursors.Hand;

            pnltieude.MouseMove += new MouseEventHandler(pnl_MouseMove);

            this.Controls.Add(lblkethuc);
            this.Controls.Add(lblcauhinh);
            this.Controls.Add(pnltieude);
            this.Controls.Add(pnl1);
            this.Controls.Add(pnl2);
            this.Controls.Add(pnl3);
            HienThi(LoadData());
        }
Esempio n. 3
0
        public void frmManHinhLCD_Load(object sender, System.EventArgs e)
        {
            _ts = new frmManHinhLCD_thongso();
            _ts.bCauHinhTheoDSBN = true;
            _ts.frmManHinhLCD_thongso_Load(null, null);

            this.Controls.Add(_lblhoten);
            this.Controls.Add(_lblstt);
            dtPathImage = new DataTable();
            dtPathImage.Columns.Add("ten");
            //ds.WriteXml("dstam.xml",XmlWriteMode.WriteSchema);
            try
            {
                DataRow  dr;
                string   stam = "";
                string[] arr  = System.IO.Directory.GetFiles("ImageLCD");
                for (int i = 0; i < arr.Length; i++)
                {
                    stam = arr[i].Split('\\')[arr[i].Split('\\').Length - 1];
                    if (stam.IndexOf(".jpeg") > -1 || stam.IndexOf(".jpg") > -1 || stam.IndexOf(".gif") > -1)
                    {
                        dr    = dtPathImage.NewRow();
                        dr[0] = arr[i];
                        dtPathImage.Rows.Add(dr);
                    }
                }
            }
            catch { System.IO.Directory.CreateDirectory("ImageLCD"); }

            try
            {
                this.Location = new Point(int.Parse(_ts.ToaDo_X.ToString())
                                          , int.Parse(_ts.ToaDo_Y.ToString()));
                this.Width  = int.Parse(_ts.ChieuRong.ToString());
                this.Height = int.Parse(_ts.ChieuCao.ToString());
            }
            catch {}
            timer1.Interval = 5000;
            UpdateStateForm(0);
        }
Esempio n. 4
0
        private void frmLCD_laocai_Load(object sender, EventArgs e)
        {
            _frmthongso = new frmManHinhLCD_thongso();
            _frmthongso.bCauHinhTheoDSBN = true;
            _frmthongso.frmManHinhLCD_thongso_Load(null, null);

            this.FormBorderStyle = FormBorderStyle.None;
            this.Location        = new Point(int.Parse(_frmthongso.ToaDo_X.ToString())
                                             , int.Parse(_frmthongso.ToaDo_Y.ToString()));
            this.Height = int.Parse(_frmthongso.ChieuCao.ToString());
            this.Width  = int.Parse(_frmthongso.ChieuRong.ToString());

            #region đọc file hình ảnh
            dtPathImage = new DataTable();
            dtPathImage.Columns.Add("ten");
            //ds.WriteXml("dstam.xml",XmlWriteMode.WriteSchema);
            try
            {
                DataRow  dr;
                string   stam = "";
                string[] arr  = System.IO.Directory.GetFiles("ImageLCD");
                for (int i = 0; i < arr.Length; i++)
                {
                    stam = arr[i].Split('\\')[arr[i].Split('\\').Length - 1];
                    if (stam.IndexOf(".jpeg") > -1 || stam.IndexOf(".jpg") > -1 || stam.IndexOf(".gif") > -1)
                    {
                        dr    = dtPathImage.NewRow();
                        dr[0] = arr[i];
                        dtPathImage.Rows.Add(dr);
                    }
                }
            }
            catch { System.IO.Directory.CreateDirectory("ImageLCD"); }
            try
            {
                this.BackgroundImage = Image.FromFile(dtPathImage.Rows[0][0].ToString());
            }
            catch { }
            #endregion
            #region đọc thông số LCD
            DataSet dstam = new DataSet();
            try
            {
                dstam.ReadXml("..\\..\\..\\xml\\ThongSoManHinhLCD.xml");
                try
                {
                    dstam.Tables[0].Columns.Add("PhongKham_size");
                    dstam.Tables[0].Columns["PhongKham_size"].SetOrdinal(9);
                    dstam.Tables[0].Rows[0]["PhongKham_size"] = 20;
                }
                catch
                {
                }
                try
                {
                    dstam.Tables[0].Columns.Add("TenBacSi_vitri_x");
                    dstam.Tables[0].Columns.Add("TenBacSi_vitri_y");
                    dstam.Tables[0].Columns.Add("TenBacSi_size");

                    dstam.Tables[0].Rows[0]["TenBacSi_vitri_x"] = 100;
                    dstam.Tables[0].Rows[0]["TenBacSi_vitri_y"] = 20;
                    dstam.Tables[0].Rows[0]["TenBacSi_size"]    = 0;
                }
                catch { }
            }
            catch
            {
                dstam = new DataSet();
                dstam.Tables.Add();
                dstam.Tables[0].Columns.Add("STT_size");
                dstam.Tables[0].Columns.Add("STT_vitri_x");
                dstam.Tables[0].Columns.Add("STT_vitri_y");
                dstam.Tables[0].Columns.Add("DangKham_vitri_x");
                dstam.Tables[0].Columns.Add("DangKham_vitri_y");
                dstam.Tables[0].Columns.Add("DangCho_vitri_x");
                dstam.Tables[0].Columns.Add("DangCho_vitri_y");
                dstam.Tables[0].Columns.Add("PhongKham_vitri_x");
                dstam.Tables[0].Columns.Add("PhongKham_vitri_y");
                dstam.Tables[0].Columns.Add("PhongKham_size");
                dstam.Tables[0].Columns.Add("TenBN_size");
                //dstam.Tables[0].Columns.Add("DSBN_chieucao");
                dstam.Tables[0].Columns.Add("DSBN_vitri_x");
                dstam.Tables[0].Columns.Add("DSBN_vitri_y_bd");
                dstam.Tables[0].Columns.Add("GhiChu");
                dstam.Tables[0].Columns.Add("GhiChu_size");
                dstam.Tables[0].Columns.Add("TenBacSi_vitri_x");
                dstam.Tables[0].Columns.Add("TenBacSi_vitri_y");
                dstam.Tables[0].Columns.Add("TenBacSi_size");
                DataRow dr = dstam.Tables[0].NewRow();
                //stt
                dr[0] = "150"; dr[1] = "100"; dr[2] = "100";
                //
                //Dang Kham
                dr[3] = "220"; dr[4] = "35";
                //
                //Dang Cho Kham
                dr[5] = "800"; dr[6] = "35";
                //
                //Phong Kham
                dr[7] = "500"; dr[8] = "570"; dr[9] = "20";
                //
                //Kich thuoc ten benh nhan
                dr[10] = "20";
                //
                //Kich thuoc danh sach benh nhan
                //dr[10] = "420";
                dr[11] = "750"; dr[12] = "80";
                //
                //Ghi chú
                dr[13] = "Địa chỉ: đường Chiềng On, P. Bình Minh, TP Lào Cai | Điện Thoại: 020 38….. | Fax: 020 38….. | mail: [email protected] | Website: www.bvdktinhlaocai.vn";
                dr[14] = "15";
                //
                //Tên bác sĩ
                dr[15] = "100";
                dr[16] = "20";
                dr[17] = "0";
                //
                dstam.Tables[0].Rows.Add(dr);
            }
            dstam.WriteXml("..\\..\\..\\xml\\ThongSoManHinhLCD.xml");
            //stt
            _sts_STT_size    = dstam.Tables[0].Rows[0][0].ToString();
            _sts_STT_vitri_x = dstam.Tables[0].Rows[0][1].ToString();
            _sts_STT_vitri_y = dstam.Tables[0].Rows[0][2].ToString();
            //
            //Dang Kham
            _sts_DangKham_vitri_x = dstam.Tables[0].Rows[0][3].ToString();
            _sts_DangKham_vitri_y = dstam.Tables[0].Rows[0][4].ToString();
            //
            //Dang Cho Kham
            _sts_DangCho_vitri_x = dstam.Tables[0].Rows[0][5].ToString();
            _sts_DangCho_vitri_y = dstam.Tables[0].Rows[0][6].ToString();;
            //
            //Phong Kham
            _sts_PhongKham_vitri_x = dstam.Tables[0].Rows[0][7].ToString();
            _sts_PhongKham_vitri_y = dstam.Tables[0].Rows[0][8].ToString();
            _sts_PhongKham_size    = dstam.Tables[0].Rows[0][9].ToString();
            //
            //Kich thuoc ten benh nhan
            _sts_TenBN_size = dstam.Tables[0].Rows[0][10].ToString();
            //
            //Kich thuoc danh sach benh nhan
            //_sts_DSBN_chieucao = dstam.Tables[0].Rows[0][10].ToString();
            _sts_DSBN_vitri_x    = dstam.Tables[0].Rows[0][11].ToString();
            _sts_DSBN_vitri_y_bd = dstam.Tables[0].Rows[0][12].ToString();
            //
            //Ghi chú
            _sts_GhiChu      = dstam.Tables[0].Rows[0][13].ToString();
            _sts_GhiChu_size = dstam.Tables[0].Rows[0][14].ToString();
            //
            //Tên bác sĩ
            _sts_TenBacSi_vitri_x = dstam.Tables[0].Rows[0][15].ToString();
            _sts_TenBacSi_vitri_y = dstam.Tables[0].Rows[0][16].ToString();
            _sts_TenBacSi_size    = dstam.Tables[0].Rows[0][17].ToString();
            //
            #endregion
            #region define button ket thuc
            this.Controls.Add(_lblketthuc);

            _lblketthuc.AutoSize    = true;
            _lblketthuc.Text        = "Tắt màn hình";
            _lblketthuc.Font        = new Font("Arial", 16);
            _lblketthuc.ForeColor   = Color.Red;
            _lblketthuc.Location    = new Point(0, 0);
            _lblketthuc.Click      += new EventHandler(_lblketthuc_click);
            _lblketthuc.MouseEnter += new EventHandler(lbltat_MouseEnter);
            _lblketthuc.MouseLeave += new EventHandler(lbltat_MouseLeave);
            _lblketthuc.Cursor      = Cursors.Hand;
            _lblketthuc.Visible     = false;
            #endregion

            _ipost_cur = 500;
            this.Controls.Add(_lbltam);
            _lbltam.Visible  = false;
            _lbltam.Location = new Point(0, _ipost_cur);
            _lbltam.Font     = new Font("Arial", float.Parse(_frmthongso.DanhSach_cochu.ToString()), FontStyle.Bold);
            _lbltam.Text     = "aa";
            _lbltam.AutoSize = true;

            this.Controls.Add(_lblhoten);
            this.Controls.Add(_lblstt);

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            //setTable();
            //HienThi(_dtDanhSach, "", "", "");


            //_time.Tick += new EventHandler(time_tick);
            //_time.Interval = 10;
            //_time.Start();
            IsClose = false;
        }