void InputNumbCardClickHandeler(object sender, EventArgs e) { int numb = 0; numb = IOF.InputXmlFile(numb, Properties.Resources.CardFile, myModel.list()); StructCard Card = SearchCard(myModel.list(), out numb); if (!(Card == null)) { if (atmInput.TextPassword.Text == Card.getPaswrod().ToString()) { atmInput.Hide(); ATMMenu ATMMenu = new ATMMenu(); _ = new PresentorATMMenu(ATMMenu, myModel); myModel.IndexIn(numb); ATMMenu.ShowDialog(); atmInput.Show(); atmInput.Hide(); } else { MessageBox.Show("Error Pasword", "Error"); } } else { MessageBox.Show("This card is not exist", "Error"); } }
/// <summary> /// 直接进入开通会员界面 /// </summary> /// <param name="card">若card为null自动生成card</param> public OpenMemberView(StructCard card) { InitializeComponent(); if (card == null) { StructCard.Builder newcard = new StructCard.Builder() { Name = "xx22", Gender = 1, Nation = "2112", Number = ToolsManage.RandomCard, Birthday = "2012-09-01", Address = "海南省", Organization = "海南", Head = "#dasdasd#", Vld = "", }; Bitmap b = Imgs.test; string inputString = ToolsManage.BitmapToDataSring(b); newcard.Head = inputString; InitUI(newcard.Build()); } else { InitUI(card); IdCardReaderManage.ReadCard(ReadCardResult, null, null); } }
private void InitUI(StructCard card) { //初始化Label char[] sp = { ':', ':' }; this.nameLabel.Text = string.Format("{0}:{1}", this.nameLabel.Text.Split(sp)[0], card.Name); this.genderLabel.Text = string.Format("{0}:{1}", this.genderLabel.Text.Split(sp)[0], card.Gender); this.nationLabel.Text = string.Format("{0}:{1}", this.nationLabel.Text.Split(sp)[0], card.Nation); this.cardTypeLabel.Text = string.Format("{0}:{1}", this.cardTypeLabel.Text.Split(sp)[0], "身份证"); this.cardNumLabel.Text = string.Format("{0}:{1}", this.cardNumLabel.Text.Split(sp)[0], card.Number); this.addressLabel.Text = string.Format("{0}:{1}", this.addressLabel.Text.Split(sp)[0], card.Address); this.organLabel.Text = string.Format("{0}:{1}", this.organLabel.Text.Split(sp)[0], card.Organization); this.countryLabel.Text = string.Format("{0}:{1}", this.countryLabel.Text.Split(sp)[0], "中国"); this.birthdayLabel.Text = string.Format("{0}:{1}", this.birthdayLabel.Text.Split(sp)[0], card.Birthday); this.cardValidityLabel.Text = string.Format("{0}:{1}", this.cardValidityLabel.Text.Split(sp)[0], card.Vld); try { //利用 WebClient 来下载图片 using (WebClient wc = new WebClient()) { ////WebClient 下载完毕的响应事件绑定 wc.DownloadDataCompleted += Wc_DownloadDataCompleted; ////开始异步下载,图片URL路径请根据实际情况自己去指定 wc.DownloadDataAsync(new Uri(card.Head)); } } catch (Exception exc) { } }
public UserActiveView(StructCard readCard) { InitializeComponent(); this.titleLabel.Text = "用户上机"; simpleButton2.Enabled = simpleButton3.Enabled = simpleButton1.Enabled = false; IdCardReaderManage.ReadCard(ReadCardResult, null, null); InitUI(readCard); }
private void InitUI(StructCard showcard) { this.activeCard = new StructCard.Builder(showcard).Build(); char[] sp = { ':', ':' }; simpleButton3.Enabled = simpleButton2.Enabled = simpleButton1.Enabled = true; label1.Text = string.Format("{0}:{1}", label1.Text.Split(sp)[0], showcard.Number); label2.Text = string.Format("{0}:{1}", label2.Text.Split(sp)[0], showcard.Name); MemoryStream ms = new MemoryStream(System.Convert.FromBase64String(showcard.Head)); this.pictureEdit1.Image = Image.FromStream(ms); }
//读卡结果 private void ReadCardResult(StructCard readCard, bool isSuccess) { if (readCard != null && isSuccess) { //激活 RefreshUIHandle active = new RefreshUIHandle(delegate { this.IsActiveCard = false; UserActiveView view = new UserActiveView(readCard); ToolsManage.ShowForm(view, false); }); //开通会员 RefreshUIHandle open = new RefreshUIHandle(delegate { this.IsOpenMember = false; OpenMemberView view = new OpenMemberView(readCard); MainViewManage.ShowView(view); }); IdCardReaderManage.RemoveEvent(ReadCardResult, ConnectReaderResult, AuthenticateCardResult); if (this.InvokeRequired) { if (this.IsOpenMember) { this.Invoke(open); } else if (this.IsActiveCard) { this.Invoke(active); } } else { if (this.IsOpenMember) { open(); } else if (this.IsActiveCard) { active(); } } } else { this.IsOpenMember = this.IsActiveCard = false; IdCardReaderManage.OffCardReader(ReadCardResult, ConnectReaderResult, AuthenticateCardResult); MessageBox.Show("读取身份证信息失败"); } }
private void ReadCardResult(StructCard readCard, bool isSuccess) { if (readCard != null && isSuccess) { if (this.InvokeRequired) { this.Invoke(new RefreshUIHandle(delegate { InitUI(readCard); })); } else { InitUI(readCard); } } }
/// <summary> /// 添加身份证信息(添加临时会员) /// </summary> /// <param name="resultBlock">结果反馈</param> /// <param name="card">身份证信息</param> public static void AddCardInfo(DataResultBlock resultBlock, StructCard card) { CSEmkAddCardInfo.Builder info = new CSEmkAddCardInfo.Builder(); info.Card = card; MessageContent.Builder content = new MessageContent.Builder(); content.MessageType = 1; content.CsEmkAddCardInfo = info.Build(); SendModel send = new SendModel() { cmd = Cmd.CMD_EMK_ADD_CARDINFO, content = content.Build(), }; NetMessageManage.SendMsg(send, resultBlock); }
//激活结果回调 private void ActiveFlowResult(ResultModel result) { if (result.pack.Cmd != Cmd.CMD_EMK_CHECKIN) { return; } System.Console.WriteLine("CardCheckInResult:" + result.pack); NetMessageManage.RemoveResultBlock(ActiveFlowResult); if (result.pack.Content.MessageType != 1) { FLOW_ERROR error = FLOW_ERROR.OTHER; Enum.TryParse <FLOW_ERROR>(result.pack.Content.ErrorTip.Key, out error); switch (error) { //需要充值 case FLOW_ERROR.NEED_RECHARGE: UserScanCodeView codeView = new UserScanCodeView(this.activeCard, 100, FLOW_STATUS.ACTIVE_STATUS, (int)PRECHARGE_TYPE.NOT_MEMBER); ToolsManage.ShowForm(codeView, false); break; //提醒是否开通会员 case FLOW_ERROR.NEED_ADD_CARD: { AddCardInfo(); } break; //用户锁定 case FLOW_ERROR.USER_LOCK: { MessageBox.Show("该用户已经被锁"); } break; } return; } //激活成功后提示激活成功,将值设置成不激活状态 else { _manage = null; activeCard = null; UserActivResultView view = new UserActivResultView(); ToolsManage.ShowForm(view, false); } }
//会员信息查询结果 private void MemberInfoResult(ResultModel result) { if (result.pack.Cmd != Cmd.CMD_MEMBER_CARD_INFO) { return; } NetMessageManage.RemoveResultBlock(MemberInfoResult); System.Console.WriteLine("MemberInfoResult:" + result.pack); if (result.pack.Content.MessageType == 1) { //赋值 this.Invoke(new RefreshUIHandle(delegate { StructCard card = result.pack.Content.ScMemberCardInfo.Cardinfo; InitUI(card); })); } }
//初始化UI /// <summary> /// 初始化 /// </summary> /// <param name="card">身份证信息</param> /// <param name="money">充值金额</param> /// <param name="status">流程</param> /// <param name="offical">是否办理会员</param> private void InitUI(StructCard card, int money, FLOW_STATUS status, PRECHARGE_TYPE offical) { InitializeComponent(); this.titleLabel.Text = "用户充值"; this.recharge = money; this.prechargeType = offical; this.rechargeCard = new StructCard.Builder(card).Build(); this.flowstatus = status; //如果进入充值。进入充值入口 if (status == FLOW_STATUS.NORMAL_STATUS) { BeginRecharge(); } //直接获取二维码 else { GetRechargeCode(); } }
private void InitUI(StructCard card) { this.openCard = new StructCard.Builder(card).Build(); //初始化Label char[] sp = { ':', ':' }; this.nameLabel.Text = string.Format("{0}:{1}", this.nameLabel.Text.Split(sp)[0], this.openCard.Name); this.genderLabel.Text = string.Format("{0}:{1}", this.genderLabel.Text.Split(sp)[0], this.openCard.Gender); this.nationLabel.Text = string.Format("{0}:{1}", this.nationLabel.Text.Split(sp)[0], this.openCard.Nation); this.cardTypeLabel.Text = string.Format("{0}:{1}", this.cardTypeLabel.Text.Split(sp)[0], "身份证"); this.cardNumLabel.Text = string.Format("{0}:{1}", this.cardNumLabel.Text.Split(sp)[0], this.openCard.Number); this.addressLabel.Text = string.Format("{0}:{1}", this.addressLabel.Text.Split(sp)[0], this.openCard.Address); this.organLabel.Text = string.Format("{0}:{1}", this.organLabel.Text.Split(sp)[0], this.openCard.Organization); this.countryLabel.Text = string.Format("{0}:{1}", this.countryLabel.Text.Split(sp)[0], "中国"); this.birthdayLabel.Text = string.Format("{0}:{1}", this.birthdayLabel.Text.Split(sp)[0], this.openCard.Birthday); this.cardValidityLabel.Text = string.Format("{0}:{1}", this.cardValidityLabel.Text.Split(sp)[0], this.openCard.Vld); MemoryStream ms = new MemoryStream(System.Convert.FromBase64String(this.openCard.Head)); this.pictureEdit1.Image = Image.FromStream(ms); if (this.mainDataTable == null) { //先接受数据 this.memberTypes = SysManage.MemberTypes; //初始化GridControl ToolsManage.SetGridView(this.gridView1, GridControlType.OpenMember, out this.mainDataTable); this.gridControl1.DataSource = this.mainDataTable; RefreshGridControl(); } //隐藏按钮可点击 this.simpleButton1.Enabled = false; this.simpleButton2.Enabled = false; this.moneyTextEdit.Text = ""; //开通会员入口 OpenMember(); }
public void CardCheckIn(StructCard card) { this.activeCard = new StructCard.Builder(card).Build(); HomePageNetOperation.CardCheckIn(_manage.ActiveFlowResult, this.activeCard.Number); }
private StructCard openCard; //需要开通会员的身份证信息 #region 初始化方法 /// <summary> /// 声明开通会员(激活时进入。不监听读卡) /// </summary> /// <param name="status"></param> /// <param name="card"></param> public OpenMemberView(FLOW_STATUS status, StructCard card) { InitializeComponent(); this.flowstatus = status; InitUI(card); }
/// <summary> /// 声明 /// </summary> /// <param name="card">身份证号</param> /// <param name="money">充值金额</param> /// <param name="status">流程状态</param> /// <param name="offical">是否办理会员</param> public UserScanCodeView(StructCard card, int money, FLOW_STATUS status, PRECHARGE_TYPE offical) { InitUI(card, money, status, offical); }
private int recharge; //充值的金额 #region 初始化方法 /// <summary> /// 声明 /// </summary> /// <param name="card">身份证信息</param> /// <param name="money">充值金额</param> /// <param name="offical">是否办理会员</param> public UserScanCodeView(StructCard card, int money, PRECHARGE_TYPE offical) { InitUI(card, money, FLOW_STATUS.NORMAL_STATUS, offical); }