public ActionResult Index(int id, bool? inactives, bool? pendings, int? sg) { var m = new OrgMembersDialogModel { orgid = id, inactives = inactives ?? false, pendings = pendings ?? false, Pending = pendings ?? false, sg = sg, }; return View(m); }
public ActionResult Update(OrgMembersDialogModel m) { var Db = DbUtil.Db; var tag = Db.PopulateTemporaryTag(m.List); var q = from om in m.OrgMembers() where Db.TagPeople.Any(tt => tt.Id == tag.Id && tt.PeopleId == om.PeopleId) select om; foreach (var om in q) { if (m.MemberType == MemberTypeCode.Drop) om.Drop(Db, addToHistory: true); else { if (m.MemberType > 0) om.MemberTypeId = m.MemberType; if (m.InactiveDate.HasValue) om.InactiveDate = m.InactiveDate; if (m.EnrollmentDate.HasValue) om.EnrollmentDate = m.EnrollmentDate; om.Pending = m.Pending; if (m.addpmt.HasValue) om.AddTransaction(Db, m.addpmt ?? 0, m.addpmtreason); if (m.MemTypeOriginal) { var et = (from e in Db.EnrollmentTransactions where e.PeopleId == om.PeopleId where e.OrganizationId == m.orgid orderby e.TransactionDate select e).First(); et.MemberTypeId = om.MemberTypeId; } } Db.SubmitChanges(); } return View(); }
public ActionResult Filter(OrgMembersDialogModel m) { return View("Rows", m); }