示例#1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            AdvocateGroup advocateGroup = await db.AdvocateGroups.FindAsync(id);

            db.AdvocateGroups.Remove(advocateGroup);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,GroupName,Description,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] AdvocateGroup advocateGroup)
        {
            if (ModelState.IsValid)
            {
                db.Entry(advocateGroup).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(advocateGroup));
        }
示例#3
0
        // GET: AdvocateGroups/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdvocateGroup advocateGroup = await db.AdvocateGroups.FindAsync(id);

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