private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     lblDisplay.Content = "Display all member!..";
     StaffClient staff = new StaffClient();
     string s = staff.DisplayStaff();
     lblDisplay.Content = " " + s;
 }
Пример #2
0
        static void Main(string[] args)
        {
            StaffClient client = new StaffClient();
            string s = client.DisplayStaff();
            Console.WriteLine(s);
            client.Close();

        }
Пример #3
0
        private async Task Initialise()
        {
            string token = await _userService.GetTokenAsync();

            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            string baseUrl = Constants.ApiBaseUrl;

            _staffClient = new StaffClient(baseUrl, _httpClient);
        }
Пример #4
0
 public HomeController(StaffClient staffClient)
 {
     _staffClient = staffClient;
 }
Пример #5
0
        /// <summary>
        /// Gets the WFM Service Configured based on your requirements
        /// </summary>
        /// <param name="serviceType">The Service Type Required ("Client", "Contact" ...)</param>
        /// <returns>The Service, fully populated</returns>
        public static Object GetWcfSvc(string serviceType)
        {
            Uri             serviceUri;
            EndpointAddress endpointAddress;
            var             binding = BindingFactory.CreateInstance();
            object          service = null;

            string serviceBase = "http://modernpractice2013.cloudapp.net";

            if (DefaultRegion == "NZ")
            {
                serviceBase = "http://modernpractice2013-nz.cloudapp.net";
            }

            //serviceBase = "http://localhost:56019";

            switch (serviceType)
            {
            case "Client":
                serviceUri      = new Uri(serviceBase + "/ClientService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new ClientClient(binding, endpointAddress);
                break;

            case "Contact":
                serviceUri      = new Uri(serviceBase + "/ContactService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new ContactClient(binding, endpointAddress);
                break;

            case "CustomField":
                serviceUri      = new Uri(serviceBase + "/CustomFieldDefinitionService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new CustomFieldDefinitionClient(binding, endpointAddress);
                break;

            case "Invoice":
                serviceUri      = new Uri(serviceBase + "/InvoiceService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new InvoiceClient(binding, endpointAddress);
                break;

            case "Job":
                serviceUri      = new Uri(serviceBase + "/JobService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new JobClient(binding, endpointAddress);
                break;

            case "Lead":
                serviceUri      = new Uri(serviceBase + "/LeadService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new LeadClient(binding, endpointAddress);
                break;

            case "Quote":
                serviceUri      = new Uri(serviceBase + "/QuoteService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new QuoteClient(binding, endpointAddress);
                break;

            case "Task":
                serviceUri      = new Uri(serviceBase + "/TaskService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new TaskClient(binding, endpointAddress);
                break;

            case "Staff":
                serviceUri      = new Uri(serviceBase + "/StaffService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new StaffClient(binding, endpointAddress);
                break;

            case "Template":
                serviceUri      = new Uri(serviceBase + "/TemplateService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new TemplateClient(binding, endpointAddress);
                break;

            case "Cost":
                serviceUri      = new Uri(serviceBase + "/CostService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new CostClient(binding, endpointAddress);
                break;

            case "Supplier":
                serviceUri      = new Uri(serviceBase + "/SupplierService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new SupplierClient(binding, endpointAddress);
                break;

            case "PurchaseOrder":
                serviceUri      = new Uri(serviceBase + "/PurchaseOrderService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new PurchaseOrderClient(binding, endpointAddress);
                break;

            case "Time":
                serviceUri      = new Uri(serviceBase + "/TimeService.svc");
                endpointAddress = new EndpointAddress(serviceUri);
                service         = new SupplierClient(binding, endpointAddress);
                break;
            }
            return(service);
        }