Example #1
0
        private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            IsolatedStorageSettings isolated = IsolatedStorageSettings.ApplicationSettings;
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            if (pivot.SelectedIndex == 0)
            {
                if (isolated.Contains("ShipperId"))
                {
                    service.GetNewExhibitionAsync(Convert.ToInt32(isolated["ShipperId"]));
                    service.GetNewExhibitionCompleted += Service_GetNewExhibitionCompleted;
                }
                else
                {
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                }
            }
            else if (pivot.SelectedIndex == 1)
            {
                if (isolated.Contains("ShipperId"))
                {
                    service.GetWaitSendExhibitionAsync(Convert.ToInt32(isolated["ShipperId"]));
                    service.GetWaitSendExhibitionCompleted += Service_GetWaitSendExhibitionCompleted;
                }
                else
                {
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                }
            }
            else if (pivot.SelectedIndex == 2)
            {
                if (isolated.Contains("ShipperId"))
                {
                    service.GetCompleteExhibitionAsync(Convert.ToInt32(isolated["ShipperId"]));
                    service.GetCompleteExhibitionCompleted += Service_GetCompleteExhibitionCompleted;
                }
                else
                {
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                }
            }
            else if (pivot.SelectedIndex == 3)
            {
                if (isolated.Contains("ShipperId"))
                {
                    service.GetFailExhibitionAsync(Convert.ToInt32(isolated["ShipperId"]));
                    service.GetFailExhibitionCompleted += Service_GetFailExhibitionCompleted;
                }
                else
                {
                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                }
            }
        }
Example #2
0
        public ListExhibition()
        {
            InitializeComponent();
            IsolatedStorageSettings isolated = IsolatedStorageSettings.ApplicationSettings;
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            if (isolated.Contains("ShipperId"))
            {
                service.GetNewExhibitionAsync(Convert.ToInt32(isolated["ShipperId"]));
                service.GetNewExhibitionCompleted += Service_GetNewExhibitionCompleted;
            }
            else
            {
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }
        }