Ejemplo n.º 1
0
        /// <summary>
        /// 扫卡
        /// </summary>
        public void HandleCardMessage(Device.CardReader device, string cardId)
        {
            if (string.IsNullOrEmpty(curData.NoticeBillId))
            {
                MessageBox.Show(string.Format("请先添加车辆消息"));
                return;
            }
            QC_IC_Info card = QC_IC_Info.FindByCardId(cardId);

            if (card == null)
            {
                Tb_IC ic = Tb_IC.GetByICNo(cardId);
                if (ic != null)
                {
                    MessageBox.Show(string.Format("此卡为车辆卡"));
                    return;
                }
                else
                {
                    MessageBox.Show(string.Format("此卡没有注册"));
                    return;
                }
            }
            if (card.CardType != QC_IC_Info.CardUseType_Mix)
            {
                MessageBox.Show("卡的类型不对");
                return;
            }
            if (card.SampleId > 0)
            {
                MessageBox.Show("此卡正在使用");
                return;
            }
            if (!string.IsNullOrEmpty(curData.CardID))
            {
                MessageBox.Show("已关联磁卡");
                return;
            }
            if (curData.WLLX == "精粉" && card.RegUser != "陈至立")
            {
                MessageBox.Show("精粉取样,需要刷黄扣");

                return;
            }
            if (curData.WLLX == "煤" && card.RegUser != "赵贺朝")
            {
                MessageBox.Show("煤取样,需要刷红扣");

                return;
            }
            curData.FangTong_User = LocalInfo.Current.user.ID;
            curData.FangTong_Time = DateTime.Now;
            curData.CardID        = cardId;
            curData.SaveIcInfo    = true;
            curData.IcInfo        = card;
            btnUnBindCard.Visible = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 处理读卡
        /// </summary>
        public void HandleCardMessage(Device.CardReader device, string cardId)
        {
            QC_IC_Info card = QC_IC_Info.FindByCardId(cardId);

            if (card == null)
            {
                Tb_IC ic = Tb_IC.GetByICNo(cardId);
                if (ic != null)
                {
                    MessageBox.Show(string.Format("此卡为车辆卡"));
                    return;
                }
                else
                {
                    MessageBox.Show(string.Format("此卡没有注册"));
                    return;
                }
            }
            if (card.CardType != QC_IC_Info.CardUseType_Veh)
            {
                MessageBox.Show("卡的类型不对");
                return;
            }
            if (card.SampleId > 0)
            {
                MessageBox.Show("此卡正在使用");
                return;
            }
            foreach (var item in currentData.VehSamples)
            {
                if (item.CardID == cardId)
                {
                    MessageBox.Show("此卡已关联" + item.TempID + "号");
                    return;
                }
            }
            QC_Sample_Veh vsam = new QC_Sample_Veh();

            vsam.CardID     = cardId;
            vsam.TempID     = currentData.VehSamples.Count + 1;
            vsam.FetchTime  = DateTime.Now;
            vsam.IcInfo     = card;
            vsam.SaveIcInfo = true;
            vsam.SampleType = SampleType.校验样;
            vsam.Sample_JY  = true;
            currentData.VehSamples.Add(vsam);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 扫卡
        /// </summary>
        public void HandleCardMessage(Device.CardReader device, string cardId)
        {
            if (curData.MainSampleMixId == 0)
            {
                MessageBox.Show(string.Format("请先获取留存样"));
                return;
            }

            QC_IC_Info card = QC_IC_Info.FindByCardId(cardId);

            if (card == null)
            {
                Tb_IC ic = Tb_IC.GetByICNo(cardId);
                if (ic != null)
                {
                    MessageBox.Show(string.Format("此卡为车辆卡"));
                    return;
                }
                else
                {
                    MessageBox.Show(string.Format("此卡没有注册"));
                    return;
                }
            }
            if (card.CardType != QC_IC_Info.CardUseType_Mix)
            {
                MessageBox.Show("卡的类型不对");
                return;
            }
            if (card.SampleId > 0)
            {
                MessageBox.Show("此卡正在使用");
                return;
            }
            if (!string.IsNullOrEmpty(curData.CardID))
            {
                MessageBox.Show("已关联磁卡");
                return;
            }
            curData.FangTong_User = LocalInfo.Current.user.ID;
            curData.FangTong_Time = DateTime.Now;
            curData.CardID        = cardId;
            curData.SaveIcInfo    = true;
            curData.IcInfo        = card;
            //   btnUnBindCard.Visible = true;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 处理读卡
        /// </summary>
        public void HandleCardMessage(Device.CardReader device, string cardId)
        {
            QC_IC_Info card = QC_IC_Info.FindByCardId(cardId);

            if (card == null)
            {
                Tb_IC ic = Tb_IC.GetByICNo(cardId);
                if (ic != null)
                {
                    MessageBox.Show(string.Format("此卡为车辆卡"));
                    return;
                }
                else
                {
                    MessageBox.Show(string.Format("此卡没有注册"));
                    return;
                }
            }
            if (card.CardType != QC_IC_Info.CardUseType_Veh)
            {
                MessageBox.Show("卡的类型不对");
                return;
            }

            if (card.SampleId > 0)
            {
                MessageBox.Show("此卡正在使用");
                return;
            }

            if (!string.IsNullOrEmpty(curData.CardID))
            {
                MessageBox.Show("已经绑定磁卡");
                return;
            }

            curData.CardID        = cardId;
            curData.FetchTime     = DateTime.Now;
            curData.IcInfo        = card;
            btnUnBindCard.Visible = true;
        }
Ejemplo n.º 5
0
        public void HandleCardMessage(Device.CardReader device, string cardId)
        {
            QC_IC_Info card = icInfoDatas.FirstOrDefault <QC_IC_Info>((ic) => (ic.CardID == cardId));

            if (card == null)
            {
                Tb_IC ic = Tb_IC.GetByICNo(cardId);
                if (ic != null)
                {
                    MessageBox.Show(string.Format("此卡为车辆卡,不能注册"));
                    return;
                }
                else
                {
                    txtCardId.Text = cardId;
                }
            }
            else
            {
                gridView_IC_Info.ActiveFilter.Clear();
                gridView_IC_Info.ActiveFilter.Add(gridView_IC_Info.Columns["CardID"], new DevExpress.XtraGrid.Columns.ColumnFilterInfo("[CardID]='" + cardId + "'"));
            }
        }