Пример #1
0
        private void buttonEnter_Click(object sender, EventArgs e)
        {
            LibraryEntities context = new LibraryEntities();
            var clients = context.Clients;

            bool flag = false;
            foreach (var item in clients)
            {
                if (int.Parse(textBoxID.Text) == item.ClientID && textBoxEGN.Text.Trim() == item.EGN.Trim())
                {
                    flag = true;
                }
            }
            if (flag == true)
            {
                Menu menu = new Menu(int.Parse(textBoxID.Text));
                menu.Show();
                InitializeMyControl();
                Clear();
            }
            else
            {
                MessageBox.Show("Грешка! Невалидна парола!");
                InitializeMyControl();
                Clear();
            }
        }
Пример #2
0
        private void radioButtonRejected_CheckedChanged(object sender, EventArgs e)
        {
            LibraryReader.LibraryEntities context = new LibraryReader.LibraryEntities();
            var books =
                from book in context.Books
                where book.Rejection == true
                select book;

            dataGridViewBooks.AutoGenerateColumns = false;
            dataGridViewBooks.DataSource          = books;
        }
Пример #3
0
        private void radioButtonBooked_CheckedChanged(object sender, EventArgs e)
        {
            LibraryReader.LibraryEntities context = new LibraryReader.LibraryEntities();
            var books =
                from clientbook in context.ClientsBooks
                join book in context.Books on clientbook.BookID equals book.BookID
                where (clientbook.Reservation == true) && (book.Rejection == false)
                select book;

            dataGridViewBooks.AutoGenerateColumns = false;
            dataGridViewBooks.DataSource          = books;
        }
Пример #4
0
 private void FormReturned_Load(object sender, EventArgs e)
 {
     LibraryEntities context = new LibraryEntities();
     var books =
         from cl in context.ClientsBooks
         join book in context.Books on cl.BookID equals book.BookID
         where (cl.ClientID == id) && (cl.Returned == true) && (cl.Reservation == false)
         select book;
     if (books != null)
     {
         dataGridViewReturned.AutoGenerateColumns = false;
         dataGridViewReturned.DataSource = books;
     }
 }
Пример #5
0
 private void radioButtonAvailable_CheckedChanged(object sender, EventArgs e)
 {
     LibraryReader.LibraryEntities context = new LibraryReader.LibraryEntities();
     var booksTaken =
         from clientbook in context.ClientsBooks
         join book in context.Books on clientbook.BookID equals book.BookID
         where (clientbook.Returned == false) && (book.Rejection == false)
         select book;
     var books = context.Books.Except(booksTaken);
     dataGridViewBooks.AutoGenerateColumns = false;
     dataGridViewBooks.DataSource = books;
 }
Пример #6
0
        private void radioButtonAll_CheckedChanged(object sender, EventArgs e)
        {
            LibraryReader.LibraryEntities context = new LibraryReader.LibraryEntities();
            var books =
                from book in context.Books
                where book.Rejection == false
                select book;

            dataGridViewBooks.AutoGenerateColumns = false;
            dataGridViewBooks.DataSource = books;
        }