public async Task <IActionResult> Edit(int id, [Bind("GroupID,Title,Name")] PageGroups pageGroups) { if (id != pageGroups.GroupID) { return(NotFound()); } if (ModelState.IsValid) { try { _groupRepository.UpdateGroup(pageGroups); await _groupRepository.Save(); } catch (DbUpdateConcurrencyException) { if (!PageGroupsExists(pageGroups.GroupID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pageGroups)); }
public IActionResult Edit(int id, [Bind("GroupID,GroupTitle")] PageGroups pageGroups) { if (id != pageGroups.GroupID) { return(NotFound()); } if (ModelState.IsValid) { try { db.PageGroup.UpdateGroup(pageGroups); db.PageGroup.Save(); } catch (DbUpdateConcurrencyException) { if (!PageGroupsExists(pageGroups.GroupID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pageGroups)); }
public IActionResult Create([Bind("GroupID,GroupTitle")] PageGroups pageGroups) { if (ModelState.IsValid) { db.PageGroup.InsertGroup(pageGroups); db.PageGroup.Save(); return(RedirectToAction(nameof(Index))); } return(View(pageGroups)); }
public async Task <IActionResult> Create([Bind("GroupID,Title,Name")] PageGroups pageGroups) { if (ModelState.IsValid) { _groupRepository.InsertGroup(pageGroups); await _groupRepository.Save(); return(RedirectToAction(nameof(Index))); } return(View(pageGroups)); }
public bool DeleteGroup(PageGroups pageGroups) { try { db.Entry(pageGroups).State = EntityState.Deleted; return(true); } catch { return(false); } }
public bool UpdateGroup(PageGroups pageGroups) { try { db.Entry(pageGroups).State = EntityState.Modified; return(true); } catch { return(false); } }
public bool InsertGroup(PageGroups pageGroups) { try { db.PageGroups.Add(pageGroups); return(true); } catch { return(false); } }
public bool InsertGroup(PageGroups groups) { try { _db.Add(groups); return(true); } catch { return(false); } }
public bool DeleteGroup(PageGroups groups) { try { _db.Remove(groups); return(true); } catch { return(false); } }
public bool UpdateGroup(PageGroups groups) { try { _db.Update(groups); return(true); } catch { return(false); } }