//充值入口回调 private void BeginRechargeResult(ResultModel result) { if (result.pack.Cmd != Cmd.CMD_EMK_RECHARGE) { return; } System.Console.WriteLine("BeginRechargeResult:" + result.pack); NetMessageManage.RemoveResultBlock(BeginRechargeResult); //充值成功关闭窗口 if (result.pack.Content.MessageType == 1) { this.Invoke(new RefreshUIHandle(delegate { this.CloseFormClick(); })); } else { FLOW_ERROR error = FLOW_ERROR.OTHER; Enum.TryParse <FLOW_ERROR>(result.pack.Content.ErrorTip.Key, out error); switch (error) { //需要添加身份证信息 case FLOW_ERROR.NEED_ADD_CARD: AddCardInfo(); break; //用户锁定 case FLOW_ERROR.USER_LOCK: { this.Invoke(new RefreshUIHandle(delegate { MessageBox.Show("该用户已经被锁"); this.CloseFormClick(); })); } break; //需要充值,获取二维码 case FLOW_ERROR.NEED_RECHARGE: { GetRechargeCode(); } break; default: break; } } }
//激活结果回调 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 OpenMemberResult(ResultModel result) { if (result.pack.Cmd != Cmd.CMD_EMK_APPLY_MEMBER) { return; } System.Console.WriteLine("OpenMemberResult:" + result.pack); NetMessageManage.RemoveResultBlock(OpenMemberResult); FLOW_ERROR error = FLOW_ERROR.OTHER; Enum.TryParse <FLOW_ERROR>(result.pack.Content.ErrorTip.Key, out error); //办理完成 if (result.pack.Content.MessageType == 1) { this.Invoke(new RefreshUIHandle(delegate() { //将按钮回复可以点击 this.simpleButton1.Enabled = false; this.simpleButton2.Enabled = true; })); } else { switch (error) { //需要添加身份证信息 case FLOW_ERROR.NEED_ADD_CARD: AddCardInfo(); break; //被锁 case FLOW_ERROR.USER_LOCK: MessageBox.Show("该用户已经被锁"); break; //需要充值 case FLOW_ERROR.NEED_RECHARGE: { this.Invoke(new RefreshUIHandle(delegate() { //将按钮回复可以点击 this.simpleButton1.Enabled = true; })); } break; //已经是会员 case FLOW_ERROR.IS_MEMBER: { this.Invoke(new RefreshUIHandle(delegate() { //将按钮回复可以点击 this.simpleButton1.Enabled = false; this.simpleButton2.Enabled = true; })); } break; default: break; } } }