示例#1
0
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            Practics practics = await db.Practics.FindAsync(id);

            db.Practics.Remove(practics);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "practicsName")] Practics practics)
        {
            if (ModelState.IsValid)
            {
                db.Entry(practics).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(practics));
        }
示例#3
0
        public async Task <ActionResult> Create([Bind(Include = "practicsName")] Practics practics)
        {
            if (ModelState.IsValid)
            {
                db.Practics.Add(practics);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(practics));
        }
示例#4
0
        // GET: Practics/Delete/5
        public async Task <ActionResult> Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Practics practics = await db.Practics.FindAsync(id);

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