public String button1_action() { // TODO: Process the ...

ohiofulvousΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 5 μέρες)

260 εμφανίσεις

public String button1_action() {


// TODO: Process the action. Return value is a navigation



try { // Call Web Service Operation



org.netbeans.j2ee.wsdl.Narudzbina.NarudzbinaPortType port = service.getNarudzbinaPort();


// TODO initialize WS operation arguments here



org.netbeans.j2ee.wsdl.Narudzbina.NarudzbinaType part1 = new
org.netbeans.j2ee.wsdl.Narudzbina.NarudzbinaType();


// TODO process result here



if(validacija() ==

true) //ispitujemo na klijentskoj strani kolicinu


{






part1.setProizvod((String) getValue_dropDown1().toString());


part1.setProizvodjac((String) getValue_dropDown2().toString());


part1.set
Model((String) getValue_dropDown3().toString());


part1.setKolicina((String) textField2.getText().toString());


part1.setNacinPlacanja((String) rezimPlacanja);


part1.setIzvestaj((String)izvestaj);


part1.setKome
ntar((String) textField1.getText().toString());


java.lang.String result = port.NarudzbinaOperation(part1);





// Process result here


String serviceEndpointAddressString = (String) textField1.getText();



((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
serviceEndpointAddressString);


System.out.println("Invoking NarudzbinaServis on " + serviceEndpointAddressString);



odgovor.setText(
result);




System.out.println("Result = "+result);


}


} catch (Exception ex) {


// TODO handle custom exceptions here


odgovor.setText("Exception: " + ex.getMessage());


ex.printStackTrace()
;


}


// case name where null will return to the same page.


return null;


}



public void radioButton4_processValueChange(ValueChangeEvent event) {


rezimPlacanja = radioButton4.getSelectedValue().toString();


}




public
boolean validacija()

{


int kolicina = Integer.parseInt(textField2.getText().toString());


if (kolicina > 0)


return true;


else


return false;

}



public void radioButton3_processValueChange(ValueChangeEvent

event) {


rezimPlacanja = radioButton3.getSelectedValue().toString();


}



public void checkbox1_processValueChange(ValueChangeEvent event) {


if(checkbox1.isChecked())


{


izvestaj = "da";


}


else



{


izvestaj = "ne";


}


}