Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(string id)
        {
            factuur factuur = db.factuur.Find(id);

            db.factuur.Remove(factuur);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "factuurnummer,klantcode,medewerkerscode,datum,factuurtotaal")] factuur factuur)
 {
     if (ModelState.IsValid)
     {
         db.Entry(factuur).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.klantcode       = new SelectList(db.klant, "klantcode", "voorletters", factuur.klantcode);
     ViewBag.medewerkerscode = new SelectList(db.medewerker, "medewerkerscode", "voorletters", factuur.medewerkerscode);
     return(View(factuur));
 }
Ejemplo n.º 3
0
        // GET: Factuur/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            factuur factuur = db.factuur.Find(id);

            if (factuur == null)
            {
                return(HttpNotFound());
            }
            return(View(factuur));
        }
Ejemplo n.º 4
0
        // GET: Factuur/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            factuur factuur = db.factuur.Find(id);

            if (factuur == null)
            {
                return(HttpNotFound());
            }
            ViewBag.klantcode       = new SelectList(db.klant, "klantcode", "voorletters", factuur.klantcode);
            ViewBag.medewerkerscode = new SelectList(db.medewerker, "medewerkerscode", "voorletters", factuur.medewerkerscode);
            return(View(factuur));
        }
Ejemplo n.º 5
0
        public List <factuur> factuurReadDrankDB(int resID)
        {
            // Leest uit drankjes database uit voor factuur
            List <factuur>  data    = new List <factuur>();
            MySqlConnection mydbCon = new MySqlConnection(connectionString);

            mydbCon.Open();
            MySqlCommand command = mydbCon.CreateCommand();

            command.CommandText = "SELECT voorraad.productOmschrijving, drankbestellingen.aantal, drankjes.prijs FROM reserveringen, drankbestellingen, voorraad, drankjes WHERE drankbestellingen.dranKID = drankjes.drankID AND drankjes.productID = voorraad.productID AND reserveringen.bestellingID = drankbestellingen.bestellingID AND reserveringen.reserveringID = " + resID + "";
            MySqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                factuur vari = new factuur((string)reader["productOmschrijving"], ((int)reader["aantal"]).ToString(), (decimal)reader["prijs"], "");
                data.Add(vari);
            }
            return(data);
        }
Ejemplo n.º 6
0
        public List <factuur> readFacDB(int resID)
        {
            // Leest gegevens uit voor een factuur
            List <factuur>  data    = new List <factuur>();
            MySqlConnection mydbCon = new MySqlConnection(connectionString);

            mydbCon.Open();
            MySqlCommand command = mydbCon.CreateCommand();

            command.CommandText = "SELECT * FROM reserveringen, bestellingen, menubeschrijvingen, gebruikers WHERE gebruikers.gebruikerID = reserveringen.gebruikerID AND reserveringen.bestellingID = bestellingen.bestellingID AND menubeschrijvingen.menuID= bestellingen.menuID AND reserveringen.reserveringID = " + resID + "";
            MySqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                factuur vari = new factuur((string)reader["menuOmschrijving"], ((int)reader["aantal"]).ToString(), (decimal)reader["prijs"], (string)reader["inlognaam"]);
                data.Add(vari);
            }
            return(data);
        }