private void ShowOrders() { using (var client = new OrderTrackingServiceClient()) { client.ClientCredentials.UserName.UserName = "******"; client.ClientCredentials.UserName.Password = "******"; var orders = client.GetOrdersFromMyOrganization(); this.DisplayView(new OrderTrackingView { DataContext = new OrderTrackingViewModel(orders) }); } }
public OrderTrackingViewModel(OrderTrackingServiceClient client, OrderTrackingController orderTrackingController, RequestType requestType) { this.client = client; this.orderTrackingController = orderTrackingController; this.refreshCommand = new DelegateCommand(this.RefreshOrders); this.logoutCommand = new DelegateCommand(this.Logout); if (requestType == RequestType.OrganizationOrders) { this.action = new Func <IEnumerable <Order> >(this.client.GetOrdersFromMyOrganization); } else { this.action = new Func <IEnumerable <Order> >(this.client.GetAllOrders); } this.RefreshOrders(); }
private void ShowOrders(string userName, string password, RequestType requestType) { var stsEndpoint = ConfigurationManager.AppSettings["stsEndpoint"]; var acsNamespace = ConfigurationManager.AppSettings["acsNamespace"]; var acsRelyingParty = ConfigurationManager.AppSettings["acsRelyingParty"]; var client = new OrderTrackingServiceClient(acsNamespace, acsRelyingParty, stsEndpoint); client.ClientCredentials.UserName.UserName = userName; client.ClientCredentials.UserName.Password = password; this.DisplayView(new OrderTrackingView { DataContext = new OrderTrackingViewModel(client, this, requestType) }); }