コード例 #1
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None)
            {
                MessageBox.Show("İnternet bağlantınızı kontrol ediniz!");
                NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
            }
            else if (string.IsNullOrEmpty(txtStudentID.Text) || string.IsNullOrEmpty(txtPassword.Password))
            {
                MessageBox.Show("Boş bıraktığınız alan(lar) var!");
            }
            else
            {
                ProgressIndicator indicator = new ProgressIndicator();
                indicator.IsIndeterminate = true;
                indicator.IsVisible       = true;
                indicator.Text            = "Giriş yapılıyor..";
                SystemTray.SetProgressIndicator(this, indicator);

                int    studentID = Convert.ToInt32(txtStudentID.Text);
                string password  = txtPassword.Password;
                try
                {
                    ObisisMobileServiceClient client = new ObisisMobileServiceClient();
                    client.GetStudentAsync(studentID, password);
                    client.GetStudentCompleted += client_GetStudentCompleted;
                }
                catch (Exception)
                {
                    MessageBox.Show("Sunucuya bağlanırken bir sorun oluştu!\nDaha sonra tekrar deneyiniz..");
                }
            }
        }