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 CodeInfoMiss setCodeInfoColor(
      CodeInfoMiss codeInfo, List<Integer> redList, List<Integer> blueList) {
    StringBuffer redString = new StringBuffer();
    StringBuffer blueString = new StringBuffer();

    int redSize = redList.size();
    int blueSize = blueList.size();

    for (int red = 0; red < redSize - 1; red++) {
      redString.append(integerToString(redList.get(red)) + ",");
    }

    redString.append(integerToString(redList.get(redSize - 1)));
    codeInfo.addAreaCode(redString.toString(), Color.RED);

    for (int blue = 0; blue < blueSize - 1; blue++) {
      blueString.append(integerToString(blueList.get(blue)) + ",");
    }

    blueString.append(integerToString(blueList.get(blueSize - 1)));
    codeInfo.addAreaCode(blueString.toString(), Color.BLUE);

    return codeInfo;
  }