コード例 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Achat achat = await db.Achat.FindAsync(id);

            db.Achat.Remove(achat);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "Code_Achat,Code_Enregistrement,Code_Abonne,Achat_Confirme")] Achat achat)
        {
            if (ModelState.IsValid)
            {
                db.Entry(achat).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Code_Abonne         = new SelectList(db.Abonne, "Code_Abonne", "Nom_Abonne", achat.Code_Abonne);
            ViewBag.Code_Enregistrement = new SelectList(db.Enregistrement, "Code_Morceau", "Titre", achat.Code_Enregistrement);
            return(View(achat));
        }
コード例 #3
0
        // GET: Achats/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Achat achat = await db.Achat.FindAsync(id);

            if (achat == null)
            {
                return(HttpNotFound());
            }
            return(View(achat));
        }
コード例 #4
0
        // GET: Achats/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Achat achat = await db.Achat.FindAsync(id);

            if (achat == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Code_Abonne         = new SelectList(db.Abonne, "Code_Abonne", "Nom_Abonne", achat.Code_Abonne);
            ViewBag.Code_Enregistrement = new SelectList(db.Enregistrement, "Code_Morceau", "Titre", achat.Code_Enregistrement);
            return(View(achat));
        }