static void Main(string[] args) { var client = new DatabaseServiceClient(); var employees = client.GetEmployees(); foreach (var employee in employees) { Console.WriteLine($"{employee.ID}: {employee.FirstName}, {employee.LastName}"); } }
public AdminTestAddPageViewModel(INavigationService navigationService) { _navigationService = navigationService; service = new DatabaseServiceClient(); NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null)); NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null)); NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null)); NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null)); AddTestBtn = new DelegateCommand(() => AddTestFunc()); }
public AdminUsersPageViewModel(INavigationService navigationService, MainPage mainPage) { _navigationService = navigationService; service = new DatabaseServiceClient(); NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null)); NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null)); NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null)); NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null)); RemoveUserBtn = new DelegateCommand(() => RemoveUserFunc()); LoadUsersAsync(); }
public AdminResultsPageViewModel(INavigationService navigationService, MainPage mainPage) { _navigationService = navigationService; service = new DatabaseServiceClient(); NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null)); NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null)); NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null)); NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null)); //RemoveQuestion = new DelegateCommand<int>((argument) => RemoveTestFunc(argument)); RemoveResult = new DelegateCommand(() => RemoveResultFunc()); LoadResultsAsync(); }
private void RegCheck() { User user = new User(); user.firstName = fname; user.lastName = sname; user.login = login; user.pass = pass; DatabaseServiceClient service = new DatabaseServiceClient(); service.InsertUserAsync(user); var dialog = new MessageDialog("User " + login + " pass " + pass + " succesfull REGISTRATED\nnow you can log in"); dialog.ShowAsync(); navigationService.Navigate(PageTokens.LoginPage, null); }
public TestsPageViewModel(INavigationService navigationService) { service = new DatabaseServiceClient(); this.navigationService = navigationService; NacitajTesty = DelegateCommand.FromAsyncHandler(LoadTestsAsync); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(DatabaseServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IDatabaseService)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(DatabaseServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IDatabaseService)); }
public DatabaseServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(DatabaseServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public DatabaseServiceClient(EndpointConfiguration endpointConfiguration) : base(DatabaseServiceClient.GetBindingForEndpoint(endpointConfiguration), DatabaseServiceClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public DatabaseServiceClient() : base(DatabaseServiceClient.GetDefaultBinding(), DatabaseServiceClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IDatabaseService.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public static async Task <CompanyCompositeDTO> GetAllCompaniesAsync() { DatabaseServiceClient serviceClient = new DatabaseServiceClient(); return(await serviceClient.GetAllCompaniesAsync()); }
public static async Task <bool> InsertCompanyAsync(string companyName, string countryCode, int?companyType) { DatabaseServiceClient serviceClient = new DatabaseServiceClient(); return(await serviceClient.InsertCompanyAsync(companyName, countryCode, companyType)); }
public static async Task <IEnumerable <CompanyDTO> > GetCompaniesAsync(int?Id, string companyName, string countryCode, int?companyType) { DatabaseServiceClient serviceClient = new DatabaseServiceClient(); return(await serviceClient.GetCompaniesAsync(Id, companyName, countryCode, companyType)); }