Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if ((radioButton1.Checked && string.IsNullOrEmpty(textBox1.Text)) ||
         (radioButton2.Checked && string.IsNullOrEmpty(textBox2.Text)))
     {
         MessageBox.Show("TextBox is empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else if (radioButton1.Checked)
     {
         Book bk = remBook.getBook(int.Parse(textBox1.Text));
         if (bk != null)
         {
             (new BookWindow(bk)).Show();
         }
         else
         {
             MessageBox.Show("Book not found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else if (radioButton2.Checked)
     {
         Book bk = remBook.getBookByTitle(textBox2.Text);
         if (bk != null)
         {
             (new BookWindow(bk)).Show();
         }
         else
         {
             MessageBox.Show("Book not found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
Beispiel #2
0
        public int BuyBook(string title, string name, string email, string address, int quantity)
        {
            iRemBook = (IRemBook)Activator.GetObject(typeof(IRemBook), "http://localhost:9000/StoreServer/RemBook.rem");
            Book   book   = iRemBook.getBookByTitle(title);
            Client client = new Client();

            client.Name    = name;
            client.email   = email;
            client.address = address;
            return(iRemBook.sellBook(book, client, quantity));
        }
Beispiel #3
0
 public Book BookDetails(string title)
 {
     iRemBook = (IRemBook)Activator.GetObject(typeof(IRemBook), "http://localhost:9000/StoreServer/RemBook.rem");
     return(iRemBook.getBookByTitle(title));
 }