Example #1
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            service.GetDetailexhibitionAsync(txtSearch.Text);
            service.GetDetailexhibitionCompleted += Service_GetDetailexhibitionCompleted;
        }
Example #2
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            service.ShipperLoginAsync(txtUsername.Text, txtPassword.Password);
            service.ShipperLoginCompleted += Service_ShipperLoginCompleted;
        }
Example #3
0
        private void Service_GetDetailexhibitionCompleted(object sender, ServiceReference1.GetDetailexhibitionCompletedEventArgs e)
        {
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            this.DataContext = e.Result;
            service.GetExhibitionStatusAsync(e.Result.ExhibitionStatusId);
            service.GetExhibitionStatusCompleted += Service_GetExhibitionStatusCompleted;
        }
Example #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            exhibitionId = NavigationContext.QueryString["ExhibitionId"].ToString();
            var service = new ServiceReference1.ShipwayServiceSoapClient();

            service.GetDetailexhibitionAsync(exhibitionId);
            service.GetDetailexhibitionCompleted += Service_GetDetailexhibitionCompleted;
            ExhibitionId.Text = exhibitionId;
        }
Example #5
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 #6
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));
            }
        }
        private void Query_QueryCompleted1(object sender, QueryCompletedEventArgs <IList <MapLocation> > e)
        {
            try
            {
                string text = "";
                if (e.Cancelled)
                {
                }
                else if (e.Result != null)
                {
                    MapAddress mapaddress     = e.Result[0].Information.Address;
                    string     addressString1 = mapaddress.HouseNumber + " " + mapaddress.Street;
                    string     addressString2 = mapaddress.District + ", " + mapaddress.City;
                    string     addressString3 = mapaddress.Country;
                    if (addressString1 != " ")
                    {
                        addressString1 = addressString1 + "\n";
                    }
                    else
                    {
                        addressString1 = "";
                    }

                    if (addressString2 != ",  ")
                    {
                        addressString2 = addressString2 + "\n";
                    }
                    else
                    {
                        addressString2 = "";
                    }

                    text = addressString1 + addressString2 + addressString3;
                }

                var service = new ServiceReference1.ShipwayServiceSoapClient();
                service.UpdateStatusOfExhibitionAsync(exhibitionId.Text, "Giao thành công", text);
                service.UpdateStatusOfExhibitionCompleted += Service_UpdateStatusOfExhibitionCompleted;
            }
            catch
            {
            }
        }