private int GetContractId() { ContractEF contractId = DataBaseClient.GetContractByCompany(SelectedSupplier.companyId, SelectedBroker.id); if (contractId != null && contractId.brokerid == SelectedBroker.id) { return(contractId.id); } else { return(0); } }