예제 #1
0
  /** 赠送彩票联网 */
  public void giftNet() {
    isMsg = false;
    betAndGift.setBettype("gift");
    betAndGift.setAmount(PublicMethod.toFen(Integer.toString(allAtm)));
    betAndGift.setTo_mobile_code(editPhone.getText().toString().replace(",", ","));
    betAndGift.setAdvice(editLanguage.getText().toString());
    showDialog(0); // 显示网络提示框 2010/7/4
    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                try {
                  obj = new JSONObject(str);
                  message = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, message);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                progressdialog.dismiss();
              }
            });
    t.start();
  }
  @Override
  public void errorCode_0000() {
    /** Add by pengcx 20130516 start */
    BeiJingSingleGameActivity.isBettingReturn = true;
    /** Add by pengcx 20130516 end */

    /** Add by pengcx 20130605 start */
    Intent intent = new Intent(this, BettingSuccessActivity.class);
    intent.putExtra("page", BettingSuccessActivity.BETTING);
    intent.putExtra("lotno", betAndGift.getLotno());
    intent.putExtra("amount", betAndGift.getAmount());
    startActivity(intent);
    /** Add by pengcx 20130605 end */
  }
예제 #3
0
 /** 投注提示框中的信息 */
 public void getTouzhuAlert() {
   if (type.equals("zc")) {
     zhushu.setText(betAndGift.getZhushu() + "注     ");
     jine.setText(
         iProgressQishu * (Integer.valueOf(betAndGift.getAmount()) / 100) * iProgressBeishu + "元");
   } else {
     zhushu.setText(ZixuanActivity.addView.getAllZhu() + "注     ");
     jine.setText(iProgressQishu * ZixuanActivity.addView.getAllAmt() * iProgressBeishu + "元");
   }
   //		return "注数:"
   //				+ ZixuanActivity.addView.getAllZhu() + "注     "
   //				+ "金额:" +
   //				+ iProgressQishu * ZixuanActivity.addView.getAllAmt() * iProgressBeishu
   //				+ "元";
 }
예제 #4
0
  @Override
  public void touzhuIssue(String issue) {
    // TODO Auto-generated method stub
    betAndGift.setBatchcode(issue);
    showDialog(0); // 显示网络提示框 2010/7/4
    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = JoinStartInterface.getInstance().joinStart(betAndGift);
                try {
                  obj = new JSONObject(str);
                  message = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, message);
                  isNoIssue(handler, obj);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                progressdialog.dismiss();
              }
            });
    t.start();
  }
예제 #5
0
  @Override
  public void touzhuIssue(String issue) {
    // TODO Auto-generated method stub
    betAndGift.setBatchcode(issue);
    progressdialog = UserCenterDialog.onCreateDialog(this);
    progressdialog.show();
    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                try {
                  JSONObject obj = new JSONObject(str);
                  String msg = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, msg);
                  isNoIssue(handler, obj);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                progressdialog.dismiss();
              }
            });
    t.start();
  }
예제 #6
0
 public int getAmt(int zhuShu) {
   if (betAndGift != null) {
     return zhuShu * betAndGift.getAmt();
   } else {
     return 0;
   }
 }
예제 #7
0
 /** 赋值 */
 public void setValue() {
   SpannableStringBuilder builder = new SpannableStringBuilder();
   int beishu = Integer.parseInt(betAndGift.getLotmulti());
   allAtm = Integer.parseInt(betAndGift.getAmount()) / 100;
   zhu = allAtm / beishu / betAndGift.getAmt();
   String zhushuStr =
       "赠送注数:" + zhu + "注\n\n" + "赠送倍数:" + beishu + "倍\n\n" + "赠送金额:" + allAtm + "元";
   builder.append(zhushuStr);
   builder.setSpan(
       new ForegroundColorSpan(Color.RED),
       zhushuStr.length() - (Integer.toString(allAtm).length() + 1),
       zhushuStr.length(),
       Spanned.SPAN_COMPOSING);
   this.zhushu.setText(builder, BufferType.EDITABLE);
   // this.zhushu.setText(zhushuStr);
   this.zhuma.setText(zhumaStr);
 }
예제 #8
0
 public void getCodeInfo(AddView addView) {
   for (int i = 0; i < balls.size(); i++) {
     String codeStr = getAddZhuma(i);
     CodeInfo codeInfo = addView.initCodeInfo(betAndGift.getAmt(), 1);
     codeInfo.addAreaCode(codeStr, Color.BLACK);
     codeInfo.setTouZhuCode(balls.get(i).getZhuma(balls, 1));
     addView.addCodeInfo(codeInfo);
   }
   addView.setIsJXcode(ballOne.getZhuma(balls, iProgressBeishu));
 }
예제 #9
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   setContentView(R.layout.order_hemai);
   context = this;
   ApplicationAddview app = (ApplicationAddview) getApplicationContext();
   betAndGift = app.getPojo();
   addview = app.getAddview();
   if (Constants.type.equals("zc")) {
     allAtm = Integer.valueOf(betAndGift.getAmount()) / 100;
     //			mAmount = Integer.valueOf(betAndGift.getAmount());
     mZhushu = Integer.valueOf(betAndGift.getZhushu());
   } else {
     allAtm = iProgressQishu * addview.getAllAmt() * iProgressBeishu;
   }
   init();
   initRadioGroup();
 }
예제 #10
0
 /** 再次启动提示框 */
 public void initAlerDialog() {
   touzhuCheck.setChecked(true);
   clearProgress();
   stateCheck();
   issueText.setText(PublicMethod.toIssue(betAndGift.getLotno()) + "期");
   textTitle.setText("注码:" + "共有" + addView.getSize() + "笔投注");
   addView.getCodeList().get(addView.getSize() - 1).setTextCodeColor(textZhuma, null, null);
   isCodeText(codeInfo);
   alertText.setText(getTouzhuAlert());
   touZhuDialog.show();
 }
예제 #11
0
 /** 直选机选投注提示框中的信息 */
 private String getTouzhuAlertJixuan() {
   int oneAmt = betAndGift.getAmt();
   int iZhushu = getZhushu();
   int beishu = mSeekBarBeishu.getProgress();
   return "注数:"
       + iZhushu
       + "注    "
       + "金额:"
       + (iZhushu * oneAmt * beishu)
       + "元"
       + "(冻结金额:"
       + (oneAmt * (mSeekBarQishu.getProgress() - 1) * iZhushu * beishu)
       + "元)";
 }
예제 #12
0
 private void init() {
   beishulayLayout = (LinearLayout) findViewById(R.id.beishulayout);
   zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
   jine = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_jine);
   caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
   caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
   issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
   textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
   textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
   if (type.equals("hight")) {
     issueText.setText("第" + betAndGift.getBatchcode() + "期");
   } else if (type.equals("zc")) {
     issueText.setText("第" + betAndGift.getBatchcode() + "期");
   } else {
     issueText.setText("第" + PublicMethod.toIssue(betAndGift.getLotno()) + "期");
   }
   if (type.equals("zc")) {
     textTitle.setText("注码:共有1笔投注");
     textZhuma.setText(betAndGift.getBet_code());
     beishulayLayout.setVisibility(View.GONE);
     codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
     codeInfo.setVisibility(View.GONE);
   } else {
     beishulayLayout.setVisibility(View.VISIBLE);
     initImageView();
     addview.getCodeList().get(addview.getSize() - 1).setTextCodeColor(textZhuma);
     textTitle.setText("注码:" + "共有" + addview.getSize() + "笔投注");
     codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
     isCodeText(codeInfo);
     codeInfo.setOnClickListener(
         new OnClickListener() {
           @Override
           public void onClick(View v) {
             // TODO Auto-generated method stub
             addview.createCodeInfoDialog(context);
             addview.showDialog();
           }
         });
   }
   if (betAndGift.isZhui()) {
     initZhuiJia();
   }
   getTouzhuAlert();
   Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
   Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
   cancel.setOnClickListener(
       new OnClickListener() {
         @Override
         public void onClick(View v) {
           // TODO Auto-generated method stub
           ZiXuanTouZhu.this.finish();
         }
       });
   ok.setOnClickListener(
       new OnClickListener() {
         public void onClick(View v) {
           RWSharedPreferences pre = new RWSharedPreferences(ZiXuanTouZhu.this, "addInfo");
           sessionId = pre.getStringValue("sessionid");
           phonenum = pre.getStringValue("phonenum");
           userno = pre.getStringValue("userno");
           if (userno.equals("")) {
             toLogin = true;
             Intent intentSession = new Intent(ZiXuanTouZhu.this, UserLogin.class);
             startActivityForResult(intentSession, 0);
           } else {
             touZhu();
           }
         }
       });
 }
예제 #13
0
 /** 初始化投注信息 */
 public void initBet() {
   betAndGift.setIsSellWays("1");
   betAndGift.setAmount("" + addview.getAllAmt() * iProgressBeishu * 100);
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setBettype("bet"); // 投注为bet,赠彩为gift
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setBet_code(addview.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
   lotno = PublicMethod.toLotno(betAndGift.getLotno());
   if (!type.equals("hight") && !type.equals("zc")) {
     betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno())); // 期号
   }
 }
예제 #14
0
  /** 赠送彩票联网 */
  public void giftNet() {
    isMsg = false;
    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));
    betAndGift.setBettype("gift");
    lotno = PublicMethod.toLotno(betAndGift.getLotno());
    betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno())); // 期号
    betAndGift.setTo_mobile_code(editPhone.getText().toString().replace(",", ","));
    betAndGift.setAdvice(editLanguage.getText().toString());
    showDialog(0); // 显示网络提示框 2010/7/4
    // 加入是否改变切入点判断 陈晨 8.11
    Thread t =
        new Thread(
            new Runnable() {
              String str = "00";

              @Override
              public void run() {
                str = BetAndGiftInterface.getInstance().betOrGift(betAndGift);
                try {
                  obj = new JSONObject(str);
                  message = obj.getString("message");
                  String error = obj.getString("error_code");
                  handler.handleMsg(error, message);
                } catch (JSONException e) {
                  e.printStackTrace();
                }
                progressdialog.dismiss();
              }
            });
    t.start();
  }
예제 #15
0
  /** 初始化组件 */
  public void init() {
    isDialog = false;
    if (betAndGift.isZhui()) {
      initZhuiJia();
    }
    zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
    jine = (TextView) findViewById(R.id.alert_dialog_touzhu_text_one);
    caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
    caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
    issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    issueText.setText("第" + PublicMethod.toIssue(betAndGift.getLotno()) + "期");
    getTouzhuAlert();
    if (type.equals("zc")) {
      textTitle.setText("注码:共有1笔投注");
      textZhuma.setText(betAndGift.getBet_code());
    } else {
      initImageView();
      ZixuanActivity.addView
          .getCodeList()
          .get(ZixuanActivity.addView.getSize() - 1)
          .setTextCodeColor(textZhuma);
      textTitle.setText("注码:" + "共有" + ZixuanActivity.addView.getSize() + "笔投注");
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      isCodeText(codeInfo);
      codeInfo.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              ZixuanActivity.addView.createCodeInfoDialog(GiftActivity.this);
              ZixuanActivity.addView.showDialog();
            }
          });
    }
    Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    editLanguage = (EditText) findViewById(R.id.gift_edit_language);
    editLanguage.setText(languageStr);
    editPhone = (EditText) findViewById(R.id.gift_edit_phone);
    ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    ok.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            addPerson();
            if (checkedPersons.size() != 0) {
              beginTouZhu();
            } else {
              Toast.makeText(
                      GiftActivity.this, R.string.ruyichuanqing_atleastone, Toast.LENGTH_SHORT)
                  .show();
            }
          }
        });
    cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    cancel.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            // TODO Auto-generated method stub
            finish();
          }
        });
    language = (ImageButton) findViewById(R.id.gift_img_language);
    language.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            if (Constants.avdiceStr == null) {
              giftMsgNet();
            } else {
              adviceDialog();
            }
          }
        });
    phone = (ImageButton) findViewById(R.id.gift_img_phone);
    phone.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            editPhone.setText("");
            checkedPersons.clear();
            LinkDialog();
          }
        });
    //		zhuma = (TextView) findViewById(R.id.gift_text_zhuma);
    //		zhushu = (TextView) findViewById(R.id.gift_text_zhushu);
    editLanguage.setOnTouchListener(
        new OnTouchListener() {

          @Override
          public boolean onTouch(View arg0, MotionEvent arg1) {
            // TODO Auto-generated method stub
            editLanguage.setFocusable(true);
            return false;
          }
        });
    editPhone.setOnTouchListener(
        new OnTouchListener() {

          @Override
          public boolean onTouch(View arg0, MotionEvent arg1) {
            // TODO Auto-generated method stub
            editPhone.setFocusable(true);
            return false;
          }
        });
  }
  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);
    }
  }
예제 #17
0
  private void init() {
    zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
    jine = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_jine);
    caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
    caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
    issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    getNetIssue();

    if (type.equals("zc")) {
      textTitle.setText("注码:共有1笔投注");
      textZhuma.setText(betAndGift.getBet_code());
    } else {
      initImageView();
      CodeInfo code = addviewmiss.getCodeList().get(addviewmiss.getSize() - 1);
      code.setTextCodeColor(textZhuma, code.getLotoNo(), code.getTouZhuType());
      textTitle.setText("注码:" + "共有" + addviewmiss.getSize() + "笔投注");
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      isCodeText(codeInfo);
      codeInfo.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              addviewmiss.createCodeInfoDialog(ZiXuanTouZhu.this);
              addviewmiss.showDialog();
            }
          });
    }
    if (betAndGift.isZhui()) {
      initZhuiJia();
    }
    getTouzhuAlert();
    Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            alertExit(getString(R.string.buy_alert_exit_detail));
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            RWSharedPreferences pre = new RWSharedPreferences(ZiXuanTouZhu.this, "addInfo");
            sessionId = pre.getStringValue("sessionid");
            phonenum = pre.getStringValue("phonenum");
            userno = pre.getStringValue("userno");
            if (userno.equals("")) {
              toLogin = true;
              Intent intentSession = new Intent(ZiXuanTouZhu.this, UserLogin.class);
              startActivityForResult(intentSession, 0);
            } else {
              touZhu();
            }
          }
        });
  }
예제 #18
0
  public void init() {
    beishulayLayout = (LinearLayout) findViewById(R.id.beishulayout);
    if (betAndGift.isZhui()) {
      initZhuiJia();
    }
    zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
    jine = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_jine);
    caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
    caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
    issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    if (Constants.type.equals("hight") || Constants.type.equals("zc")) {
      issueText.setText("第" + betAndGift.getBatchcode() + "期");
    } else {
      getNetIssue();
    }
    getTouzhuAlert();
    if (Constants.type.equals("zc")) {
      textTitle.setText("注码:共有1笔投注");
      textZhuma.setText(betAndGift.getBet_code());
      initImageView();
      //			beishulayLayout.setVisibility(View.GONE);
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      codeInfo.setVisibility(View.GONE);
    } else {
      beishulayLayout.setVisibility(View.VISIBLE);
      initImageView();
      CodeInfo code = addview.getCodeList().get(addview.getSize() - 1);
      code.setTextCodeColor(textZhuma, code.getLotoNo(), code.getTouZhuType());
      textTitle.setText("注码:" + "共有" + addview.getSize() + "笔投注");
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      isCodeText(codeInfo);
      codeInfo.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              addview.createCodeInfoDialog(context);
              addview.showDialog();
            }
          });
    }
    Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            alertExit(getString(R.string.buy_alert_exit_detail));
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            RWSharedPreferences pre = new RWSharedPreferences(JoinStartActivity.this, "addInfo");
            sessionId = pre.getStringValue("sessionid");
            phonenum = pre.getStringValue("phonenum");
            userno = pre.getStringValue("userno");
            if (userno.equals("")) {
              toLogin = true;
              Intent intentSession = new Intent(JoinStartActivity.this, UserLogin.class);
              startActivityForResult(intentSession, 0);
            } else {
              isJoin();
            }
          }
        });
    titleText = (TextView) findViewById(R.id.layout_join_text_title);
    renText = (TextView) findViewById(R.id.layout_join_text_rengou);
    baoText = (TextView) findViewById(R.id.layout_join_text_baodi);
    buyEdit = (EditText) findViewById(R.id.layout_join_edit_rengou);
    minEdit = (EditText) findViewById(R.id.layout_join_edit_gendan);
    safeEdit = (EditText) findViewById(R.id.layout_join_edit_baodi);
    descriptionEdit = (EditText) findViewById(R.id.layout_join_edit_description);
    buyEdit.setText("1");
    safeEdit.setText("1");
    minEdit.setText("1");
    deductSpinner = (Spinner) findViewById(R.id.layout_join_start_spinner);
    deductSpinner.setSelection(9);
    // 初始化spinner
    deductSpinner.setOnItemSelectedListener(
        new OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            commisionRation = (String) deductSpinner.getSelectedItem();
          }

          @Override
          public void onNothingSelected(AdapterView<?> arg0) {}
        });
    // 赋值
    renText.setText(
        "占总额" + progress(isNull(buyEdit.getText().toString()), "" + allAtm) + "%"); // 总金额
    baoText.setText(
        "占总额" + progress(isNull(safeEdit.getText().toString()), "" + allAtm) + "%"); // 总金额
    onEditTextClik();
  }
 public void initBettingInfo() {
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setBettype("bet");
   betAndGift.setAmount("" + getBettingAccount() * 100);
   betAndGift.setLotmulti("" + getBettingMutile());
   betAndGift.setBet_code(getBettingCode());
   betAndGift.setIsSellWays("1");
   betAndGift.setBatchnum("1");
   betAndGift.setBatchcode(nowIssueString);
   betAndGift.setLotno(lotnoString);
 }
예제 #20
0
  private void init() {
    initImageView();
    if (betAndGift.isZhui()) {
      initZhuiJia();
    }
    zhuiqishezhi = (LinearLayout) findViewById(R.id.zhuiqishezhi);
    zhuiqi = (Button) findViewById(R.id.zhuiqi);
    zhuiqi.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            if (state == 0) {
              getbatchcodes();
              state = 2;
            } else if (state == 1) {
              zhuiqishezhi.setVisibility(View.VISIBLE);
              state = 2;
            } else if (state == 2) {
              zhuiqishezhi.setVisibility(View.GONE);
              state = 1;
            }
          }
        });
    zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
    jine = (TextView) findViewById(R.id.alert_dialog_touzhu_text_one);
    caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
    caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
    issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    CodeInfo code = addviewmiss.getCodeList().get(addviewmiss.getSize() - 1);
    code.setTextCodeColor(textZhuma, code.getLotoNo(), code.getTouZhuType());
    if (Constants.type.equals("luck")) {
      getNetIssue();
    } else {
      issueText.setText("第" + PublicMethod.toIssue(betAndGift.getLotno()) + "期");
    }
    textTitle.setText("注码:" + "共有" + addviewmiss.getSize() + "笔投注");
    getTouzhuAlert();
    Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
    isCodeText(codeInfo);
    CheckBox checkPrize = (CheckBox) findViewById(R.id.alert_dialog_touzhu_check_prize);
    checkPrize.setChecked(true);

    // 设置betAndGift.prizeend与checkPrize保持一致
    betAndGift.setPrizeend("1");

    checkPrize.setButtonDrawable(R.drawable.check_on_off);
    checkPrize.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            if (isChecked) {
              betAndGift.setPrizeend("1");
            } else {
              betAndGift.setPrizeend("0");
            }
          }
        });
    codeInfo.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            addviewmiss.createCodeInfoDialog(ZixuanZhuihao.this);
            addviewmiss.showDialog();
          }
        });
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            finish();
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            RWSharedPreferences pre = new RWSharedPreferences(ZixuanZhuihao.this, "addInfo");
            sessionId = pre.getStringValue("sessionid");
            phonenum = pre.getStringValue("phonenum");
            userno = pre.getStringValue("userno");
            if (userno.equals("")) {
              toLogin = true;
              Intent intentSession = new Intent(ZixuanZhuihao.this, UserLogin.class);
              startActivityForResult(intentSession, 0);
            } else {
              touZhu();
            }
          }
        });
  }
예제 #21
0
 /** 初始化投注信息 */
 public void initBet() {
   betAndGift.setIsSellWays("1");
   betAndGift.setAmount("" + addviewmiss.getAllAmt() * iProgressBeishu * 100);
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setDescription("");
   betAndGift.setBettype("bet"); // 投注为bet,赠彩为gift
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setBet_code(addviewmiss.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
   lotno = PublicMethod.toLotno(betAndGift.getLotno());
   if (PublicMethod.toIssue(betAndGift.getLotno()) != null) {
     betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno())); // 期号
   }
   if (state == 2) {
     betAndGift.setSubscribeInfo(getSubstringforset());
   } else {
     betAndGift.setSubscribeInfo("");
   }
 }
예제 #22
0
 private void initBetPojo(
     String zhuma, String lotno, String amount, String beishu, String lomit, String oneAmount) {
   initPojo();
   betPojo.setPhonenum(phonenum);
   betPojo.setSessionid(sessionid);
   betPojo.setUserno(userno);
   betPojo.setBet_code(zhuma);
   betPojo.setLotmulti(beishu);
   betPojo.setLotno(lotno);
   betPojo.setBatchnum("1");
   betPojo.setBettype("bet");
   betPojo.setAmount(
       Integer.valueOf(amount) / Integer.valueOf(lomit) * Integer.valueOf(beishu) + "");
   betPojo.setAmt(0);
   betPojo.setOneAmount(oneAmount);
   betPojo.setIsSellWays("1");
 }
예제 #23
0
 /** 初始化投注信息 */
 public void initBet() {
   betAndGift.setIsSellWays("1");
   betAndGift.setAmount("" + addviewmiss.getAllAmt() * iProgressBeishu * 100);
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setDescription("");
   betAndGift.setBettype("bet"); // 投注为bet,赠彩为gift
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setBet_code(addviewmiss.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
 }
예제 #24
0
  /** /** 对合买对象进行赋值 */
  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.setDescription(descriptionEdit.getText().toString());
    betAndGift.setSessionid(sessionId);
    betAndGift.setPhonenum(phonenum);
    betAndGift.setUserno(userno);
    if (!Constants.type.equals("zc")) {
      betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti 倍数 投注的倍数
    }
    betAndGift.setBatchnum("" + iProgressQishu); // batchnum 追号期数 默认为1(不追号)
    if (!Constants.type.equals("zc")) {
      betAndGift.setIsSellWays("1");
      betAndGift.setAmount("" + addview.getAllAmt() * iProgressBeishu * 100);
      betAndGift.setBet_code(addview.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
    } else {
      betAndGift.setIsSellWays("");

      betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti 倍数 投注的倍数
      //			int amount = Integer.valueOf(betAndGift.getAmount()) * iProgressBeishu;
      String zhuShu = String.valueOf(mZhushu * iProgressBeishu);
      String amount = String.valueOf(mZhushu * iProgressBeishu * 200);
      betAndGift.setAmount(amount);
      betAndGift.setZhushu(zhuShu);
    }
  }
예제 #25
0
  /** 第一次启动投注提示框 */
  public void initTouZhuDialog() {
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.alert_dialog_touzhu_new, null);
    touZhuDialog = new AlertDialog.Builder(this).setTitle("您选择的是").create();
    touZhuDialog.show();
    initImageView(v);
    if (betAndGift.isZhui()) {
      initZhuiJia(v);
    }
    issueText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    alertText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_one);
    textZhuma = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    addView.getCodeList().get(addView.getSize() - 1).setTextCodeColor(textZhuma);
    textTitle = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    textTitle.setText("注码:" + "共有" + addView.getSize() + "笔投注");
    issueText.setText(PublicMethod.toIssue(betAndGift.getLotno()) + "期");
    alertText.setText(getTouzhuAlertJixuan());
    Button cancel = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_ok);
    codeInfo = (Button) v.findViewById(R.id.alert_dialog_touzhu_btn_look_code);
    isCodeText(codeInfo);
    codeInfo.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            addView.createCodeInfoDialog();
            addView.showDialog();
          }
        });
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            touZhuDialog.cancel();
            toLogin = false;
            clearProgress();
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            toLogin = false;
            initBet();
            touZhuDialog.cancel();
            // TODO Auto-generated method stub
            if (isGift) {
              String code = addView.getsharezhuma();
              toActivity(code);
            } else if (isJoin) {
              toJoinActivity();
            } else if (isTouzhu) {
              touZhuNet();
            }
            clearProgress();
          }
        });
    CheckBox checkPrize = (CheckBox) v.findViewById(R.id.alert_dialog_touzhu_check_prize);
    checkPrize.setChecked(true);
    checkPrize.setButtonDrawable(R.drawable.check_on_off);
    checkPrize.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            if (isChecked) {
              betAndGift.setPrizeend("1");
            } else {
              betAndGift.setPrizeend("0");
            }
          }
        });
    check = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu_check);
    joinCheck = (RadioButton) v.findViewById(R.id.alert_dialog_join_check);
    touzhuCheck = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu1_check);
    touzhuCheck.setChecked(true);
    textAlert = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_alert);
    check.setPadding(50, 0, 0, 0);
    check.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    check.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isGift = isChecked;
          }
        });
    joinCheck.setPadding(50, 0, 0, 0);
    joinCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    joinCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isJoin = isChecked;
          }
        });
    touzhuCheck.setPadding(50, 0, 0, 0);
    touzhuCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    touzhuCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isTouzhu = isChecked;
          }
        });
    stateCheck();
    touZhuDialog.setCancelable(false);
    touZhuDialog.getWindow().setContentView(v);
  }
예제 #26
0
 /** 初始化投注信息 */
 public void initBet() {
   betAndGift.setIsSellWays("1"); // 多注投
   betAndGift.setSessionid(sessionId);
   betAndGift.setPhonenum(phonenum);
   betAndGift.setUserno(userno);
   betAndGift.setBettype("bet"); // 投注为bet,赠彩为gift
   betAndGift.setLotmulti("" + iProgressBeishu); // lotmulti    倍数   投注的倍数
   betAndGift.setBatchnum("" + iProgressQishu); // batchnum    追号期数 默认为1(不追号)
   betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno()));
   betAndGift.setAmount(
       ""
           + addView.getSize()
               * iProgressBeishu
               * betAndGift.getAmt()
               * 100); // amount      金额 单位为分(总金额)
   //		betAndGift.setBet_code(ballOne.getZhuma(balls, iProgressBeishu));
   betAndGift.setBet_code(addView.getTouzhuCode(iProgressBeishu, betAndGift.getAmt() * 100));
   lotno = PublicMethod.toLotno(betAndGift.getLotno());
   betAndGift.setBatchcode(PublicMethod.toIssue(betAndGift.getLotno()));
 }
예제 #27
0
 private void initBetPojo(
     String zhuma, String issue, String lotMulti, String lotno, String amount, String oneAmount) {
   initPojo();
   betPojo.setPhonenum(phonenum);
   betPojo.setSessionid(sessionid);
   betPojo.setUserno(userno);
   betPojo.setBet_code(zhuma);
   betPojo.setLotno(lotno);
   betPojo.setBatchnum(issue);
   betPojo.setLotmulti(lotMulti);
   betPojo.setBettype("bet");
   betPojo.setAmount(amount);
   betPojo.setAmt(0);
   betPojo.setIsSellWays("1");
   betPojo.setOneAmount(oneAmount);
 }
예제 #28
0
  /** 第一次启动投注提示框 */
  public void initTouZhuDialog() {
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.alert_dialog_touzhu_new, null);
    touZhuDialog = new Dialog(this, R.style.MyDialog);
    initImageView(v);
    if (betAndGift.isZhui()) {
      initZhuiJia(v);
    }
    issueText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    alertText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_one);
    textZhuma = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    addView.getCodeList().get(addView.getSize() - 1).setTextCodeColor(textZhuma, null, null);
    issueText.setText(PublicMethod.toIssue(betAndGift.getLotno()) + "期");
    alertText.setText(getTouzhuAlert());
    textTitle.setText("注码:" + "共有" + addView.getSize() + "笔投注");
    Button cancel = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_ok);
    codeInfo = (Button) v.findViewById(R.id.alert_dialog_touzhu_btn_look_code);
    isCodeText(codeInfo);
    codeInfo.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            addView.createCodeInfoDialog();
            addView.showDialog();
          }
        });
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            toLogin = false;
            touZhuDialog.cancel();
            clearProgress();
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            RWSharedPreferences pre = new RWSharedPreferences(ZixuanActivity.this, "addInfo");
            sessionId = pre.getStringValue("sessionid");
            phonenum = pre.getStringValue("phonenum");
            userno = pre.getStringValue("userno");
            if (userno.equals("")) {
              toLogin = true;
              Intent intentSession = new Intent(ZixuanActivity.this, UserLogin.class);
              startActivityForResult(intentSession, 0);
            } else {
              touZhu();
            }
          }
        });
    CheckBox checkPrize = (CheckBox) v.findViewById(R.id.alert_dialog_touzhu_check_prize);
    checkPrize.setChecked(true);

    // 设置betAndGift.prizeend与checkPrize保持一致
    betAndGift.setPrizeend("1");

    checkPrize.setButtonDrawable(R.drawable.check_on_off);
    checkPrize.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            if (isChecked) {
              betAndGift.setPrizeend("1");
            } else {
              betAndGift.setPrizeend("0");
            }
          }
        });
    check = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu_check);
    joinCheck = (RadioButton) v.findViewById(R.id.alert_dialog_join_check);
    touzhuCheck = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu1_check);
    touzhuCheck.setChecked(true);
    textAlert = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_alert);
    check.setPadding(50, 0, 0, 0);
    check.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    check.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isGift = isChecked;
          }
        });
    joinCheck.setPadding(50, 0, 0, 0);
    joinCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    joinCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isJoin = isChecked;
          }
        });
    touzhuCheck.setPadding(50, 0, 0, 0);
    touzhuCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    touzhuCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isTouzhu = isChecked;
          }
        });
    stateCheck();
    touZhuDialog.setCancelable(false);
    touZhuDialog.setContentView(v);
    touZhuDialog.show();
  }