public static GroupEditView GetGroupEditViewForUser(Guid appUserId) { ApplicationDbContext db = new ApplicationDbContext(); GroupEditView view = GetGroupEditViewForUser(db, appUserId); db.Dispose(); return(view); }
public static GroupEditView GetGroupEditViewForForUserOnly(ApplicationDbContext db, Guid appUserId) { List <GroupListView> groupListViewsCreatedByUser = GroupViewHelpers.GetGroupListViewsCreatedByUser(db, appUserId); GroupEditView view = new GroupEditView() { GroupListViewsCreatedByUser = groupListViewsCreatedByUser, GroupListViewsRelevantToUser = new List <GroupListView>() }; return(view); }
// GET: Groups public ActionResult Index() { GroupEditView model = GroupViewHelpers.GetGroupEditViewForUser(db, AppUserHelpers.GetAppUserIdFromUser(User)); return(View(model)); //This view will do everything. //List all groups you belong to //List all your 'friends' groups //List the 'requests' to join your group for approval //Allow you to 'add' a new group //Allow you to remove 'your' group (you are group admin) //Allow you to 'request' a friend join your group (on them saying yes it automatically adds them) //Allow you to 'join' a friends group (on them saying yes it automatically adds you) //PS Need to add the 'friend request' stuff also. - i.e. //Friend table that holds type (User, branch, company) and Id. //- on company admin it will show company friends and give 'admin' the ability to add/remove etc.. //- on branch admin it will show branch friends and give 'admin' & 'manager' the ability to add/remove etc. //- on user it will show user friends and give all ability to add/remove etc.. //.....therefore 'add friend' on listings page highlighting company/branch/user need to be displayed for those with right access. //.....this will then go off for approval }