示例#1
0
        /// <summary>
        /// 业务初始化
        /// </summary>
        public override void Business_Init()
        {
            //获取逝者编号
            AC001 = this.swapdata["parm"].ToString();

            //填充逝者个人信息
            parm1.Value = AC001;
            parm2.Value = AC001;

            reader = SqlAssist.ExecuteReader("select * from v_ac01 where ac001 = :ac001", new OracleParameter[] { parm2 });


            if (!reader.HasRows)
            {
                XtraMessageBox.Show("参数传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            reader.Read();

            txtedit_ac001.EditValue = AC001;
            txtedit_ac003.EditValue = reader["AC003"];              //逝者姓名
            txtedit_ac004.EditValue = reader["AC004"];              //年龄
            rg_ac002.EditValue      = reader["AC002"];              //性别
            txtedit_ac020.EditValue = reader["AC020"];              //到达中心时间
            txtedit_ac050.EditValue = reader["AC050"];              //联系人
            txtedit_ac051.EditValue = reader["AC051"];              //电话
            txtedit_ac052.Text      = reader["AC052"].ToString();   //与逝者关系

            this.Parent.Text = "火化业务办理" + "【" + reader["AC003"] + "】";

            reader.Dispose();

            //读入照片
            if (MiscAction.HasIDC(AC001))
            {
                OracleDataReader photo_reader = SqlAssist.ExecuteReader("select ic020 from ic01 where ic000 = '0' and ac001 ='" + AC001 + "'");
                if (photo_reader.HasRows && photo_reader.Read())
                {
                    MemoryStream ms        = new MemoryStream((byte[])photo_reader["IC020"]); //把照片读到MemoryStream里
                    Image        imageBlob = Image.FromStream(ms, true);                      //用流创建Image
                    pictureEdit1.Image = imageBlob;                                           //输出图片
                }
                photo_reader.Dispose();
            }
            else
            {
                pictureEdit1.Image = null;
            }

            ///刷新销售数据
            this.RefreshSalesData();
        }
示例#2
0
 /// <summary>
 /// 读取身份证
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtedit_ac014_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (!Envior.IDC_Reader_State)
     {
         XtraMessageBox.Show("身份证读卡器未连接!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (action == "edit" && MiscAction.HasIDC(AC001))
     {
         if (XtraMessageBox.Show("是否替换已有的身份证信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
         {
             return;
         }
     }
     try
     {
         int authenticate = CVRSDK.CVR_Authenticate();
         if (authenticate == 1)
         {
             int readContent = CVRSDK.CVR_Read_Content(4);
             if (readContent == 1)
             {
                 FillData();
                 dateEdit_ac010.Focus();
             }
             else
             {
                 XtraMessageBox.Show("读卡失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             XtraMessageBox.Show("未放卡或卡片放置不正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
        /// <summary>
        /// 窗口装入事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Frm_fireCheckin_Load(object sender, EventArgs e)
        {
            //获取传入 数据集
            checkin_ds = this.swapdata["dataset"] as Checkin_ds;
            action     = this.swapdata["action"].ToString();

            if (this.swapdata.ContainsKey("businessObject"))
            {
                businessObject = this.swapdata["businessObject"] as BaseBusiness;
            }

            lookUp_ac005.Properties.DataSource    = checkin_ds.St01_reason;
            lookUp_ac005.Properties.ValueMember   = "ST003";
            lookUp_ac005.Properties.DisplayMember = "ST003";
            checkin_ds.St01_reason.Sort           = "SORTID ASC";

            lookUp_ac052.Properties.DataSource    = checkin_ds.St01_relation;
            lookUp_ac052.Properties.ValueMember   = "ST003";
            lookUp_ac052.Properties.DisplayMember = "ST003";
            checkin_ds.St01_relation.Sort         = "SORTID ASC";

            lookUp_ac060.Properties.DataSource    = checkin_ds.St01_driver;
            lookUp_ac060.Properties.ValueMember   = "ST001";
            lookUp_ac060.Properties.DisplayMember = "ST003";
            checkin_ds.St01_driver.Sort           = "SORTID ASC";

            lookUp_ac007.Properties.DataSource    = checkin_ds.St01_district;
            lookUp_ac007.Properties.ValueMember   = "ST003";
            lookUp_ac007.Properties.DisplayMember = "ST003";
            checkin_ds.St01_district.Sort         = "SORTID ASC";

            lookup_gtype.Properties.DataSource    = checkin_ds.St01_gtype;
            lookup_gtype.Properties.ValueMember   = "ST001";
            lookup_gtype.Properties.DisplayMember = "ST003";
            checkin_ds.St01_gtype.Sort            = "SORTID ASC";

            if (string.Equals(action, "edit"))
            {
                this.Text = "登记修改";
                AC001     = this.swapdata["AC001"].ToString();

                ac01 = ac01_dao.GetSingle(s => s.ac001 == AC001);
                if (ac01 == null)
                {
                    b_ok.Enabled = false;
                    MessageBox.Show("查找数据失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    b_ok.Enabled = false;
                    return;
                }

                txtEdit_ac003.EditValue  = ac01.ac003;
                rg_ac002.EditValue       = ac01.ac002;
                txtEdit_ac004.EditValue  = ac01.ac004;
                txtedit_ac014.EditValue  = ac01.ac014;
                txtEdit_ac009.EditValue  = ac01.ac009;
                dateEdit_ac010.EditValue = ac01.ac010;
                lookUp_ac005.EditValue   = ac01.ac005;
                lookUp_ac060.EditValue   = ac01.ac060;
                lookUp_ac007.EditValue   = ac01.ac007;
                lookup_gtype.EditValue   = ac01.ac300;                  //逝者类型
                txtEdit_ac008.EditValue  = ac01.ac008;

                txtEdit_ac050.EditValue = ac01.ac050;
                txtEdit_ac051.EditValue = ac01.ac051;
                lookUp_ac052.EditValue  = ac01.ac052;

                txtEdit_ac150.EditValue = ac01.ac150;
                txtEdit_ac151.EditValue = ac01.ac151;
                lookUp_ac152.EditValue  = ac01.ac152;

                txtEdit_ac055.EditValue = ac01.ac055;
                mem_ac099.EditValue     = ac01.ac099;
                be_url.Enabled          = false;

                //读入照片
                if (MiscAction.HasIDC(AC001))
                {
                    OracleDataReader photo_reader = SqlAssist.ExecuteReader("select ic020 from ic01 where ic000 = '0' and ac001 ='" + AC001 + "'");
                    if (photo_reader.HasRows && photo_reader.Read())
                    {
                        MemoryStream ms        = new MemoryStream((byte[])photo_reader["IC020"]); //把照片读到MemoryStream里
                        Image        imageBlob = Image.FromStream(ms, true);                      //用流创建Image
                        pictureEdit1.Image = imageBlob;                                           //输出图片
                    }
                    photo_reader.Dispose();
                }
            }
            else
            {
                ac01 = new Ac01();
                if (checkin_ds.St01_gtype.Count > 0)
                {
                    lookup_gtype.EditValue = checkin_ds.St01_gtype.ToTable().Rows[0]["ST001"];
                }
            }
        }