예제 #1
0
        private void personRegist_Load(object sender, EventArgs e)
        {
            this.label1.Text      = "居民健康档案登记";
            this.label1.ForeColor = Color.SkyBlue;
            label1.Font           = new Font("微软雅黑", 20F, System.Drawing.FontStyle.Bold, GraphicsUnit.Point, ((byte)(134)));
            label1.Left           = (this.panel1.Width - this.label1.Width) / 2;
            label1.BringToFront();

            this.label13.Text      = "登记记录";
            this.label13.ForeColor = Color.SkyBlue;
            label13.Font           = new Font("微软雅黑", 20F, System.Drawing.FontStyle.Bold, GraphicsUnit.Point, ((byte)(134)));
            label13.Left           = (this.panel4.Width - this.label13.Width) / 2;
            label13.BringToFront();

            BindNation();
            Common.SetComboBoxInfo(comboBox7, ltdorganizationDao.GetShengInfo());//区域
            DataTable dtbasic = bsdao.checkBasicsettingInfo();

            if (dtbasic.Rows.Count > 0)
            {
                xcuncode  = dtbasic.Rows[0]["cun_code"].ToString();
                shengcode = dtbasic.Rows[0]["sheng_code"].ToString();
                Common.SetComboBoxInfo(comboBox6, ltdorganizationDao.GetCityInfo(shengcode));
                shicode = dtbasic.Rows[0]["shi_code"].ToString();
                Common.SetComboBoxInfo(comboBox3, ltdorganizationDao.GetCountyInfo(shicode));
                qxcode = dtbasic.Rows[0]["qx_code"].ToString();
                Common.SetComboBoxInfo(comboBox4, areadao.zhenInfo(qxcode));
                xzcode = dtbasic.Rows[0]["xz_code"].ToString();
                Common.SetComboBoxInfo(comboBox5, areadao.cunInfo(xzcode));
                //因为名称有可能对应不上那么就用code对应
                Common.SetComboBoxSelectIndex(comboBox7, shengcode);
                Common.SetComboBoxSelectIndex(comboBox6, shicode);
                Common.SetComboBoxSelectIndex(comboBox3, qxcode);
                Common.SetComboBoxSelectIndex(comboBox4, xzcode);
                Common.SetComboBoxSelectIndex(comboBox5, xcuncode);
            }

            label14.Text = DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day.ToString() + "日";
            registrationRecordCheck();//右侧统计信息
            //身份证读卡初始化
            try
            {
                int iPort;
                for (iPort = 1001; iPort <= 1016; iPort++)
                {
                    iRetUSB = CVRSDK.CVR_InitComm(iPort);
                    if (iRetUSB == 1)
                    {
                        break;
                    }
                }
                if (iRetUSB != 1)
                {
                    for (iPort = 1; iPort <= 4; iPort++)
                    {
                        iRetCOM = CVRSDK.CVR_InitComm(iPort);
                        if (iRetCOM == 1)
                        {
                            break;
                        }
                    }
                }

                if ((iRetCOM == 1) || (iRetUSB == 1))
                {
                    this.label42.Text = "初始化成功!";
                    jkjcheckdao.updateShDevice(1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
                }
                else
                {
                    this.label42.Text = "初始化失败!";
                    loginLogBean lb = new loginLogBean();
                    lb.name       = frmLogin.name;
                    lb.createTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    lb.eventInfo  = "身份证读卡初始化失败!";
                    lb.type       = "3";
                    logservice.addCheckLog(lb);
                    jkjcheckdao.updateShDevice(0, -1, -1, -1, -1, -1, -1, -1, -1, -1);
                }
            }
            catch (Exception ex)
            {
                loginLogBean lb = new loginLogBean();
                lb.name       = frmLogin.name;
                lb.createTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                lb.eventInfo  = "身份证读卡初始化失败!";
                lb.type       = "3";
                logservice.addCheckLog(lb);
                jkjcheckdao.updateShDevice(0, -1, -1, -1, -1, -1, -1, -1, -1, -1);
            }

            //摄像头初始化
            try
            {
                // 枚举所有视频输入设备
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (videoDevices.Count == 0)
                {
                    throw new ApplicationException();
                }
                //foreach (FilterInfo device in videoDevices)
                //{
                //    tscbxCameras.Items.Add(device.Name);
                //}
                //tscbxCameras.SelectedIndex = 0;

                VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
                videoSource.DesiredFrameSize   = new System.Drawing.Size(320, 240);
                videoSource.DesiredFrameRate   = 1;
                videoSourcePlayer1.VideoSource = videoSource;
                videoSourcePlayer1.Start();
            }
            catch (ApplicationException)
            {
                videoDevices = null;
                loginLogBean lb = new loginLogBean();
                lb.name       = frmLogin.name;
                lb.createTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                lb.eventInfo  = "摄像头初始化失败!";
                lb.type       = "3";
                logservice.addCheckLog(lb);
                jkjcheckdao.updateShDevice(-1, 0, -1, -1, -1, -1, -1, -1, -1, -1);
            }
            //读取默认的打印条数
            ReadPrintBarCodeNumber();
        }
예제 #2
0
        private void basicInfoSettings_Load(object sender, EventArgs e)
        {
            issave = "0";
            Common.SetComboBoxInfo(comboBox1, ltdorganizationDao.GetShengInfo());
            showCombobox();

            DataTable dtbasic = bsdao.checkBasicsettingInfo();

            if (dtbasic.Rows.Count > 0)
            {
                zeren_doctor   = dtbasic.Rows[0]["zeren_doctor"].ToString();
                zeren_doctorId = dtbasic.Rows[0]["update_user"].ToString();
                organ_name     = dtbasic.Rows[0]["organ_name"].ToString();
                input_name     = dtbasic.Rows[0]["input_name"].ToString();
                createtime     = dtbasic.Rows[0]["create_time"].ToString();
                xcuncode       = dtbasic.Rows[0]["cun_code"].ToString();
                shengcode      = dtbasic.Rows[0]["sheng_code"].ToString();

                Common.SetComboBoxInfo(comboBox2, ltdorganizationDao.GetCityInfo(shengcode));

                shicode = dtbasic.Rows[0]["shi_code"].ToString();

                Common.SetComboBoxInfo(comboBox3, ltdorganizationDao.GetCountyInfo(shicode));

                qxcode = dtbasic.Rows[0]["qx_code"].ToString();
                Common.SetComboBoxInfo(comboBox4, areadao.zhenInfo(qxcode));

                //this.comboBox4.DataSource = areadao.zhenInfo(qxcode);//绑定数据源
                //this.comboBox4.DisplayMember = "name";//显示给用户的数据集表项
                //this.comboBox4.ValueMember = "code";//操作时获取的值

                xzcode = dtbasic.Rows[0]["xz_code"].ToString();
                Common.SetComboBoxInfo(comboBox5, areadao.cunInfo(xzcode));

                //this.comboBox5.DataSource = areadao.cunInfo(xzcode);//绑定数据源
                //this.comboBox5.DisplayMember = "name";//显示给用户的数据集表项
                //this.comboBox5.ValueMember = "code";//操作时获取的值

                allareaname = dtbasic.Rows[0]["allFullName"].ToString();
                bc          = dtbasic.Rows[0]["bc"].ToString();
                xcg         = dtbasic.Rows[0]["xcg"].ToString();
                sh          = dtbasic.Rows[0]["sh"].ToString();
                sgtz        = dtbasic.Rows[0]["sgtz"].ToString();
                ncg         = dtbasic.Rows[0]["ncg"].ToString();
                xdt         = dtbasic.Rows[0]["xdt"].ToString();
                xy          = dtbasic.Rows[0]["xy"].ToString();
                wx          = dtbasic.Rows[0]["wx"].ToString();
                string czy     = dtbasic.Rows[0]["operation"].ToString();
                string carname = dtbasic.Rows[0]["car_name"].ToString();
                string other   = dtbasic.Rows[0]["other"].ToString();
                if (xzcode != null && !"".Equals(xzcode))
                {
                    xzName = bsdao.selectAreaBycode(xzcode).Rows[0][0].ToString();
                }
                if (xcuncode != null && !"".Equals(xcuncode))
                {
                    xcName = bsdao.selectAreaBycode(xcuncode).Rows[0][0].ToString();
                }
                shengName = bsdao.selectAreaBycode(shengcode).Rows[0][0].ToString();
                shiName   = bsdao.selectAreaBycode(shicode).Rows[0][0].ToString();
                qxName    = bsdao.selectAreaBycode(qxcode).Rows[0][0].ToString();
                //因为名称有可能对应不上那么就用code对应
                Common.SetComboBoxSelectIndex(comboBox1, shengcode);
                Common.SetComboBoxSelectIndex(comboBox2, shicode);
                Common.SetComboBoxSelectIndex(comboBox3, qxcode);
                Common.SetComboBoxSelectIndex(comboBox4, xzcode);
                Common.SetComboBoxSelectIndex(comboBox5, xcuncode);

                this.textBox1.Text  = organ_name;
                this.comboBox6.Text = input_name;
                this.comboBox7.Text = zeren_doctor;

                this.comboBox8.Text  = bc;
                this.comboBox9.Text  = xcg;
                this.comboBox10.Text = sh;
                this.comboBox11.Text = sgtz;
                this.comboBox12.Text = ncg;
                this.comboBox13.Text = xdt;
                this.comboBox14.Text = xy;
                this.comboBox16.Text = czy;
                this.comboBox17.Text = carname;

                this.textBox2.Text = other;
                this.textBox3.Text = wx;

                issave = "1";
            }
            //this.comboBox7.DropDownStyle = ComboBoxStyle.DropDownList;
            if (IsInternetAvailable())
            {
                isPaint = true;
                button2_Paint(null, new PaintEventArgs(CreateGraphics(), ClientRectangle));
            }
            else
            {
                isPaint = false;
                button2_Paint(null, new PaintEventArgs(CreateGraphics(), ClientRectangle));
            }
        }