public TestPage() { InitializeComponent(); PublisherServiceClient client = new PublisherServiceClient(); // client.getImageByUserIdAsync(2); //client.getImageByUserIdCompleted += new EventHandler<getImageByUserIdCompletedEventArgs>(client_getImageByUserIdCompleted); }
private void getTrendFromServer() { client = new PublisherServiceClient(); client.GetPostTrendAsync((App.Current as App).UserId); client.GetPostTrendCompleted += new EventHandler<GetPostTrendCompletedEventArgs>(client_GetPostTrendCompleted); client.GetPhotoTrendAsync((App.Current as App).UserId); client.GetPhotoTrendCompleted += new EventHandler<GetPhotoTrendCompletedEventArgs>(client_GetPhotoTrendCompleted); client.GetAchievementTrendAsync((App.Current as App).UserId); client.GetAchievementTrendCompleted += new EventHandler<GetAchievementTrendCompletedEventArgs>(client_GetAchievementTrendCompleted); }
public Friend_Photo(PublisherServiceClient _client) { InitializeComponent(); hubTile= new HubTile(); this.grid_Content.Children.Add(hubTile); hubTile.DisplayNotification = true; // hubTile.Background = new SolidColorBrush(new Color() {A=255, }); // client = _client; // client.GetImageByItemIdCompleted+=new EventHandler<GetImageByItemIdCompletedEventArgs>(client_GetImageByItemIdCompleted); }
private void btn_Ok_Click(object sender, RoutedEventArgs e) { client= new PublisherServiceReference.PublisherServiceClient(); register.Address = tb_Address.Text; register.City = "武汉"; register.UserName = tb_userName.Text; register.Passwrod = tb_PassWord.Text; register.Latitude = (decimal)((GeoCoordinate)Pin_My.Tag).Latitude; register.Longitude = (decimal)((GeoCoordinate)Pin_My.Tag).Longitude; client.RegisterAsync(register); client.RegisterCompleted += new EventHandler<PublisherServiceReference.RegisterCompletedEventArgs>(client_RegisterCompleted); }
public RewardVM (int id,CallBack callback) { db = new Database(Database.connectStr); List_RewardModel = new List<RewardModel>(); // UserTable user = db.Users.Single(c => c.Id == id); Title = "Rewrad List"; //List<RewardTable> list_Acquirer = db.Rewards.Where(c => Math.Abs(c.Latitude - user.Latitude) < 1 && Math.Abs(c.Longitude - user.Longitude) < 1).ToList<RewardTable>(); if (db.Rewards.Count() == 0) { PublisherServiceClient client = new PublisherServiceClient(); client.GetRewardAsync(id); client.GetRewardCompleted += new EventHandler<GetRewardCompletedEventArgs>(client_getRewardCompleted); } else { getList_RewardModel(); } }
public PostSuccessPage() { InitializeComponent(); client = new PublisherServiceClient(); client.PostCompleted += new EventHandler<PostCompletedEventArgs>(client_PostCompleted); }
static void Main(string[] args) { BookService.Book newBook = new BookService.Book { AuthorId = 1, Format = "PRINTED", Isbn = "123-asd-1234", NextStockDate = DateTime.Now.AddMonths(2), Preface = "önsöz123", PublisherId = 1, QuantityLeft = 2, ReleaseDate = DateTime.Now, Version = 1, WarehouseLocation = 5 }; //client.ClientCredentials.UserName.UserName = "******"; //client.ClientCredentials.UserName.Password = "******"; BookServiceClient client = new BookServiceClient(); var book = client.CheckStock("978-975-4187-53-3"); var isbnList = new List <string>(); isbnList.Add("978-975-4187-53-3"); var bookList = client.CheckStocks(isbnList.ToArray()); string message = client.AddBookToStock(newBook); client.Close(); Console.WriteLine(book.AuthorName); Console.WriteLine(book.BookId); Console.WriteLine(book.Format); Console.WriteLine(book.Isbn); Console.WriteLine(book.IsValidIsbn); Console.WriteLine(book.NextStockDate); Console.WriteLine(book.Preface); Console.WriteLine(book.PublisherName); Console.WriteLine(book.QuantityLeft); Console.WriteLine(book.ReleaseDate); Console.WriteLine(book.Version); Console.WriteLine(book.WarehouseLocation); //--------------------------------------- Console.WriteLine("---------------------------------------"); Console.WriteLine(bookList.FirstOrDefault().AuthorName); Console.WriteLine("---------------------------------------"); Console.WriteLine(message); Console.WriteLine("----------AUTHOR-----------------------------"); var author = new AuthorService.Author() { AuthorId = 1 }; AuthorServiceClient authorClient = new AuthorServiceClient(); var authorList = authorClient.GetAuthors(); var authorBooks = authorClient.GetAuthorBooks(author); authorClient.Close(); Console.WriteLine(authorList.FirstOrDefault().FirstName); Console.WriteLine(authorBooks.FirstOrDefault().Isbn); Console.WriteLine("----------Publisher-----------------------------"); var publisher = new Publisher() { PublisherId = 1 }; PublisherServiceClient publisherClient = new PublisherServiceClient(); var publisherList = publisherClient.GetPublishers(); var publisherBooks = publisherClient.GetPublisherBooks(publisher); publisherClient.Close(); Console.WriteLine(publisherList.FirstOrDefault().PublisherName); Console.WriteLine(publisherBooks.FirstOrDefault().Isbn); Console.ReadLine(); }
private void ScheduleDelivery(DeliveryInfo pDeliveryInfo) { Console.WriteLine("Delivery Request Submitted. Order" + pDeliveryInfo.OrderNumber + " is ready for pickup from warehouse: " + pDeliveryInfo.SourceAddress + ". Delivering to: " + pDeliveryInfo.DestinationAddress); Thread.Sleep(5000); //notifying of delivery pick up using (TransactionScope lScope = new TransactionScope()) { using (DeliveryCoEntityModelContainer lContainer = new DeliveryCoEntityModelContainer()) { pDeliveryInfo.Status = 1; lContainer.SaveChanges(); DeliveryStatus lItem = new DeliveryStatus { DeliveryInfo = pDeliveryInfo }; DeliveryStatusMessageToDeliveryNotification lVisitor = new DeliveryStatusMessageToDeliveryNotification(); lVisitor.Visit(lItem); PublisherServiceClient lClient = new PublisherServiceClient(); lClient.Publish(lVisitor.Result); lScope.Complete(); } } Console.WriteLine("Delivery picked up from warehouse " + pDeliveryInfo.SourceAddress + ". Delivering to:" + pDeliveryInfo.DestinationAddress); Thread.Sleep(5000); //notifying of delivery in transit using (TransactionScope lScope = new TransactionScope()) { using (DeliveryCoEntityModelContainer lContainer = new DeliveryCoEntityModelContainer()) { pDeliveryInfo.Status = 2; lContainer.SaveChanges(); DeliveryStatus lItem = new DeliveryStatus { DeliveryInfo = pDeliveryInfo }; DeliveryStatusMessageToDeliveryNotification lVisitor = new DeliveryStatusMessageToDeliveryNotification(); lVisitor.Visit(lItem); PublisherServiceClient lClient = new PublisherServiceClient(); lClient.Publish(lVisitor.Result); lScope.Complete(); } } Console.WriteLine("Delivery " + pDeliveryInfo.Id + " completed. Books in order " + pDeliveryInfo.OrderNumber + " delivered to " + pDeliveryInfo.DestinationAddress); Thread.Sleep(5000); using (TransactionScope lScope = new TransactionScope()) { using (DeliveryCoEntityModelContainer lContainer = new DeliveryCoEntityModelContainer()) { pDeliveryInfo.Status = 3; lContainer.SaveChanges(); DeliveryStatus lItem = new DeliveryStatus { DeliveryInfo = pDeliveryInfo }; DeliveryStatusMessageToDeliveryNotification lVisitor = new DeliveryStatusMessageToDeliveryNotification(); lVisitor.Visit(lItem); PublisherServiceClient lClient = new PublisherServiceClient(); lClient.Publish(lVisitor.Result); lScope.Complete(); } } }
private void ScheduleDelivery(DeliveryInfo pDeliveryInfo, Guid pDeliveryIdentifier, PublisherServiceClient lClient) { Thread.Sleep(10000); Console.WriteLine("Order: " + pDeliveryInfo.DestinationAddress + " Delivered at " + DateTime.Now.ToString()); //notifying of delivery completion using (TransactionScope lScope = new TransactionScope()) using (DeliveryDataModelContainer lContainer = new DeliveryDataModelContainer()) { pDeliveryInfo.Status = 1; //IDeliveryNotificationService lService = DeliveryNotificationServiceFactory.GetDeliveryNotificationService(pDeliveryInfo.DeliveryNotificationAddress); //lService.NotifyDeliveryCompletion(pDeliveryInfo.DeliveryIdentifier, DeliveryInfoStatus.Delivered); DeliveryMessage mDeliveryMessage = new DeliveryMessage() { OrderNumber = pDeliveryInfo.OrderNumber, DeliveryIdentifier = pDeliveryIdentifier, Status = 1, Topic = "delivery" }; lClient.Publish(mDeliveryMessage); lScope.Complete(); } }