public ActionResult Modify(string courseCode) { CourseGetResponse cgr = _courseCom.GetCourse(courseCode); ModifyGroupsModel mgm = new ModifyGroupsModel(); mgm.courseCode = cgr.CourseCode; mgm.courseName = cgr.CourseName; mgm.courseDescription = cgr.CourseDescription; mgm.UserAndGroups = new List <GroupModifiableModel>(); List <string> groups = null; if (cgr.CourseGroups != null) { groups = cgr.CourseGroups.Select(x => x.GroupName).ToList(); } foreach (var grp in cgr.CourseGroups) { foreach (var gm in grp.GroupUsers) { GroupModifiableModel gmm = new GroupModifiableModel(); gmm.GroupName = grp.GroupName; gmm.Objective = grp.Objective; gmm.NewGroups = groups; gmm.SuggestedGroups = ""; //_courseUserCom.getSuggestedGroups(gm.EmailID, cgr.CourseCode); gmm.MemberName = gm.Name; gmm.EmailId = gm.EmailID; mgm.UserAndGroups.Add(gmm); } } return(View(mgm)); }
public async Task <ActionResult> Modify(ModifyGroupsModel model) { if (ModelState.IsValid) { return(RedirectToAction("Modify")); } return(View(model)); }