示例#1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (Username.Text == "" || Password.Password == "")
            {
                MessageBox.Show("Mindkét mező kitöltése kötelező!");
            }
            else
            {
                string username = Username.Text;
                string password = Password.Password;
                try
                {
                    client     = new BooksServiceClient();
                    userClient = client.Login(username, password);


                    MainWindow main = new MainWindow();

                    this.Hide();
                    main.ShowDialog();
                }
                catch (FaultException <BooksWcf.LoginFailedFault> ex)
                {
                    MessageBox.Show("Hibás adatok!");
                }
                catch (EndpointNotFoundException)
                {
                    MessageBox.Show("Hiba a kiszolgálóval!");
                }
            }
        }
        private void button_Logout_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                bool logoutResult = client.Logout(userClient);
                if (logoutResult)
                {
                    userClient = null;

                    MessageBox.Show("Sikeres kijelentkezés!");
                }
            }
            catch (EndpointNotFoundException)
            {
                MessageBox.Show("Hiba a kiszolgálóval!");
            }
            catch (FaultException <BooksWcf.LoginFailedFault> ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ismeretlen hiba: " + ex.Message);
            }


            Login login = new Login();

            this.Hide();
            login.ShowDialog();

            this.Close();
        }
示例#3
0
 public BooksWcf.Book[] ListAll(BooksWcf.User client)
 {
     return(base.Channel.ListAll(client));
 }
示例#4
0
 public System.Threading.Tasks.Task <bool> LogoutAsync(BooksWcf.User client)
 {
     return(base.Channel.LogoutAsync(client));
 }
示例#5
0
 public bool Logout(BooksWcf.User client)
 {
     return(base.Channel.Logout(client));
 }
示例#6
0
 public System.Threading.Tasks.Task <bool> DeleteAsync(string id, BooksWcf.User client, string header)
 {
     return(base.Channel.DeleteAsync(id, client, header));
 }
示例#7
0
 public bool Delete(string id, BooksWcf.User client, string header)
 {
     return(base.Channel.Delete(id, client, header));
 }
示例#8
0
 public System.Threading.Tasks.Task <bool> UpdateAsync(string id, string name, string rating, string lenght, string releaseYear, BooksWcf.User client, string Header)
 {
     return(base.Channel.UpdateAsync(id, name, rating, lenght, releaseYear, client, Header));
 }
示例#9
0
 public bool Update(string id, string name, string rating, string lenght, string releaseYear, BooksWcf.User client, string Header)
 {
     return(base.Channel.Update(id, name, rating, lenght, releaseYear, client, Header));
 }
示例#10
0
 public bool Insert(string name, string rating, string lenght, string releaseYear, BooksWcf.User client, string Header)
 {
     return(base.Channel.Insert(name, rating, lenght, releaseYear, client, Header));
 }
示例#11
0
 public System.Threading.Tasks.Task <BooksWcf.Book[]> ListByIdAsync(string id, BooksWcf.User client)
 {
     return(base.Channel.ListByIdAsync(id, client));
 }
示例#12
0
 public BooksWcf.Book[] ListById(string id, BooksWcf.User client)
 {
     return(base.Channel.ListById(id, client));
 }
示例#13
0
 public System.Threading.Tasks.Task <BooksWcf.Book[]> ListAllAsync(BooksWcf.User client)
 {
     return(base.Channel.ListAllAsync(client));
 }
示例#14
0
 public BooksWcf.Book[] ListAll(BooksWcf.User client, string loginfo)
 {
     return(base.Channel.ListAll(client, loginfo));
 }
示例#15
0
 public bool Delete(string id, BooksWcf.User client, string loginfo)
 {
     return(base.Channel.Delete(id, client, loginfo));
 }
示例#16
0
 public System.Threading.Tasks.Task <bool> InsertAsync(string name, string rating, string lenght, string releaseYear, BooksWcf.User client, string loginfo)
 {
     return(base.Channel.InsertAsync(name, rating, lenght, releaseYear, client, loginfo));
 }