Exemplo n.º 1
0
        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());
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public TestsPageViewModel(INavigationService navigationService)
 {
     service = new DatabaseServiceClient();
     this.navigationService = navigationService;
     NacitajTesty = DelegateCommand.FromAsyncHandler(LoadTestsAsync);
 }
Exemplo n.º 7
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(DatabaseServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IDatabaseService));
 }
Exemplo n.º 8
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(DatabaseServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IDatabaseService));
 }
Exemplo n.º 9
0
 public DatabaseServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(DatabaseServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemplo n.º 10
0
 public DatabaseServiceClient(EndpointConfiguration endpointConfiguration) :
     base(DatabaseServiceClient.GetBindingForEndpoint(endpointConfiguration), DatabaseServiceClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemplo n.º 11
0
 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));
        }