Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bd = new Book_ShopEntities();
            var item = (from r in bd.Reservations
                        join b in bd.Buyers on r.Id_Buyer equals b.Id_Buyer
                        join bk in bd.Books on r.Id_Book equals bk.Id_Book
                        select new
            {
                LastNameBuyer = b.LastName,
                FirstNameBuyer = b.FistName,
                NameOfBook = bk.NameBook
            }).ToList();

            dataGridViewAllBooks.DataSource = null;
            dataGridViewAllBooks.DataSource = item;
        }
Esempio n. 2
0
 private void btnShow_Click(object sender, EventArgs e)
 {
     bd = new Book_ShopEntities();
     bd.Books.Load();
     dataGridViewAllBooks.DataSource = bd.Books.Local.ToBindingList();
     dataGridViewAllBooks.DataSource = bd.Books.Local.ToBindingList();
     dataGridViewAllBooks.Columns["Themes"].Visible       = false;
     dataGridViewAllBooks.Columns["Authors"].Visible      = false;
     dataGridViewAllBooks.Columns["Publishers"].Visible   = false;
     dataGridViewAllBooks.Columns["Discounts"].Visible    = false;
     dataGridViewAllBooks.Columns["NextTome"].Visible     = false;
     dataGridViewAllBooks.Columns["Reservations"].Visible = false;
     dataGridViewAllBooks.Columns["Sales"].Visible        = false;
     dataGridViewAllBooks.Columns["Sales"].Visible        = false;
     dataGridViewAllBooks.Columns["Sales"].Visible        = false;
 }
Esempio n. 3
0
 public FormMain(Users new_user, int userId)
 {
     InitializeComponent();
     this.u          = new_user;
     this.userId     = userId;
     textBoxLog.Text = u.Login.ToString();
     bd = new Book_ShopEntities();
     bd.Books.Load();
     dataGridViewAllBooks.DataSource = bd.Books.Local.ToBindingList();
     dataGridViewAllBooks.Columns["Themes"].Visible       = false;
     dataGridViewAllBooks.Columns["Authors"].Visible      = false;
     dataGridViewAllBooks.Columns["Publishers"].Visible   = false;
     dataGridViewAllBooks.Columns["Discounts"].Visible    = false;
     dataGridViewAllBooks.Columns["NextTome"].Visible     = false;
     dataGridViewAllBooks.Columns["Reservations"].Visible = false;
     dataGridViewAllBooks.Columns["Sales"].Visible        = false;
 }
Esempio n. 4
0
        private void btnNewBook_Click(object sender, EventArgs e)
        {
            //bd.Configuration.LazyLoadingEnabled = true;
            //bd = new Book_ShopEntities1();
            //var selected = bd.InfoBook;
            //StringBuilder builder = new StringBuilder();
            //foreach (InfoBook book in selected)
            //{
            //    builder.AppendLine($"{book.NameBook} {book.Fullname_Author}");
            //}
            //dataGridViewAllBooks.DataSource = null;
            //dataGridViewAllBooks.DataSource = builder.ToString();

            bd = new Book_ShopEntities();
            var new_book = bd.InfoBook.OrderBy(x => x.NameBook).ToList();

            dataGridViewAllBooks.DataSource = null;
            dataGridViewAllBooks.DataSource = new_book;
        }
Esempio n. 5
0
 public SearchForm(Books b, Authors a, Themes t)
 {
     InitializeComponent();
     this.b = b;
     this.a = a;
     this.t = t;
     bd     = new Book_ShopEntities();
     cmbBoxName.DataSource   = null;
     cmbBoxAuthor.DataSource = null;
     cmbBoxTheme.DataSource  = null;
     //cmbBoxName.DataSource = bd.Books.ToList();
     //cmbBoxName.DisplayMember = "NameBook";
     //cmbBoxName.ValueMember = "Id_Book";
     //cmbBoxAuthor.DataSource = bd.Books.ToList();
     //cmbBoxAuthor.DisplayMember = "LastName";
     //cmbBoxAuthor.ValueMember = "Id_Author";
     //cmbBoxTheme.DataSource = bd.Books.ToList();
     //cmbBoxTheme.DisplayMember = "NameGenre";
     //cmbBoxTheme.ValueMember = "Id_Theme";
 }
Esempio n. 6
0
 public UserForm()
 {
     InitializeComponent();
     bd = new Book_ShopEntities();
     textBoxPassword.PasswordChar = '*';
 }