Exemplo n.º 1
0
 public ArrayList<Option> getDropdownValue(int nDropdown_name, int userId)
     throws BaseAppException {
   ArrayList objOptions = new ArrayList<Option>();
   ArrayList list = new ArrayList();
   Iterator itr = null;
   EZBusinessServices eZservice = new EZBusinessServices();
   String dropDownName = "";
   switch (nDropdown_name) {
     case EducationConstant.CLASS_DROPDOWN_VALUE:
       objOptions.add(new Option("Please Specify", ""));
       itr = new QuestionBankService().getSelectedClassOfStudent(userId).iterator();
       while (itr.hasNext()) {
         ClassCertTO classObj = (ClassCertTO) itr.next();
         objOptions.add(
             new Option(classObj.getClassCertName(), String.valueOf(classObj.getClassCertId())));
       }
       dropDownName = "Class";
       break;
     case EducationConstant.SUBJECT_DROPDOWN_VALUE:
       objOptions.add(new Option("Please Specify", ""));
       itr = new QuestionBankService().getSelectedSubjectOfStudent(userId).iterator();
       while (itr.hasNext()) {
         TopicSubTopicTO subjectObj = (TopicSubTopicTO) itr.next();
         objOptions.add(
             new Option(subjectObj.getSubjectValue(), String.valueOf(subjectObj.getSubjectId())));
       }
       dropDownName = "Subject";
       break;
   }
   if (objOptions.size() == 0)
     throw new BussMasterDataMissingException("Master Data Missing for-" + dropDownName);
   return objOptions;
 }
Exemplo n.º 2
0
  public ArrayList<Option> getDropdownValue(int nDropdown_name) throws BaseAppException {

    ArrayList objOptions = new ArrayList<Option>();
    ArrayList list = new ArrayList();
    Iterator itr = null;
    EZBusinessServices eZservice = new EZBusinessServices();
    String dropDownName = "";
    switch (nDropdown_name) {
      case EducationConstant.CLASS_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        itr = eZservice.getClassORCertList().iterator();
        while (itr.hasNext()) {
          ClassCertTO classObj = (ClassCertTO) itr.next();
          objOptions.add(
              new Option(classObj.getClassCertName(), String.valueOf(classObj.getClassCertId())));
        }
        dropDownName = "Class";
        break;
      case EducationConstant.SUBJECT_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        itr = eZservice.getSubjects().iterator();
        while (itr.hasNext()) {
          TopicSubTopicTO subjectObj = (TopicSubTopicTO) itr.next();
          objOptions.add(
              new Option(subjectObj.getSubjectValue(), String.valueOf(subjectObj.getSubjectId())));
        }
        dropDownName = "Subject";
        break;
      case EducationConstant.QUESTION_STATUS_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        objOptions.add(
            new Option("Approved", String.valueOf(EducationConstant.QUESTION_STATUS_APPROVED)));
        objOptions.add(
            new Option("Inactive", String.valueOf(EducationConstant.QUESTION_STATUS_INACTIVE)));
        objOptions.add(
            new Option("Pending", String.valueOf(EducationConstant.QUESTION_STATUS_PENDING)));
        objOptions.add(
            new Option("Rejected", String.valueOf(EducationConstant.QUESTION_STATUS_REJECTED)));
        dropDownName = "Question Status";
        break;
      case EducationConstant.QUESTION_COMPLEXITY_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        itr = eZservice.getQuestionComplexity().iterator();
        while (itr.hasNext()) {
          LinkQTOClassTO classComplexityObj = (LinkQTOClassTO) itr.next();
          objOptions.add(
              new Option(
                  classComplexityObj.getComplexityValue(), classComplexityObj.getComplexityId()));
        }
        dropDownName = "Question Complexity";
        break;
      case EducationConstant.TOPICS_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        itr = eZservice.getTopicList().iterator();
        while (itr.hasNext()) {
          TopicSubTopicTO topicsObj = (TopicSubTopicTO) itr.next();
          objOptions.add(
              new Option(topicsObj.getTopicvalue(), String.valueOf(topicsObj.getTopicId())));
        }
        dropDownName = "Topic";
        break;
      case EducationConstant.SUBTOPICS_DROPDOWN_VALUE:
        objOptions.add(new Option("Please Specify", ""));
        itr = eZservice.getSubTopicList().iterator();
        while (itr.hasNext()) {
          TopicSubTopicTO subTopicsObj = (TopicSubTopicTO) itr.next();
          objOptions.add(
              new Option(
                  subTopicsObj.getSubTopicValue(),
                  String.valueOf(subTopicsObj.getSubjectTopicId())));
        }
        dropDownName = "SubTopic";
        break;
      case EducationConstant.USER_REGISTRATION_STATUS_DROPDOWN_VALUE:
        // objOptions.add(new Option("Please Specify", ""));
        list = eZservice.getRegistration_Status_List();
        list.add(0, new DropDownOption("Please Specify", ""));
        objOptions = list;
        dropDownName = "Registration Status";
        break;
      case EducationConstant.CONTENT_TYPE_DROPDOWN_VALUE:
        // objOptions.add(new Option("Please Specify", ""));
        list = eZservice.getContent_TypeList();
        list.add(0, new DropDownOption("Please Specify", ""));
        objOptions = list;
        dropDownName = "ContentType";
        break;
    }
    // Condt to check MasterData Missing
    if (objOptions.size() == 0)
      throw new BussMasterDataMissingException("Master Data Missing for-" + dropDownName);
    return objOptions;
  }