public ActionResult CreateTeams(int id) { var m = new OrgGroupsModel(id); m.createTeamGroups(); return Content("Complete"); }
public ActionResult AssignSelectedToTargetGroup(OrgGroupsModel m) { var a = m.List.ToArray(); var sgname = DbUtil.Db.MemberTags.Single(mt => mt.Id == m.groupid).Name; var q2 = from om in m.OrgMembers() where om.OrgMemMemTags.All(mt => mt.MemberTag.Name != sgname) where a.Contains(om.PeopleId) select om; foreach (var om in q2) om.AddToGroup(DbUtil.Db, sgname); DbUtil.Db.SubmitChanges(); return View("Rows", m); }
public ActionResult DeleteGroup(OrgGroupsModel m) { var group = DbUtil.Db.MemberTags.SingleOrDefault(g => g.Id == m.groupid); if (group != null) { DbUtil.Db.OrgMemMemTags.DeleteAllOnSubmit(group.OrgMemMemTags); DbUtil.Db.MemberTags.DeleteOnSubmit(group); DbUtil.Db.SubmitChanges(); m.groupid = (from v in m.Groups() where v.Value != "0" select v.Value).FirstOrDefault().ToInt(); ViewData["groupid"] = m.groupid.ToString(); } return View("Form", m); }
public ActionResult MakeNewGroup(OrgGroupsModel m) { if (!m.GroupName.HasValue()) return Content("error: no group name"); var Db = DbUtil.Db; var group = Db.MemberTags.SingleOrDefault(g => g.Name == m.GroupName && g.OrgId == m.orgid); if (group == null) { group = new MemberTag { Name = m.GroupName, OrgId = m.orgid }; Db.MemberTags.InsertOnSubmit(group); Db.SubmitChanges(); } m.groupid = group.Id; ViewData["newgid"] = group.Id; return View("Form", m); }
public ActionResult Index(int id) { var m = new OrgGroupsModel( id ); return View(m); }
public ActionResult Filter(OrgGroupsModel m) { return View("Rows", m); }
public ActionResult RenameGroup(OrgGroupsModel m) { if (!m.GroupName.HasValue() || m.groupid == 0) return Content("error: no group name"); var group = DbUtil.Db.MemberTags.SingleOrDefault(d => d.Id == m.groupid); if (group != null) group.Name = m.GroupName; DbUtil.Db.SubmitChanges(); m.GroupName = null; return View("Form", m); }
public ActionResult RemoveSelectedFromTargetGroup(OrgGroupsModel m) { var a = m.List.ToArray(); var sgname = DbUtil.Db.MemberTags.Single(mt => mt.Id == m.groupid).Name; var q1 = from omt in DbUtil.Db.OrgMemMemTags where omt.OrgId == m.orgid where omt.MemberTag.Name == sgname where a.Contains(omt.PeopleId) select omt; DbUtil.Db.OrgMemMemTags.DeleteAllOnSubmit(q1); DbUtil.Db.SubmitChanges(); return View("Rows", m); }
public ActionResult Management( int id ) { var m = new OrgGroupsModel(id); return View(m); }