@FXML
void initialize() {
loginBtn.setOnAction(event -> {
String userName = userNameField.getText();
String password = passwordField.getText();
try {
loading(loginProgressBar);
if (authenticate(userName, password)) {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/fxml/MainMenu.fxml"));
try {
loader.load();
} catch (IOException e) {
e.printStackTrace();
}
loginBtn.getScene().getWindow().hide();
Parent root = loader.getRoot();
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.showAndWait();
errorLabel.setText("");
} else {
errorLabel.setText("Неверные данные для входа");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
loginProgressBar.setVisible(false);
}
clearFields();
});
}
static void loading(ProgressBar progressBar) throws InterruptedException {
Task<Void> task = new Task<Void>() {
@Override
protected Void call() {
Platform.runLater(() -> {
progressBar.setVisible(true);
progressBar.setProgress(-1.0f);
});
return null;
}
};
Thread th = new Thread(task);
//th.setDaemon(true);
th.start();
}
[Serializable]
public partial class ContractClassShort
{
public ContractClassShort(){
}
public ValueClass AgreementNumber
{
get;
set;
}
}
[Serializable]
public partial class ContractListClassShort : ValueClass
{
public ContractListClassShort()
{
}
public ContractListClassShort(int x)
{
Contract = new ContractClassShort[x];
}
[System.Xml.Serialization.XmlElementAttribute("Contract")]
public ContractClassShort[] Contract
{
get;
set;
}
}
public class FCBRequestResultShort
{
public ContractListClassShort ExistingContracts { get; set; }
}
[WebMethod]
public FCBRequestResultShort GetReportShort(int processType, int processID, string iinbin, int isJur)
{
FCBRequestResult result = new FCBRequestResult();
result = GetReport(processType, processID, iinbin, isJur);
FCBRequestResultShort res = new FCBRequestResultShort();
res.ExistingContracts = new ContractListClassShort(result.otherReport.Result.Root.ExistingContracts.Contract.Length);
DateTime dt1 = DateTime.Parse("01.01.2021");
int i = 0;
foreach (ContractClass contract in result.otherReport.Result.Root.ExistingContracts.Contract)
{
if (Convert.ToDateTime(contract.DateOfCreditEnd.Value) >= dt1)
{
if (contract.AgreementNumber.Value == "111")
{
res.ExistingContracts.Contract[i] = new ContractClassShort();
res.ExistingContracts.Contract[i].AgreementNumber.Value = contract.AgreementNumber.Value;////<<<<<ОШИБКА
i++;
}
}
}
return res;
}
SettingsEntityRepository
выше описал.На гитхаб выложить не получится, так как сижу в корпоративной сети