public async Task <IActionResult> Edit(int id, [Bind("AnschriftHerstellerID,Name,Kundennummer,Strasse,Hausnummer,Ort,Zusatz,PLZ,Email,Homepage,Telefonnummer,Fax,Handy")] AnschriftHersteller anschriftHersteller)
        {
            if (id != anschriftHersteller.AnschriftHerstellerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(anschriftHersteller);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AnschriftHerstellerExists(anschriftHersteller.AnschriftHerstellerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(anschriftHersteller));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("AnschriftGeschaeftID,Name,Kundennummer,Strasse,Hausnummer,PLZ,Ort,Zusatz,Email,Homepage,Telefonnummer,Fax,Handy,OeffnungsZeitenMontag,OeffnungsZeitenDienstag,OeffnungsZeitenMittwoch,OeffnungsZeitenDonnerstag,OeffnungsZeitenFreitag,OeffnungsZeitenSamstag,OeffnungsZeitenSonntag")] AnschriftGeschaeft anschriftGeschaeft)
        {
            if (id != anschriftGeschaeft.AnschriftGeschaeftID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(anschriftGeschaeft);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AnschriftGeschaeftExists(anschriftGeschaeft.AnschriftGeschaeftID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(anschriftGeschaeft));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("PreisId,Kosten,PreisDatum,ProduktId,AnschriftGeschaeftID")] Preis preis)
        {
            if (id != preis.PreisId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(preis);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PreisExists(preis.PreisId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AnschriftGeschaeftID"] = new SelectList(_context.Geschaeft, "AnschriftGeschaeftID", "Name", preis.AnschriftGeschaeftID);
            ViewData["ProduktId"]            = new SelectList(_context.Produkt, "ProduktId", "ProduktId", preis.ProduktId);
            return(View(preis));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ProduktKategorieId,Name")] Kategorie kategorie)
        {
            if (id != kategorie.ProduktKategorieId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kategorie);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KategorieExists(kategorie.ProduktKategorieId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(kategorie));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ProduktId,AnschriftHerstellerID,ProduktKategorieId,ProduktTyp,ProduktName,Zusatztext,Inhalt,InhaltMesseinheit,IstBio,Produktcode")] Produkt produkt)
        {
            if (id != produkt.ProduktId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(produkt);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProduktExists(produkt.ProduktId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AnschriftHerstellerID"] = new SelectList(_context.Hersteller, "AnschriftHerstellerID", "Name", produkt.AnschriftHerstellerID);
            return(View(produkt));
        }