예제 #1
0
        //add book
        public static void AddBook()
        {
            Console.WriteLine("enter book id ");
            int BookId = int.Parse(Console.ReadLine());

            Console.WriteLine("enter book name");
            string BookName = Console.ReadLine();

            Console.WriteLine("enter book copies");
            int BookCopies = int.Parse(Console.ReadLine());

            Console.WriteLine("enter book status");
            string Status = Console.ReadLine();

            Console.WriteLine("enter date");
            DateTime date = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("enter author name");
            string Author = Console.ReadLine();

            Business.AddBook(BookId, BookName, BookCopies, Status, date, Author);
            Console.WriteLine("book added successfully");
        }
예제 #2
0
 private void btnupdate1_Click(object sender, EventArgs e)
 {
     try
     {
         int    Bookid   = int.Parse(tbBookId.Text);
         string Bookname = tbBookname.Text;
         int    Copies   = int.Parse(tbCopies.Text);
         string Status   = tbstatus.Text;
         int    Price    = int.Parse(tbPrice.Text);
         string author   = tbAuthor.Text;
         if (BusinessLogicLayer.AddBook(Bookid, Bookname, Copies, Status, Price, author))
         {
             MessageBox.Show("book added successfully");
         }
         else
         {
             MessageBox.Show("something went wrong");
         }
     }
     catch (Exception f)
     {
         MessageBox.Show(f.Message);
     }
 }