/** 对合买对象进行赋值 */
 public void setPojo() {
   RWSharedPreferences pre = new RWSharedPreferences(JoinStartActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   betAndGift.setBettype("startcase");
   betAndGift.setTotalAmt(betAndGift.getAmount());
   if (betAndGift.getIssuper().equals("0")) {
     betAndGift.setOneAmount("300");
   } else {
     betAndGift.setOneAmount("200");
   }
   betAndGift.setSafeAmt(isNull(PublicMethod.toFen(isNull(safeEdit.getText().toString()))));
   betAndGift.setBuyAmt(isNull(PublicMethod.toFen(isNull(buyEdit.getText().toString()))));
   betAndGift.setMinAmt(PublicMethod.toFen(isNull(minEdit.getText().toString())));
   betAndGift.setCommisionRation(commisionRation);
   betAndGift.setVisibility(visible);
   betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno()));
   betAndGift.setDescription(descriptionEdit.getText().toString());
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setAmount("" + ZixuanActivity.addView.getAllAmt() * iProgressBeishu * 100);
   betAndGift.setIsSellWays("1");
   betAndGift.setBet_code(
       ZixuanActivity.addView.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
 }
Example #2
0
  private void dialogMsg() {
    RWSharedPreferences shellRW = new RWSharedPreferences(BuyActivity.this, "UserMessage");
    messageflage = shellRW.getStringValue("tanchumessage");
    messageidflag = shellRW.getStringValue("id");
    if (!PublicConst.MESSAGE.equals("")) {
      try {
        obj = new JSONObject(PublicConst.MESSAGE);
        String id = obj.getString("id");
        messagetitle = obj.getString("title");
        messagedetail = obj.getString("message");
        if (messageidflag == null) {
          shellRW.putStringValue("id", id);
          Message msg = new Message();
          msg.what = 4;
          handler.sendMessage(msg);
        } else if (!messageidflag.equals(id)) {
          shellRW.putStringValue("id", id);
          Message msg = new Message();
          msg.what = 4;
          handler.sendMessage(msg);
        }

      } catch (JSONException e) {

      }
    }
  }
Example #3
0
        @Override
        public void onClick(View v) {
          // TODO Auto-generated method stub
          RWSharedPreferences pre = new RWSharedPreferences(context, "addInfo");
          context.sessionId = pre.getStringValue("sessionid");
          context.phonenum = pre.getStringValue("phonenum");
          context.userno = pre.getStringValue("userno");
          if (context.userno == null || context.userno.equals("")) {
            Intent intentSession = new Intent(context, UserLogin.class);
            context.startActivityForResult(intentSession, 0);
          } else if (zhuShu == 0) {
            Toast.makeText(context, "请选择过关方式", Toast.LENGTH_SHORT).show();
          } else {

            if (isAmtDialog()) {
              alertInfo(
                  context.getString(R.string.jc_main_touzhu_alert_text_content),
                  context.getString(R.string.jc_main_touzhu_alert_text_title));
            } else {
              switch (v.getId()) {
                case R.id.alert_dialog_touzhu_button_cancel:
                  initBet();
                  context.toJoinActivity();
                  break;
                case R.id.alert_dialog_touzhu_button_ok:
                  beginTouzhu();
                  break;
              }
              dialog.cancel();
            }
          }
        }
 public void isTurnView() {
   RWSharedPreferences shellRW =
       new RWSharedPreferences(AccountYingActivity.this, ShellRWConstants.SHAREPREFERENCESNAME);
   String userno = shellRW.getStringValue(ShellRWConstants.USERNO);
   String phonenum = shellRW.getStringValue(ShellRWConstants.PHONENUM);
   String accountnumstr = accountnum.getText().toString();
   if (accountnumstr.length() > 9) {
     Toast.makeText(AccountYingActivity.this, "你有那么多钱吗?", Toast.LENGTH_SHORT).show();
     accountnum.setText("100");
     isOnClick = true;
   } else if (accountnumstr.equals("")) {
     Toast.makeText(AccountYingActivity.this, "请输入充值金额!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else if (Integer.parseInt(accountnumstr) == 0) {
     Toast.makeText(AccountYingActivity.this, "充值金额不能为0!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else if (Integer.parseInt(accountnumstr) < 20) {
     Toast.makeText(AccountYingActivity.this, "充值金额至少为20元!", Toast.LENGTH_SHORT).show();
     isOnClick = true;
   } else {
     if (isAlipay) {
       isInstallSecurePay(userno, phonenum, accountnumstr);
     } else {
       actoinYin(accountnumstr);
     }
   }
 }
  // 支付宝充值
  private void beginAlipayRecharge(View Vi) { // isWebView = false代表浏览器联网
    String zfb_recharge_value_string = accountnum.getText().toString();
    RWSharedPreferences pre = new RWSharedPreferences(AlipaySecureActivity.this, "addInfo");
    String sessionIdStr = pre.getStringValue(ShellRWConstants.SESSIONID);
    phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);

    if (sessionIdStr.equals("") || sessionIdStr == null) {
      Intent intentSession = new Intent(AlipaySecureActivity.this, UserLogin.class);
      startActivity(intentSession);
    } else {
      if (zfb_recharge_value_string.equals("0")) {
        Toast.makeText(this, "不能为0!", Toast.LENGTH_LONG).show();
        return;
      }
      if (zfb_recharge_value_string.equals("") || zfb_recharge_value_string.length() == 0) {
        Toast.makeText(this, "不能为空!", Toast.LENGTH_LONG).show();
      } else {
        // 支付宝充值网络获取
        // 改为线程 2010/7/9陈晨
        RechargePojo rechargepojo = new RechargePojo();
        ;
        rechargepojo.setAmount(zfb_recharge_value_string);
        rechargepojo.setRechargetype("05");
        rechargepojo.setCardtype("0300");

        if (isWebView) {
          rechargepojo.setBankAccount("4"); // 4支付宝wap支付
        } else {
          rechargepojo.setBankAccount("3"); // 3支付宝浏览器支付
        }
        recharge(rechargepojo);
      }
    }
  }
  private void isAgencyNet() {
    RWSharedPreferences pre = new RWSharedPreferences(this, "addInfo");
    String userno = pre.getStringValue(ShellRWConstants.USERNO);
    String phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);
    String toPhonenum = userName.getText().toString();
    String amout = userAmt.getText().toString();
    String password = userPassword.getText().toString();

    if (toPhonenum == null || toPhonenum.equals("")) {
      Toast.makeText(context, "您输入的用户名不能为空!", Toast.LENGTH_SHORT).show();
    } else if (amout == null || amout.equals("")) {
      Toast.makeText(context, "您输入的金额不能为空!", Toast.LENGTH_SHORT).show();
    } else if (password == null || password.equals("")) {
      Toast.makeText(context, "您输入的密码不能为空!", Toast.LENGTH_SHORT).show();
    } else if (Integer.parseInt(amout.substring(0, 1)) == 0) {
      Toast.makeText(context, "您输入的金额第一位数不能为零", Toast.LENGTH_SHORT).show();
    } else if (amout.length() > 5) {
      Toast.makeText(context, "您输入的金额不能超过10万元!", Toast.LENGTH_SHORT).show();
    } else if (Integer.parseInt(amout) == 0) {
      Toast.makeText(context, "您输入的金额不能为零!", Toast.LENGTH_SHORT).show();
    } else {
      amout = PublicMethod.toFen(amout);
      agencyNet(userno, phonenum, toPhonenum, amout, password);
    }
  }
 private void bettingOrCooperation(boolean isBetting) {
   RWSharedPreferences pre =
       new RWSharedPreferences(BeiJingSingleGameIndentActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   if (bettingNum == 0) {
     Toast.makeText(BeiJingSingleGameIndentActivity.this, "请选择过关方式", Toast.LENGTH_SHORT).show();
   } else {
     if (userno == null || userno.equals("")) {
       Intent intentSession = new Intent(BeiJingSingleGameIndentActivity.this, UserLogin.class);
       BeiJingSingleGameIndentActivity.this.startActivityForResult(intentSession, 0);
     } else {
       if (isOutMaxAmt()) {
         alertInfo(
             BeiJingSingleGameIndentActivity.this.getString(
                 R.string.jc_main_touzhu_alert_text_content),
             BeiJingSingleGameIndentActivity.this.getString(
                 R.string.jc_main_touzhu_alert_text_title));
       } else {
         initBettingInfo();
         if (isBetting) {
           Betting();
         } else {
           turnToCooperation();
         }
       }
     }
   }
 }
Example #8
0
 /** 读取本地渠道号 */
 public void getChannel() {
   String channel = shellRW.getStringValue("channel");
   if (channel.equals("") || channel == null) {
     shellRW.putStringValue("channel", Constants.COOP_ID);
   } else {
     Constants.COOP_ID = channel;
   }
 }
Example #9
0
 private void oauthOrShare() {
   token = shellRW.getStringValue("token");
   expires_in = shellRW.getStringValue("expires_in");
   if (token.equals("")) {
     oauth();
   } else {
     isSinaTiaoZhuan = true;
     initAccessToken(token, expires_in);
   }
 }
Example #10
0
 /**
  * 当选中记住用户密码的按钮时
  *
  * @param isChecked
  */
 private void rem_password_num(boolean isChecked) {
   EditText password_edit = (EditText) findViewById(R.id.password_edit);
   String password_string = password_edit.getText().toString();
   if (isChecked) {
     shellRW.putStringValue("remPwd_checkBox", "true");
     shellRW.putStringValue("password", password_string);
   } else {
     shellRW.putStringValue("remPwd_checkBox", "false");
     shellRW.putStringValue("password", "");
   }
 }
  //
  // 投注新接口 20100711陈晨
  protected String[] payNew(String betCode, String lotMulti, String amount, String qiShu) {
    String[] error_code = null;
    //		BettingInterface betting = BettingInterface.getInstance();

    RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo");
    String sessionid = shellRW.getStringValue("sessionid");
    String phonenum = shellRW.getStringValue("phonenum");
    //			error_code = betting.BettingTC(phonenum, qihaoxinxi[2], betCode, lotMulti,
    //					amount, "2", qiShu, sessionid, batchCode);

    return error_code;
  }
Example #12
0
 private void auto_login(boolean isChecked) {
   EditText password_edit = (EditText) findViewById(R.id.password_edit);
   String password_string = password_edit.getText().toString();
   if (isChecked) {
     shellRW.putStringValue("remPwd_checkBox", "true");
     shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, true);
     isAutoLogin = "******";
     shellRW.putStringValue("password", password_string);
   } else {
     isAutoLogin = "******";
     shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, false);
   }
 }
Example #13
0
 /** 初始化 自动登录控件设置 */
 private void initAutoLoginSet() {
   isLogined = shellRW.getStringValue("sessionid");
   boolean is_auto_login = shellRW.getBooleanValue(ShellRWConstants.AUTO_LOGIN);
   if (isLogined.equals("") || isLogined.equals("null")) {
     auto_login_set.setBackgroundResource(R.drawable.off);
   } else {
     if (is_auto_login) {
       auto_login_set.setBackgroundResource(R.drawable.on);
     } else {
       auto_login_set.setBackgroundResource(R.drawable.off);
     }
   }
   auto_login_set.setOnClickListener(moreActivityListener);
 }
Example #14
0
 /**
  * 是否下载开奖图片
  *
  * @param image
  * @throws JSONException
  */
 public void imageJson(JSONObject image) throws JSONException {
   String errorCode = image.getString("errorCode");
   shellRW.putStringValue("errorCode", errorCode);
   if (errorCode.equals("true")) {
     String jsonId = image.getString("id");
     String imageId = shellRW.getStringValue("imageId");
     if (imageId.equals("") || imageId == null || !imageId.equals(jsonId)) {
       if (isWifi == true) {
         shellRW.putStringValue("imageId", jsonId);
         DownLoadImg down = new DownLoadImg();
         down.downThread(image.getString("imageUrl"));
       }
     }
   }
 }
  // 充值
  private void recharge(final RechargePojo rechargepojo) {
    RWSharedPreferences pre = new RWSharedPreferences(AccountYingActivity.this, "addInfo");
    final String sessionId = pre.getStringValue(ShellRWConstants.SESSIONID);
    final String userno = pre.getStringValue(ShellRWConstants.USERNO);
    mProgress = UserCenterDialog.onCreateDialog(AccountYingActivity.this);
    mProgress.show();
    final Handler handler = new Handler();
    new Thread(
            new Runnable() {
              @Override
              public void run() {
                // TODO Auto-generated method stub
                try {
                  rechargepojo.setSessionid(sessionId);
                  rechargepojo.setUserno(userno);
                  String re = RechargeInterface.getInstance().recharge(rechargepojo);

                  JSONObject obj = new JSONObject(re);
                  String error_code = obj.getString("error_code");
                  final String message = obj.getString("message");
                  closeProgress();
                  if (error_code.equals("0000")) {
                    final String xml = obj.getString("value");
                    handler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            turnYinView(xml);
                          }
                        });
                  } else {
                    handler.post(
                        new Runnable() {
                          @Override
                          public void run() {
                            // TODO Auto-generated method stub
                            Toast.makeText(AccountYingActivity.this, message, Toast.LENGTH_SHORT);
                          }
                        });
                  }
                } catch (JSONException e) {
                  e.printStackTrace();
                }
              }
            })
        .start();
  }
Example #16
0
 /** 登录联网操作 */
 private void beginLogin() {
   // showDialog(DIALOG_PROGRESS);
   EditText password_edit = (EditText) findViewById(R.id.password_edit);
   Editable password = password_edit.getText();
   final String password_string = String.valueOf(password);
   if (remPwd_checkBox.isChecked()) shellRW.putStringValue("password", password_string);
   // 判断手机号长度是否正确
   EditText phone_name_Text = (EditText) findViewById(R.id.phoneNum_edit);
   Editable editText = phone_name_Text.getText();
   // fqc edit 7/3/2010 判断密码长度 必须在6~16之间
   EditText password_text = (EditText) findViewById(R.id.password_edit);
   int passwordLength = password_text.getText().toString().length();
   if (editText.toString().equals("")) {
     Toast.makeText(this, "用户名不能为空!", Toast.LENGTH_LONG).show();
   } else if (passwordLength < 6 || passwordLength > 16) {
     password_edit.startAnimation(shake);
     Toast.makeText(this, "密码必须为6~16位!", Toast.LENGTH_LONG).show();
   } else { //
     //			if(auto_login_checkBox.isChecked()){
     //				isAutoLogin = "******";
     //			}else{
     //				isAutoLogin = "******";
     //			}
     regToLogin(String.valueOf(phoneNum_edit.getText()), password_string, isAutoLogin);
   }
 }
Example #17
0
 /** 设置开机图片 */
 public void initImgView() {
   imageview = (ImageView) this.findViewById(R.id.cp1);
   File sdcardDir = Environment.getExternalStorageDirectory();
   String path = sdcardDir.getParent() + "/" + sdcardDir.getName();
   // 得到开机图片
   Bitmap bitmap = BitmapFactory.decodeFile(path + DownLoadImg.LOCAL_DIR + DownLoadImg.IMG_NAME);
   String errorCode = shellRW.getStringValue("errorCode");
   if (bitmap == null || errorCode.equals("") || errorCode.equals("false")) {
     Resources r = this.getResources();
     InputStream is = r.openRawResource(R.drawable.cp1);
     BitmapDrawable bmpDraw = new BitmapDrawable(is);
     bitmap = bmpDraw.getBitmap();
   }
   // 缩放开机图片
   Matrix matrix = new Matrix();
   float iScreenWidth = PublicMethod.getDisplayWidth(this);
   float iScreenHeight = PublicMethod.getDisplayHeight(this);
   float w = iScreenWidth / bitmap.getWidth();
   float h = iScreenHeight / bitmap.getHeight();
   if (w != 1 || h != 1) {
     matrix.postScale(w, h);
     bitmap =
         Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
   }
   imageview.setImageBitmap(bitmap);
 }
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
      convertView = mInflater.inflate(R.layout.caizhong_setting_list_item, null);
      holder = new ViewHolder();
      holder.caizhongTextView = (TextView) convertView.findViewById(R.id.caizhong_TextView);
      holder.caizhongButton = (Button) convertView.findViewById(R.id.caizhong_set_checkbox);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }

    holder.caizhongTextView.setText(list.get(position).get("shellName"));
    for (int i = 0; i < list.size(); i++) {
      if (shellRW
          .getStringValue(list.get(position).get("shellKey"))
          .equals(Constants.CAIZHONG_OPEN)) {
        holder.caizhongButton.setBackgroundResource(R.drawable.on);
        holder.caizhongButton.setTag(
            R.id.caizhong_set_checkbox, list.get(position).get("shellKey"));
      } else {
        holder.caizhongButton.setBackgroundResource(R.drawable.off);
        holder.caizhongButton.setTag(
            R.id.caizhong_set_checkbox, list.get(position).get("shellKey"));
      }
    }
    holder.caizhongButton.setOnClickListener(onClickListener);
    return convertView;
  }
Example #19
0
 /** 首次启动软件是否创建快捷方式 */
 public void isShortcut() {
   RWSharedPreferences shellRW = new RWSharedPreferences(this, "addInfo");
   boolean isShortcut = shellRW.getBooleanValue("isShortcut");
   if (!isShortcut) { // 如果是false的话代表首次启动
     shellRW.putBooleanValue("isShortcut", true);
     ShortcutDialog dialog =
         new ShortcutDialog(
             this,
             getString(R.string.shortcut_dialog_title),
             getString(R.string.shortcut_dialog_message));
     dialog.showDialog();
     dialog.createMyDialog();
   } else {
     dialogMsg();
   }
 }
 /** DNA充值账户绑定查询 */
 public void checkDNA() {
   RWSharedPreferences pre = new RWSharedPreferences(AccountWithdrawActivity.this, "addInfo");
   final String sessionId = pre.getStringValue("sessionid");
   final String mobile = pre.getStringValue("mobileid");
   final String userno = pre.getStringValue("userno");
   if (sessionId == null || sessionId.equals("")) {
     Intent intentSession = new Intent(AccountWithdrawActivity.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
   } else {
     showDialog(0);
     new Thread(
             new Runnable() {
               @Override
               public void run() {
                 String error_code = "00";
                 String message = "";
                 try {
                   re = QueryDNAInterface.getInstance().queryDNA(mobile, sessionId, userno);
                   JSONObject obj = new JSONObject(re);
                   error_code = obj.getString("error_code");
                   message = obj.getString("message");
                 } catch (Exception e) {
                   e.printStackTrace();
                 }
                 if (error_code.equals("0047")) {
                   handler.post(
                       new Runnable() {
                         public void run() {
                           setContentView(getMoneyDialog());
                         }
                       });
                 } else if (error_code.equals("0000")) {
                   handler.post(
                       new Runnable() {
                         public void run() {
                           dialogDNA(re);
                         }
                       });
                 } else {
                   handler.handleMsg(error_code, message);
                 }
                 progressdialog.dismiss();
               }
             })
         .start();
   }
 }
 /** @param rechargepojo */
 private void getAccountNet() {
   RWSharedPreferences pre = new RWSharedPreferences(AccountYingActivity.this, "addInfo");
   final String phonenum = pre.getStringValue(ShellRWConstants.PHONENUM);
   final String userno = pre.getStringValue(ShellRWConstants.USERNO);
   mProgress = UserCenterDialog.onCreateDialog(AccountYingActivity.this);
   mProgress.show();
   final Handler handler = new Handler();
   new Thread(
           new Runnable() {
             @Override
             public void run() {
               // TODO Auto-generated method stub
               try {
                 String re =
                     AccountRechargeInterface.getInstance().recharge(userno, phonenum, TYPE);
                 final JSONObject obj = new JSONObject(re);
                 String error_code = obj.getString("error_code");
                 final String message = obj.getString("message");
                 closeProgress();
                 if (error_code.equals("0000")) {
                   final JSONArray jsonArray = obj.getJSONArray("result");
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           initNameSpinner(getList(jsonArray));
                         }
                       });
                 } else {
                   handler.post(
                       new Runnable() {
                         @Override
                         public void run() {
                           // TODO Auto-generated method stub
                           Toast.makeText(AccountYingActivity.this, message, Toast.LENGTH_SHORT)
                               .show();
                         }
                       });
                 }
               } catch (JSONException e) {
                 e.printStackTrace();
               }
             }
           })
       .start();
 }
 private void initBetPojo() {
   RWSharedPreferences pre = new RWSharedPreferences(FootballSixSemiFinal.this, "addInfo");
   sessionid = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   betPojo.setPhonenum(phonenum);
   betPojo.setSessionid(sessionid);
   betPojo.setUserno(userno);
   betPojo.setBet_code(getZhuMa());
   betPojo.setLotno(lotno);
   betPojo.setBatchnum("1");
   betPojo.setBatchcode(batchCode);
   betPojo.setLotmulti(String.valueOf(iProgressBeishu));
   betPojo.setBettype("bet");
   betPojo.setAmount(getZhuShu() * 200 + "");
   betPojo.setZhushu(getZhuShu() + "");
 }
Example #23
0
 /** 投注方法 */
 private void beginTouZhu() {
   RWSharedPreferences pre = new RWSharedPreferences(GiftActivity.this, "addInfo");
   sessionId = pre.getStringValue("sessionid");
   phonenum = pre.getStringValue("phonenum");
   userno = pre.getStringValue("userno");
   String alertStr =
       "您将要赠送"
           + checkedPersons.size()
           + "位朋友,赠送金额为"
           + allAtm * checkedPersons.size()
           + "元,"
           + "是否赠送?";
   String phone = editPhone.getText().toString();
   if (isNum(phone)) {
     touDialog("确认要赠送吗?", alertStr);
   }
 }
Example #24
0
 /** 跳转下一页 */
 public void turnActivity() {
   //		Intent in = new Intent(HomeActivity.this, TransitActivity.class);
   //		startActivity(in);
   //		HomeActivity.this.finish();
   // 读取本地渠道号
   shellRW = new RWSharedPreferences(this, "addInfo");
   boolean isFirst = shellRW.getBooleanValue("isFirst");
   if (isFirst) {
     Intent in = new Intent(HomeActivity.this, MainGroup.class);
     startActivity(in);
     HomeActivity.this.finish();
   } else {
     shellRW.putBooleanValue("isFirst", true);
     Intent in = new Intent(HomeActivity.this, PhotoActivity.class);
     startActivity(in);
     HomeActivity.this.finish();
   }
 }
Example #25
0
 /** 获取订阅数据 */
 public void getOrderPrize() {
   try {
     for (int i = 0; i < isOrderPrize.length; i++) {
       isOrderPrize[i] = shellRW.getBooleanValue(Constants.orderPrize[i]);
     }
   } catch (NullPointerException e) {
     // TODO: handle exception
   }
 }
  private void addViewAndTouZhu(int redSize, int blueSize) {
    long betNums = caculateBetNums(redSize, blueSize);

    if (betNums > 10000) {
      dialogExcessive(10000);
    } else {
      BetAndGiftPojo betAndGiftPojo = new BetAndGiftPojo();

      String sessionid = shellRW.getStringValue("sessionid");
      String phonenum = shellRW.getStringValue("phonenum");
      String userno = shellRW.getStringValue("userno");
      String lotno = Constants.LOTNO_SSQ;

      betAndGiftPojo.setSessionid(sessionid);
      betAndGiftPojo.setPhonenum(phonenum);
      betAndGiftPojo.setUserno(userno);
      betAndGiftPojo.setBettype("bet");
      betAndGiftPojo.setBet_code("");
      betAndGiftPojo.setLotmulti("1");
      betAndGiftPojo.setBatchnum("1");
      betAndGiftPojo.setSellway("0");
      betAndGiftPojo.setLotno(lotno);
      betAndGiftPojo.setZhushu(String.valueOf(betNums));
      betAndGiftPojo.setAmount("" + betNums * 200);
      betAndGiftPojo.setIsSellWays("1");

      AddViewMiss addViewMiss = new AddViewMiss(this);
      CodeInfoMiss codeInfo = addViewMiss.initCodeInfo(2, 1);
      codeInfo.setTouZhuCode(
          SsqZiZhiXuanCode.simulateZhuma(selectedRedBallList, selectedBlueBallList));
      codeInfo.setZhuShu(Integer.valueOf(String.valueOf(betNums)));
      codeInfo.setAmt(Integer.valueOf(String.valueOf(betNums * 2)));
      codeInfo = setCodeInfoColor(codeInfo, selectedRedBallList, selectedBlueBallList);
      addViewMiss.addCodeInfo(codeInfo);

      ApplicationAddview app = (ApplicationAddview) getApplicationContext();
      app.setPojo(betAndGiftPojo);
      app.setAddviewmiss(addViewMiss);
      Intent intent = new Intent(SimulateSelectNumberActivity.this, OrderDetails.class);
      startActivity(intent);
    }
  }
  private boolean isLogin() {
    boolean isLogin = true;

    shellRW = new RWSharedPreferences(this, "addInfo");
    String sessionidStr = shellRW.getStringValue("sessionid");
    if (sessionidStr == null || sessionidStr.equals("")) {
      isLogin = false;
    }

    return isLogin;
  }
  // 是否綁定绑定邮箱
  private boolean isBindedEmail() {
    // 初始化全局共享参数
    shellRW = new RWSharedPreferences(this, "addInfo");
    String email = shellRW.getStringValue("email");

    if (email == null || email.equals("") || email.equals("null")) {
      return false;
    } else {
      return true;
    }
  }
  // 充值
  private void recharge(final RechargePojo rechargepojo) {
    RWSharedPreferences pre = new RWSharedPreferences(AlipaySecureActivity.this, "addInfo");
    sessionId = pre.getStringValue(ShellRWConstants.SESSIONID);
    phonenum = pre.getStringValue(ShellRWConstants.MOBILEID);
    userno = pre.getStringValue(ShellRWConstants.USERNO);
    ConnectivityManager ConnMgr =
        (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo info = ConnMgr.getActiveNetworkInfo();
    if (info.getExtraInfo() != null && info.getExtraInfo().equalsIgnoreCase("3gwap")) {
      Toast.makeText(this, "提醒:检测到您的接入点为3gwap,可能无法正确充值,请切换到3gnet!", Toast.LENGTH_LONG).show();
    }
    showDialog(0);
    new Thread(
            new Runnable() {

              @Override
              public void run() {
                String error_code = "00";
                message = "";
                // TODO Auto-generated method stub
                try {
                  rechargepojo.setSessionid(sessionId);
                  rechargepojo.setUserno(userno);
                  String re = RechargeInterface.getInstance().recharge(rechargepojo);

                  JSONObject obj = new JSONObject(re);
                  error_code = obj.getString("error_code");
                  message = obj.getString("message");
                  if (error_code.equals("0000")) {
                    url = obj.getString("return_url");
                  }
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                handler.handleMsg(error_code, message);
                progressdialog.dismiss();
              }
            })
        .start();
  }
 public void beginTouZhu() {
   int iZhuShu = getZhuShu();
   RWSharedPreferences pre = new RWSharedPreferences(FootballSixSemiFinal.this, "addInfo");
   String sessionIdStr = pre.getStringValue("sessionid");
   if (sessionIdStr == null || sessionIdStr.equals("")) {
     Intent intentSession = new Intent(FootballSixSemiFinal.this, UserLogin.class);
     startActivityForResult(intentSession, 0);
     liucb_btn_touzhu.setClickable(true);
   } else {
     if (isTouZhu()) {
       alert1("请至少选择一注!");
     } else if (iZhuShu * 2 > 20000) {
       DialogExcessive();
     } else {
       //				String sTouzhuAlert = "";
       //				sTouzhuAlert = getTouzhuAlert();
       //				alert(sTouzhuAlert,getFormatZhuma());
       initBetPojo();
       toorderdetail();
     }
   }
 }