예제 #1
0
 private void namesToggleSelected() {
   RadioButton selected = (RadioButton) this.namesGroup.getSelectedToggle();
   if (selected.getText().equals("Boy")) {
     this.names.getItems().setAll(this.boyNames);
   } else {
     this.names.getItems().setAll(this.girlNames);
   }
 }
예제 #2
0
 private void add_name() {
   RadioButton selected = (RadioButton) this.namesGroup.getSelectedToggle();
   if (selected.getText().equals("Boy")) {
     if (!this.name.getText().equals("")) {
       String s = this.name.getText();
       this.boyNames.add(s);
       this.names.getItems().setAll(this.boyNames);
       this.name.clear();
     }
   } else {
     if (!this.name.getText().equals("")) {
       String s = this.name.getText();
       this.girlNames.add(s);
       this.names.getItems().setAll(this.girlNames);
       this.name.clear();
     }
   }
 }
예제 #3
0
  public void initialize(URL location, ResourceBundle resources) {
    txtFieldGeldEingabe.textProperty().bindBidirectional(viewModel.geldEingabe());
    txtFieldZeitEingabe.textProperty().bindBidirectional(viewModel.zeitEinagabe());
    labelQualitaet.textProperty().bindBidirectional(viewModel.qualitaetText());
    labelZeit.textProperty().bindBidirectional(viewModel.zeitText());
    labelSkill.textProperty().bindBidirectional(viewModel.skillText());
    labelGehalt.textProperty().bindBidirectional(viewModel.gehaltText());
    labelGeld.textProperty().bindBidirectional(viewModel.geldText());
    labelGesundheit.textProperty().bindBidirectional(viewModel.gesundheitText());
    labelMotivation.textProperty().bindBidirectional(viewModel.motivationText());
    SliderGehalt.valueProperty().bindBidirectional(viewModel.gehaltProperty());
    SliderGehalt.setValue(1500);
    SliderGehalt.setShowTickMarks(false);
    SliderGehalt.setMajorTickUnit(1);
    SliderGehalt.setMinorTickCount(0);
    SliderGehalt.setBlockIncrement(100);
    SliderGehalt.setSnapToTicks(true);

    labelNeuesGehalt.textProperty().bind(SliderGehalt.valueProperty().asString("%.0f"));

    buttonStart.setOnAction(
        event -> {
          buttonNachsteRunde.setDisable(false);
          buttonStart.setDisable(true);
          txtFieldGeldEingabe.setDisable(true);
          txtFieldZeitEingabe.setDisable(true);
          viewModel.startRound();
        });

    buttonNachsteRunde.setOnAction(
        event -> {
          RadioButton rb = (RadioButton) ToggleGroupSelect.getSelectedToggle();
          viewModel.nextRound(rb.getText());
        });

    viewModel.setButtonNaechsteRunde(buttonNachsteRunde);
    viewModel.setButtonStart(buttonStart);
    viewModel.setTxtFieldGeldEingabe(txtFieldGeldEingabe);
    viewModel.setTxtFieldZeitEingabe(txtFieldZeitEingabe);
  }
  @FXML
  public void registrarArticulo(ActionEvent e) {
    Articulo art = new Articulo();
    cruds = new CRUDArticulos();
    boolean registrado;
    int indiceCategoria = cmbCategorias.getSelectionModel().getSelectedIndex() + 1;
    art.setNombre(tfNombreArticulo.getText());
    art.setMarca(tfMarca.getText());
    art.setDescripcion_estado(txaDescripcion.getText());
    art.setEstado(true);

    RadioButton chk = (RadioButton) acceso.getSelectedToggle();
    if (chk.getText().equals("Prestable")) art.setAcceso(true);
    else art.setAcceso(false);

    art.setIdcategoria(indiceCategoria);
    registrado = cruds.registrarArticulo(art);
    System.out.println(art.getIdcategoria() + "" + art.isAcceso());

    if (registrado) JOptionPane.showMessageDialog(null, "algo salio mal menor");
    else JOptionPane.showMessageDialog(null, "se ha registrado con exito menor");
  }
  private Configuration getChosenConfiguration() {
    ObservableList<Node> children = dialog.configurationsBox.getChildren();

    for (Node child : children) {
      if (child instanceof RadioButton) {
        RadioButton radioButton = (RadioButton) child;

        if (radioButton.isSelected()) {
          String text = radioButton.getText();
          List<Configuration> configurations = dialog.configurations;

          for (Configuration configuration : configurations) {
            String name = configuration.getName();

            if (name.equals(text)) {
              return configuration;
            }
          }
        }
      }
    }

    return null;
  }
  @FXML
  void Personal_Information_save(ActionEvent event) {
    RadioButton chk = null,
        chk1 = null,
        chk2 = null,
        chk3 = null,
        chk4 = null,
        chk5 = null,
        chk6 = null;
    chk = (RadioButton) phd_CS.getToggleGroup().getSelectedToggle();
    chk = (RadioButton) phd_ECE.getToggleGroup().getSelectedToggle();
    chk = (RadioButton) phd_CB.getToggleGroup().getSelectedToggle();
    chk1 = (RadioButton) gender_male.getToggleGroup().getSelectedToggle();
    chk1 = (RadioButton) gender_female.getToggleGroup().getSelectedToggle();
    chk2 = (RadioButton) Category_general.getToggleGroup().getSelectedToggle();
    chk2 = (RadioButton) Category_obc.getToggleGroup().getSelectedToggle();
    chk2 = (RadioButton) Category_st.getToggleGroup().getSelectedToggle();
    chk2 = (RadioButton) Category_sc.getToggleGroup().getSelectedToggle();
    chk3 = (RadioButton) physically_disabled_no.getToggleGroup().getSelectedToggle();
    chk3 = (RadioButton) physically_disabled_no.getToggleGroup().getSelectedToggle();
    chk4 = (RadioButton) children_yes.getToggleGroup().getSelectedToggle();
    chk4 = (RadioButton) children_no.getToggleGroup().getSelectedToggle();
    chk5 = (RadioButton) cgpa.getToggleGroup().getSelectedToggle();
    chk5 = (RadioButton) marks.getToggleGroup().getSelectedToggle();
    chk6 = (RadioButton) cgpa1.getToggleGroup().getSelectedToggle();
    chk6 = (RadioButton) marks1.getToggleGroup().getSelectedToggle();

    int check = 1;

    if (Email.getText().isEmpty()
        || Name.getText().isEmpty()
        || Address.getText().isEmpty()
        || mobile_no.getText().isEmpty()
        || chk == null
        || phd_ref1.getValue() == null
        || chk1 == null
        || chk2 == null
        || chk3 == null
        || DOB.getValue() == null
        || chk4 == null
        || father_name.getText().isEmpty()
        || nationality.getValue() == null
        || permanent_address.getText().isEmpty()
        || pin_code.getText().isEmpty()
        || tenth_board.getText().isEmpty()
        || tenth_marks.getText().isEmpty()
        || ten_year_passing.getValue() == null
        || twelth_board.getText().isEmpty()
        || twelth_marks.getText().isEmpty()
        || twelvth_year_passing.getValue() == null
        || degree.getText().isEmpty()
        || department.getText().isEmpty()
        || name_of_clg.getText().isEmpty()
        || name_of_uni.getText().isEmpty()
        || city.getText().isEmpty()
        || state.getValue() == null
        || year_of_graduation.getValue() == null
        || chk5 == null) {
      check = 0;
    }
    if (title1_handle.isSelected()) {
      if (Pref1.getValue() == null
          || Pref2.getValue() == null
          || Pref3.getValue() == null
          || Pref3.getValue() == null) check = 0;
    }
    if (title2_handle.isSelected()) {
      if (pg_degree.getText().isEmpty()
          || pg_department.getText().isEmpty()
          || pg_college.getText().isEmpty()
          || pg_title.getText().isEmpty()
          || pg_city.getText().isEmpty()
          || pg_state.getValue() == null
          || pg_year.getValue() == null
          || chk6 == null) {
        check = 0;
      }
    }

    if (title3_handle.isSelected()) {
      if (exam_name.getText().isEmpty()
          || exam_subject.getText().isEmpty()
          || exam_year.getValue() == null
          || exam_score.getText().isEmpty()
          || exam_rank.getText().isEmpty()) {
        check = 0;
      }
    }
    if (title4_handle.isSelected()) {
      if (gate_area.getText().isEmpty()
          || gate_year.getValue() == null
          || gate_marks.getText().isEmpty()
          || gate_score.getText().isEmpty()
          || gate_rank.getText().isEmpty()) {
        check = 0;
      }
    }

    if (check == 0) {
      label.setVisible(true);
      label.setText("Error Some feilds are not filled");
      label.setTextFill(Color.web("#FF0000"));
    }
    if (tenth_marks.getText().isEmpty() == false || twelth_marks.getText().isEmpty() == false) {

      try {
        Double.parseDouble(tenth_marks.getText());
        Double.parseDouble(twelth_marks.getText());

        if (Integer.parseInt(tenth_marks.getText()) < 0
            || Integer.parseInt(tenth_marks.getText()) > 100) {
          check = 0;
          label.setVisible(true);
          label.setText("10th marks are not in format");
          label.setTextFill(Color.web("#FF0000"));
        }

        if (Integer.parseInt(twelth_marks.getText()) < 0
            || Integer.parseInt(twelth_marks.getText()) > 100) {
          check = 0;
          label.setVisible(true);
          label.setText("12th marks are not in format");
          label.setTextFill(Color.web("#FF0000"));
        }

      } catch (Exception e) {
        check = 0;
        label.setVisible(true);
        label.setText("Marks are not in proper format");
        label.setTextFill(Color.web("#FF0000"));
      }
    }
    try {
      if (cgpa_text.getText().isEmpty() == false) {
        Double.parseDouble(cgpa_text.getText());
        if (Integer.parseInt(cgpa_text.getText()) < 0
            || Integer.parseInt(cgpa_text.getText()) > 10) {
          check = 0;
          label.setVisible(true);
          label.setText("Cgpa Marks is not in proper format");
          label.setTextFill(Color.web("#FF0000"));
        }
      }
    } catch (Exception e) {
      check = 0;
      label.setVisible(true);
      label.setText("Cgpa Marks is not in proper format");
      label.setTextFill(Color.web("#FF0000"));
    }
    try {
      if (pg_cgpa.getText().isEmpty() == false) {
        System.out.println("cfgh");
        Double.parseDouble(pg_cgpa.getText());
        if (Integer.parseInt(pg_cgpa.getText()) < 0 || Integer.parseInt(pg_cgpa.getText()) > 10) {
          check = 0;
          label.setVisible(true);
          label.setText("postgraduate cgpa marks is not in proper format");
          label.setTextFill(Color.web("#FF0000"));
        }
      }
    } catch (Exception e) {
      check = 0;
      label.setVisible(true);
      label.setText("postgraduate cgpa marks is not in proper format");
      label.setTextFill(Color.web("#FF0000"));
    }
    try {
      if (marks_text.getText().isEmpty() == false) {
        Double.parseDouble(marks_text.getText());
        if (Integer.parseInt(marks_text.getText()) < 0
            || Integer.parseInt(marks_text.getText()) > 100) {
          check = 0;
          label.setVisible(true);
          label.setText("Marks is not in proper format");
          label.setTextFill(Color.web("#FF0000"));
        }
      }
    } catch (Exception e) {
      check = 0;
      label.setVisible(true);
      label.setText("Marks is not in proper format");
      label.setTextFill(Color.web("#FF0000"));
    }
    try {

      if (pg_marks.getText().isEmpty() == false) {
        Double.parseDouble(pg_marks.getText());
        if (Integer.parseInt(pg_marks.getText()) > 100
            || Integer.parseInt(pg_marks.getText()) < 0) {
          check = 0;
          label.setVisible(true);
          label.setText("undergraduate Marks is not in proper format");
          label.setTextFill(Color.web("#FF0000"));
        }
      }
    } catch (Exception e) {
      check = 0;
      label.setVisible(true);
      label.setText("undergraduate Marks is not in proper format");
      label.setTextFill(Color.web("#FF0000"));
    }

    if (mobile_no.getText().length() != 10 && mobile_no.getText().isEmpty() == false) {
      check = 0;
      label.setVisible(true);
      label.setText("Mobile no. is not correct");
    }
    if (mobile_no.getText().length() == 10) {
      try {
        Double.parseDouble(mobile_no.getText());

      } catch (Exception e) {
        check = 0;
        label.setVisible(true);
        label.setText("Mobile no. is not correct");
      }
    }
    if (DOB.getValue() != null) {
      // System.out.println("shiko");
      DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      Date date = new Date();
      String[] a = dateFormat.format(date).toString().split("-");
      String[] b = DOB.getValue().toString().split("-");
      System.out.println(Arrays.toString(a));
      System.out.println(Arrays.toString(b));
      if (Integer.parseInt(b[0]) - Integer.parseInt(a[0]) > 0) {
        // System.out.println("shiko1");
        check = 0;
        label.setVisible(true);
        label.setText("DOB is in future");
      } else if (b[0].compareTo(a[0]) == 0) {
        // System.out.println("shiko2");
        if (Integer.parseInt(b[1]) - Integer.parseInt(a[1]) > 0) {
          // System.out.println("shiko3");
          check = 0;
          label.setVisible(true);
          label.setText("DOB is in future");

        } else if (b[1].compareTo(a[1]) == 0) {
          System.out.println("shiko4");
          if (Integer.parseInt(b[2]) - Integer.parseInt(a[2]) > 0) {
            // System.out.println("shiko5");
            check = 0;
            label.setVisible(true);
            label.setText("DOB is in future");
          }
        }
      }
    }
    if (check == 1) {
      System.out.println("hello");
      File f = new File("./src/template.csv");
      File f1 = new File("./src/Feedback.csv");
      try {

        BufferedReader bw12 = new BufferedReader(new FileReader(f1));
        BufferedWriter bw2 = new BufferedWriter(new FileWriter(f));
        String line, Enrollement_id = "0";
        line = bw12.readLine();
        if (Integer.parseInt(Enrollement_id) == 0) {
          bw2.write(line);
          bw2.newLine();
        }
        while ((line = bw12.readLine()) != null) {
          String[] c = line.split(",");
          bw2.write(line);
          bw2.newLine();

          Enrollement_id = c[59];
          //	System.out.println(Enrollement_id.substring(3));
        }
        String text = "";
        text = text + Email.getText() + ",";
        text = text + Name.getText() + ",";
        text = text + Address.getText() + ",";
        text = text + mobile_no.getText() + ",";

        text = text + chk.getText() + ",";
        text = text + phd_ref1.getValue() + ",";
        text = text + phd_ref2.getValue() + ",";
        text = text + phd_ref3.getValue() + ",";

        text = text + chk1.getText() + ",";

        text = text + chk2.getText() + ",";

        text = text + chk3.getText() + ",";
        String[] dob = DOB.getValue().toString().split("-");

        String dob1 = dob[2] + "-" + dob[1] + "-" + dob[0];
        text = text + dob1 + ",";

        text = text + chk4.getText() + ",";

        text = text + father_name.getText() + ",";

        text = text + nationality.getValue().toString() + ",";
        text = text + permanent_address.getText() + ",";
        text = text + pin_code.getText() + ",";

        text = text + tenth_board.getText() + ",";
        text = text + tenth_marks.getText() + ",";
        text = text + ten_year_passing.getValue() + ",";
        text = text + twelth_board.getText() + ",";
        text = text + twelth_marks.getText() + ",";
        text = text + twelvth_year_passing.getValue() + ",";
        text = text + degree.getText() + ",";
        text = text + department.getText() + ",";
        text = text + name_of_clg.getText() + ",";
        text = text + name_of_uni.getText() + ",";
        text = text + city.getText() + ",";
        text = text + state.getValue() + ",";
        text = text + year_of_graduation.getValue() + ",";
        // RadioButton chk5;

        // System.out.println(Integer.parseInt(cgpa_text.getText()));
        if (cgpa.isSelected()) {

          Float a = Float.parseFloat(cgpa_combo.getValue().toString());
          // System.out.println(a+Float.parseFloat(cgpa_text.getText()));
          text = text + "CGPA:" + Float.toString(Float.parseFloat(cgpa_text.getText()) * a) + ",";
        } else if (marks.isSelected()) {
          text = text + "Marks:" + marks_text.getText().toString() + ",";
        }

        if (title1_handle.isSelected()) {
          text = text + "Yes" + ",";
          text = text + Pref1.getValue() + ",";
          text = text + Pref2.getValue() + ",";
          text = text + Pref3.getValue() + ",";
          text = text + Pref4.getValue() + ",";
        } else text = text + "No" + "," + "," + "," + "," + ",";
        if (title2_handle.isSelected()) {
          text = text + "Yes" + ",";
          text = text + pg_degree.getText() + ",";
          text = text + pg_department.getText() + ",";
          text = text + pg_college.getText() + ",";
          text = text + pg_title.getText() + ",";
          text = text + pg_city.getText() + ",";
          text = text + pg_state.getValue() + ",";

          text = text + pg_year.getValue() + ",";

          System.out.println("aasdf" + pg_marks.isDisable());

          if (pg_marks.isDisable()) {

            Float a = Float.parseFloat(pg_division.getValue().toString());
            // System.out.println(a+Float.parseFloat(cgpa_text.getText()));
            text = text + "CGPA:" + Float.toString(Float.parseFloat(pg_cgpa.getText()) * a) + ",";
          } else if (pg_cgpa.isDisable()) {
            text = text + "Marks:" + pg_marks.getText().toString() + ",";
          }
        } else text = text + "No" + "," + "," + "," + "," + "," + "," + "," + "," + ",";
        if (title3_handle.isSelected()) {
          text = text + "Yes" + ",";
          text = text + exam_name.getText() + ",";
          text = text + exam_subject.getText() + ",";
          text = text + exam_year.getValue() + ",";
          text = text + exam_score.getText() + ",";
          text = text + exam_rank.getText() + ",";

        } else text = text + "No" + "," + "," + "," + "," + "," + ",";
        if (title4_handle.isSelected()) {
          text = text + "Yes" + ",";
          text = text + gate_area.getText() + ",";
          text = text + gate_year.getValue() + ",";
          text = text + gate_marks.getText() + ",";
          text = text + gate_score.getText() + ",";
          text = text + gate_rank.getText() + ",";
        } else text = text + "No" + "," + "," + "," + "," + "," + ",";
        text = text + achievement.getText() + ",";
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
        Date date = new Date();
        text = text + dateFormat.format(date).toString() + ",";
        text = text + "PHD" + (Integer.parseInt(Enrollement_id.substring(3)) + 1) + ",";
        System.out.println(text);

        /*
















        */
        bw2.write(text);
        bw2.newLine();
        f1.delete();
        f.renameTo(f1);
        bw2.close();
        bw12.close();
        label.setVisible(true);
        label.setText("Database updated");
        label.setTextFill(Color.web("#FF0000"));

      } catch (IOException e) {

        e.printStackTrace();
      }
    }
  }
 @Override
 public String getText() {
   return radioButton.getText();
 }