Beispiel #1
0
        public BoekScherm(Overzicht_groot submain, Boek boek, bool is_edit = false)
        {
            InitializeComponent();
            this.submain = submain;
            this.is_edit = is_edit;
            this.boek    = boek;
            if (is_edit)
            {
                foreach (Control c in this.Controls)
                {
                    if (c.GetType().FullName != "System.Windows.Forms.Label")
                    {
                        c.Visible = true;
                    }
                    else
                    {
                        if (c.Name.Substring(0, 6) == "lblGeg")
                        {
                            c.Visible = false;
                        }
                    }
                }

                boekvoorraad.boek_isbn_nummer = boek.isbn_nummer;
                boekvoorraad     = BoekvoorraadDb.ophalen(boekvoorraad.boek_isbn_nummer);
                txtVoorraad.Text = Convert.ToString(boekvoorraad.aantal);

                txtIsbnNummer.Text   = boek.isbn_nummer.ToString();
                txtTitel.Text        = boek.titel.ToString();
                txtAuteur.Text       = boek.auteur.ToString();
                txtGenre.Text        = boek.genre.ToString();
                txtBeschrijving.Text = boek.beschrijving.ToString();
                txtPrijs.Text        = boek.prijs.ToString();
                btnKlaar.Visible     = true;
                btnKlaar.Text        = "Wijzigen";
            }
            else
            {
                foreach (Control c in this.Controls)
                {
                    if (c.GetType().FullName == "System.Windows.Forms.Label" && c.Name != "lblError")
                    {
                        c.Visible = true;
                    }
                }
                txtBeschrijving.Visible = true;

                lblGegIsbnNummer.Text = boek.isbn_nummer.ToString();
                lblGegTitel.Text      = boek.titel.ToString();
                lblGegAuteur.Text     = boek.auteur.ToString();
                lblGegGenre.Text      = boek.genre.ToString();
                lblGegPrijs.Text      = "€ " + boek.prijs.ToString();
                lblGegVoorraad.Text   = BoekvoorraadDb.ophalen(boek.isbn_nummer).aantal.ToString();

                txtBeschrijving.Text     = boek.beschrijving.ToString();
                txtBeschrijving.ReadOnly = true;
                btnKlaar.Visible         = false;
            }
        }
Beispiel #2
0
 public BoekScherm(Overzicht_groot submain, Uitgeversector uitgever)
 {
     InitializeComponent();
     this.submain  = submain;
     this.uitgever = uitgever;
     foreach (Control c in this.Controls)
     {
         if (c.GetType().FullName != "System.Windows.Forms.Label")
         {
             c.Visible = true;
         }
         btnKlaar.Visible = true;
         btnKlaar.Text    = "Aanmaken";
     }
 }
Beispiel #3
0
        //bestelling scherm aanmaken
        public BestelScherm(Overzicht_groot submain, Klant klant)
        {
            InitializeComponent();
            this.submain = submain;
            this.klant   = klant;
            datum        = DateTime.Now;
            vulDgUitgever();
            foreach (Control c in this.Controls)
            {
                if (c.GetType().FullName != "System.Windows.Forms.Label" && c.GetType().FullName != "System.Windows.Forms.PictureBox")
                {
                    c.Visible = true;
                }

                lblZoek.Visible      = true;
                btnFactuur.Visible   = false;
                btnPrinten.Visible   = false;
                picHuisstijl.Visible = false;
                btnKlaar.Visible     = true;
                btnKlaar.Text        = "Aanmaken";
            }
            dgvBoeken.Enabled = true;

            if (dgvBoeken.Rows.Count > 0)
            {
                dgvBoeken.Rows[0].Cells[0].Selected = true;
            }

            dgvBoeken.Focus();

            dgvBoeken.Columns["Toevoegen"].DisplayIndex = 0;
            dgvBoeken.Columns["Aantal"].DisplayIndex    = 1;
            dgvBoeken.Columns["Prijs"].DisplayIndex     = 7;

            vulCmbZoek();
        }
Beispiel #4
0
        //bestelling laten zien
        public BestelScherm(Overzicht_groot submain, Klant klant, Bestelling bestelling)
        {
            InitializeComponent();
            this.submain    = submain;
            this.bestelling = bestelling;
            this.klant      = klant;

            foreach (Control c in this.Controls)
            {
                if (c.GetType().FullName == "System.Windows.Forms.Label" && c.Name != "lblError" && c.Name != "lblGegStatusExtra" && c.Name != "lblZoek")
                {
                    c.Visible = true;
                }
            }

            btnKlaar.Visible   = false;
            btnFactuur.Visible = true;
            btnPrinten.Visible = true;

            lblGegBesteldatum.Text = bestelling.besteldatum.ToString().Substring(0, bestelling.besteldatum.ToString().Length - 3);
            lblGegLeverdatum.Text  = bestelling.leverdatum.ToString().Substring(0, bestelling.leverdatum.ToString().Length - 8);

            lblGegStatus.Text = bestelling.status.ToString();

            if (bestelling.status == "Boek is gedrukt.")
            {
                lblGegStatusExtra.Text    = "klik op het icoontje om de klant een mail te sturen";
                lblGegStatusExtra.Visible = true;
            }

            if (bestelling.status == "Wachten op klant.")
            {
                lblGegStatusExtra.Text    = "klik op het icoontje om de bevestiging te voltooien";
                lblGegStatusExtra.Visible = true;
            }


            checkStatus();

            bestellingregel.bestelling_id = bestelling.id;
            DataTable dt = new DataTable();


            dt = BestellingregelDB.overzicht(bestellingregel);

            foreach (DataRow drow in dt.Rows)
            {
                bestellingregel.boek_isbn_nummer = Convert.ToString(drow["boek_isbn_nummer"]);
                dt = BestellingregelDB.overzichtBestelling(bestellingregel);
            }

            BindingSource bindingSource = new BindingSource();

            bindingSource.DataSource = dt;
            dgvBoeken.DataSource     = bindingSource;

            dgvBoeken.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;

            if (dgvBoeken.SelectedRows.Count > 0)
            {
                dgvBoeken.Rows[0].Selected = false;
            }

            dgvBoeken.Columns["Toevoegen"].DisplayIndex = 0;
            dgvBoeken.Columns["Aantal"].DisplayIndex    = 1;
            dgvBoeken.Columns["Prijs"].DisplayIndex     = 2;

            dgvBoeken.Columns[1].Visible = false;
        }