Esempio n. 1
0
 public void saveCourseID(int courseID) {
   if (getTarget() == 2) {
     if (getSelect() == 0) {
       UserDaoImp.getInstance(this).updateUserSelect(getUserID(), 1);
       UserDaoImp.getInstance(this).updateUserCourseID(getUserID(), courseID);
       UserDaoImp.getInstance(this).updateUserDate(getUserID(), getDate());
       syncUserData();
     }
   }
 }
Esempio n. 2
0
  public void insertUserData() {
    UserBean userBean = null;
    userBean = new UserBean();
    userBean.setUserID(getUserID());
    userBean.setTarget(1);
    userBean.setCourseID(0);
    userBean.setDate(getDate());
    UserDaoImp.getInstance(this).insertUserData(userBean);
    //		syncUserData();

  }
Esempio n. 3
0
  @Override
  protected void initData() {
    // TODO Auto-generated method stub
    initTrainBeans();
    userBean = UserDaoImp.getInstance(this).getUserBeanByUserID(getUserID());
    if (userBean != null) {
      courseID = userBean.getCourseID();
      if (courseID >= 0 && mBundle.getInt(Config.TYPE, -1) < 0) {
        setTrainBean(mTrainBeans.get(courseID));

        if (getBLEManager().isConnected()) addFragment(R.id.course_panel, new UploadDataFrag());
        else addFragment(R.id.course_panel, new ActiveFrag());
      } else {
        addFragment(R.id.course_panel, new CoursePrimaryFrag());
      }
    } else {
      //			addFragment(R.id.course_panel, new SelectCourseFrag());
      insertUserData();
      addFragment(R.id.course_panel, new CoursePrimaryFrag());
    }
  }
Esempio n. 4
0
 public int getSelect() {
   return UserDaoImp.getInstance(this).getSelectByUserID(getUserID());
 }