Exemplo n.º 1
0
        public SendEmail(Form1 _f1)
        {
            InitializeComponent();
            f1        = _f1;
            customers = CustomerActiveRecord.Find();
            rentals   = RentalActiveRecord.Find();

            for (int i = 0; i < customers.Count; i++)
            {
                bool remove = true;
                foreach (RentalActiveRecord rental in rentals)
                {
                    if (rental.ReturnDate == null && rental.Customer.ID == customers[i].ID)
                    {
                        remove = false;
                        break;
                    }
                }
                if (remove)
                {
                    customers.RemoveAt(i);
                }
            }
            if (customers.Count == 0)
            {
                MessageBox.Show("V databazi neexistuje zakaznik s aktivni vypujckou.");
                f1.Show();
                this.Hide();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <BookActiveRecord>         knihy          = BookActiveRecord.Find();
            List <LibrarianActiveRecord>    knihovnici     = LibrarianActiveRecord.Find();
            List <CustomerActiveRecord>     zakaznici      = CustomerActiveRecord.Find();
            List <RentalActiveRecord>       vypujcky       = RentalActiveRecord.Find();
            List <BookInRentalActiveRecord> knihyVeVypujce = BookInRentalActiveRecord.Find();
            List <AuthorActiveRecord>       autori         = AuthorActiveRecord.Find();

            AddBook addBookForm = new AddBook(this);

            addBookForm.Show();
            this.Hide();
        }
Exemplo n.º 3
0
        public AddRental(Form1 _f1)
        {
            InitializeComponent();

            f1 = _f1;

            booksToRent = new List <BookActiveRecord>();
            books       = BookActiveRecord.Find();
            customers   = CustomerActiveRecord.Find();

            for (int i = 0; i < books.Count; i++)
            {
                if (books[i].Available == 0)
                {
                    books.RemoveAt(i);
                }
            }

            cb_kniha.DataSource    = books;
            cb_zakaznik.DataSource = customers;
        }