예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Type_Morceaux type_Morceaux = await db.Type_Morceaux.FindAsync(id);

            db.Type_Morceaux.Remove(type_Morceaux);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "Code_Type,Libelle_Type,Description")] Type_Morceaux type_Morceaux)
        {
            if (ModelState.IsValid)
            {
                db.Entry(type_Morceaux).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(type_Morceaux));
        }
예제 #3
0
        public async Task <ActionResult> Create([Bind(Include = "Code_Type,Libelle_Type,Description")] Type_Morceaux type_Morceaux)
        {
            if (ModelState.IsValid)
            {
                db.Type_Morceaux.Add(type_Morceaux);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(type_Morceaux));
        }
예제 #4
0
        // GET: Type_Morceaux/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Type_Morceaux type_Morceaux = await db.Type_Morceaux.FindAsync(id);

            if (type_Morceaux == null)
            {
                return(HttpNotFound());
            }
            return(View(type_Morceaux));
        }