Ejemplo n.º 1
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         MyMsg.MsgInfo(e.Error.Message);
         this.Close();
     }
     else
     {
         Msgvisable(this.lblMsg, false);
         this.DialogResult = DialogResult.OK;
     }
 }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                if (Settings.Default.运行模式 == "RUN" || Settings.Default.运行模式 == "TEST")
                {
                    if (sec == 0)
                    {
                        this.timer1.Stop();
                        this.DialogResult = DialogResult.Cancel;
                    }
                    sec = sec - 1;
                    if (idinfo != null)
                    {
                        FrmMain.userInfo = idinfo;
                        if (FrmMain.userInfo != null)
                        {
                            timer1.Stop();
                            this.DialogResult = DialogResult.OK;
                        }
                    }
                }
                else
                {
                    if (sec == 0)
                    {
                        idinfo      = new IDCardInfo();
                        idinfo.Name = "李某某";

                        idinfo.Address   = "西安";
                        idinfo.Sex       = "男";
                        idinfo.Birthday  = "1983-12-03";
                        idinfo.Signdate  = "2050-01-01";
                        idinfo.Number    = "123456789";
                        idinfo.People    = "汗";
                        idinfo.ValidDate = "2050-01-01";
                        FrmMain.userInfo = idinfo;
                        this.timer1.Stop();
                        this.DialogResult = DialogResult.OK;
                    }
                    sec = sec - 1;
                }
            }
            catch (Exception ex)
            {
                timer1.Stop();
                MyMsg.MsgInfo(ex.Message);
            }
        }
Ejemplo n.º 3
0
        public void OutCardD1000(int sqadd, int blockAddr, IDCardInfo userInfo, decimal sumChargeMoney)
        {
            try
            {
                D1000Card d1000     = new D1000Card();
                string    cardstate = d1000.CheckState();
                if (cardstate != string.Empty)
                {
                    MyMsg.MsgInfo(cardstate);
                    return;
                }

                if (d1000.sendcmd("DC") == false)
                {
                    MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请通过补办卡重新发卡!");
                    return;
                }


                string CardNo = string.Empty;
                //FrmInCardUniversalSend fi = new FrmInCardUniversalSend();
                //if (fi.ShowDialog() == DialogResult.OK)
                //{
                //    CardNo = FrmMain.cardInfoStruct.CardNo;
                //    SkyComm skyComm = new SkyComm();
                //    skyComm.CreatCard(CardNo, FrmMain.userInfo.Name, FrmMain.userInfo.Number, FrmMain.userInfo.Address, sumChargeMoney);


                //    //bool isSuccess = true;
                MyMsg.MsgInfo("办卡成功!");
                //}
                //else
                //{
                //    MyMsg.MsgInfo("发卡失败!请重试自助发卡!");
                //    return;
                //}
            }
            catch (Exception err)
            {
                //k101.MoveCard("回收卡片");
                MyMsg.MsgInfo("吐卡失败!请重试自助发卡!" + err.Message);
                //this.eLCardAuthorizationData.Clear();
            }
        }
Ejemplo n.º 4
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         if (e.Error.Message != "异常卡片!")
         {
             MyMsg.MsgInfo(e.Error.Message);
         }
         this.Close();
     }
     else
     {
         LableText(this.labMoney, FrmMain.cardBlance.ToString("0.00"));
         LableVisable(this.labMoney, true);
         LableText(this.label2, FrmMain.parInfo.Tables[0].Rows[0]["姓名"].ToString());
         LableVisable(this.label2, true);
         LableVisable(this.label1, true);
         LableVisable(this.label3, true);
         PictureBoxVisable(this.pictureBox1, true);
         PictureBoxVisable(this.p2M, true);
     }
 }
Ejemplo n.º 5
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                if (e.Error.Message != "异常卡片!")
                {
                    MyMsg.MsgInfo(e.Error.Message);
                }
                this.Close();
            }
            else
            {
                LableText(this.label5, FrmMain.parInfo.Tables[0].Rows[0]["姓名"].ToString());
                LableText(this.label7, FrmMain.cardInfoStruct.CardNo);

                PictureBoxVisable(this.pictureBox1, true);
                LableVisable(this.label5, true);
                LableVisable(this.label6, true);
                LableVisable(this.label7, true);

                PictureBoxVisable(this.pGH, true);
            }
        }
        private void FrmCardConsumeDetail_Load(object sender, EventArgs e)
        {
            lbXm.Text = FrmMain.parInfo.Tables[0].Rows[0]["姓名"].ToString();
            lbKh.Text = FrmMain.parInfo.Tables[0].Rows[0]["卡号"].ToString();
            lbYe.Text = FrmMain.parInfo.Tables[0].Rows[0]["卡余额"].ToString();

            try
            {
                DataSet dsConsumeDetail = new DataSet();
                if (Settings.Default.运行模式 == "RUN")
                {
                    LogService.GlobalInfoMessage("查询消费记录");
                    SkyComm skyComm = new SkyComm();
                    dsConsumeDetail = skyComm.QueryCardConsumeInfo(FrmMain.cardInfoStruct.CardNo, DateTime.Now.AddMonths(month * -1));

                    if (dsConsumeDetail.Tables.Count > 0 && dsConsumeDetail.Tables[0].Rows.Count > 0)
                    {
                        lbZHF.Text = Convert.ToDecimal(dsConsumeDetail.Tables[0].Compute("SUM(金额)", "")).ToString("0.00");
                    }
                    else
                    {
                        lbZHF.Text = "0.00";
                    }
                }
                else
                {
                    DataTable  dt = new DataTable();
                    DataColumn dc = new DataColumn();
                    dc.ColumnName = "卡号";
                    dc.DataType   = typeof(System.String);
                    dt.Columns.Add(dc);

                    dc            = new DataColumn();
                    dc.ColumnName = "收费项目名称";
                    dc.DataType   = typeof(System.String);
                    dt.Columns.Add(dc);

                    dc            = new DataColumn();
                    dc.ColumnName = "单价";
                    dc.DataType   = typeof(System.Decimal);
                    dt.Columns.Add(dc);

                    dc            = new DataColumn();
                    dc.ColumnName = "数量";
                    dc.DataType   = typeof(System.Decimal);
                    dt.Columns.Add(dc);

                    dc            = new DataColumn();
                    dc.ColumnName = "金额";
                    dc.DataType   = typeof(System.Decimal);
                    dt.Columns.Add(dc);

                    dc            = new DataColumn();
                    dc.ColumnName = "消费日期";
                    dc.DataType   = typeof(System.DateTime);
                    dt.Columns.Add(dc);

                    DataRow drNew = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = "西药费";
                    drNew["单价"]     = 10;
                    drNew["数量"]     = 10;
                    drNew["金额"]     = 100;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-06-01");
                    dt.Rows.Add(drNew);

                    drNew           = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = "中成药";
                    drNew["单价"]     = 5;
                    drNew["数量"]     = 10;
                    drNew["金额"]     = 50;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-06-2");
                    dt.Rows.Add(drNew);

                    drNew           = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = " CT费";
                    drNew["单价"]     = 500;
                    drNew["数量"]     = 1;
                    drNew["金额"]     = 500;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-05-1");
                    dt.Rows.Add(drNew);

                    drNew           = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = "血常规";
                    drNew["单价"]     = 20;
                    drNew["数量"]     = 1;
                    drNew["金额"]     = 20;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-05-2");
                    dt.Rows.Add(drNew);

                    drNew           = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = " 核磁共振";
                    drNew["单价"]     = 500;
                    drNew["数量"]     = 1;
                    drNew["金额"]     = 500;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-04-1");
                    dt.Rows.Add(drNew);

                    drNew           = dt.NewRow();
                    drNew["卡号"]     = FrmMain.cardInfoStruct.CardNo;
                    drNew["收费项目名称"] = "手术费";
                    drNew["单价"]     = 1000;
                    drNew["数量"]     = 1;
                    drNew["金额"]     = 1000;
                    drNew["消费日期"]   = Convert.ToDateTime("2013-04-2");
                    dt.Rows.Add(drNew);
                    dsConsumeDetail.Tables.Add(dt);
                }

                DataView dv = dsConsumeDetail.Tables[0].DefaultView;
                //dv.RowFilter = "消费日期 >= '" + DateTime.Now.AddMonths(month * -1).ToString("yyyy-MM-dd HH:mm:ss") + "'";
                gridControl1.DataSource = dv;
            }
            catch (Exception err)
            {
                MyMsg.MsgInfo(err.Message);
            }
        }
Ejemplo n.º 7
0
 private void readIDCrad_OnReadError(object sender, ReadErrorEventArgs e)
 {
     MyMsg.MsgInfo(e.Error);
     this.DialogResult = DialogResult.Cancel;
 }
Ejemplo n.º 8
0
        public int OutCard(int sqadd, int blockAddr, IDCardInfo userInfo, decimal sumChargeMoney)
        {
            try
            {
                if (k101.CheckCardPosition() == false)
                {
                    MyMsg.MsgInfo("卡机状态不正确,不能继续发卡,请联系管理员!");
                    return(-1);
                }

                //   //吐出卡片
                //k101.MoveCard("传动到前端夹卡位");
                //MyMsg.MsgInfo("发卡成功!");
                //return;

                string cardTemp = string.Empty;
                string cardType = Settings.Default.卡类型;

                if (cardType == "磁条卡")
                {
                    k101.MoveCard("移动到读磁卡位");
                    if (k101.MoveCard("移动到读磁卡位") == false)
                    {
                        k101.MoveCard("回收卡片");
                        MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请联系管理员!");
                        return(-1);
                    }

                    cardTemp = k101.ReadCard();
                    if (cardTemp == string.Empty)
                    {
                        k101.MoveCard("回收卡片");
                        MyMsg.MsgInfo("磁卡数据错误,或是空卡,不能继续发卡,请联系管理员!");
                        return(-1);
                    }

                    FrmMain.cardInfoStruct.CardNo = cardTemp;
                }

                string CardNo = cardTemp;

                if (Settings.Default.运行模式 == "RUN")
                {
                    LogService.GlobalInfoMessage("调用发卡存储过程");
                    SkyComm skyComm = new SkyComm();
                    skyComm.CreatCard(CardNo, FrmMain.userInfo.Name, FrmMain.userInfo.Sex, Convert.ToDateTime(FrmMain.userInfo.Birthday), FrmMain.userInfo.Number, FrmMain.userInfo.Address, FrmMain.userInfo.People);
                    LogService.GlobalInfoMessage("调用发卡存储过程成功");
                }

                bool isSuccess = true;
                if (cardType == "IC卡")
                {
                    LogService.GlobalInfoMessage("传动到IC卡位");
                    k101.MoveCard("传动到IC卡位");
                    if (k101.MoveCard("传动到IC卡位") == false)
                    {
                        LogService.GlobalInfoMessage("回收卡片");
                        k101.MoveCard("回收卡片");
                        MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请通过补办卡重新发卡!");
                        return(-1);
                    }

                    //写卡,如果失败则重试
                    int state = -1;
                    while (0 != state)
                    {
                        LogService.GlobalInfoMessage("写卡");
                        state = k101.WriteCard(CardNo);
                        LogService.GlobalInfoMessage("写卡完成");
                        if (state != 0)
                        {
                            MyAlert my = new MyAlert();
                            my.Msg       = "写卡失败,是否重试?";
                            my.alerttype = "确认取消";
                            if (my.ShowDialog() == DialogResult.OK)
                            {
                                state = -1;
                            }
                            else
                            {
                                state = 0;
                            }
                            isSuccess = false;
                        }
                        else
                        {
                            isSuccess = true;
                        }
                    }
                }

                if (!string.IsNullOrEmpty(cardTemp))
                {
                    if (isSuccess == true)
                    {
                        LogService.GlobalInfoMessage("传动到前端夹卡位");
                        //吐出卡片
                        if (k101.MoveCard("传动到前端夹卡位") == false)
                        {
                            LogService.GlobalInfoMessage("吐卡失败!请通过补办卡重新发卡!");
                            MyMsg.MsgInfo("吐卡失败!请通过补办卡重新发卡!");
                            isSuccess = false;
                            return(-1);
                        }
                        else
                        {
                            LogService.GlobalInfoMessage("发卡成功");
                            isSuccess = true;
                            MyMsg.MsgInfo("发卡成功!");
                        }
                    }

                    if (isSuccess == false)
                    {
                        LogService.GlobalInfoMessage("回收卡片");
                        k101.MoveCard("回收卡片");
                        MyMsg.MsgInfo("写卡失败,请通过补办卡重新发卡!");
                        return(-1);
                    }
                }
                return(0);
            }
            catch (Exception err)
            {
                LogService.GlobalInfoMessage("吐卡失败!请重试自助发卡!" + err.Message);
                k101.MoveCard("回收卡片");
                MyMsg.MsgInfo("吐卡失败!请重试自助发卡!" + err.Message);
                return(-1);
            }
        }