public ActionResult TicketMeeting(int id) { var m = new MeetingModel(id); return View(m); }
public ActionResult Tickets(int? id) { if (!id.HasValue) return RedirectShowError("no id"); var m = new MeetingModel(id.Value); m.showall = true; if (m.meeting == null) return RedirectShowError("no meeting"); if (Util2.OrgMembersOnly && !DbUtil.Db.OrganizationMembers.Any(om => om.OrganizationId == m.meeting.OrganizationId && om.PeopleId == Util.UserPeopleId)) return RedirectShowError("You must be a member of this organization to have access to this page"); else if (Util2.OrgLeadersOnly && !DbUtil.Db.OrganizationMembers.Any(om => om.OrganizationId == m.meeting.OrganizationId && om.PeopleId == Util.UserPeopleId && om.MemberType.AttendanceTypeId == CmsData.Codes.AttendTypeCode.Leader)) return RedirectShowError("You must be a leader of this organization to have access to this page"); DbUtil.LogActivity("Tickets Meeting for {0}({1:d})".Fmt(m.meeting.OrganizationId, m.meeting.MeetingDate)); return View(m); }
public ContentResult JoinAllVisitors(int id) { var m = new MeetingModel(id); int n = 0; foreach (var a in m.VisitAttends()) { OrganizationMember.InsertOrgMembers(DbUtil.Db, m.meeting.OrganizationId, a.PeopleId, MemberTypeCode.Member, DateTime.Today, null, false); n++; } if (n > 0) { DbUtil.Db.UpdateMainFellowship(m.meeting.OrganizationId); return Content("Joined {0} visitors".Fmt(n)); } return Content("no visitors"); }
public ActionResult NewExtraValue(int id, string field, string value, bool multiline) { var m = new MeetingModel(id); try { var mev = new MeetingExtra { MeetingId = id, Field = field, Data = value, DataType = multiline ? "text" : null }; DbUtil.Db.MeetingExtras.InsertOnSubmit(mev); DbUtil.Db.SubmitChanges(); } catch (Exception ex) { return Content("error: " + ex.Message); } return View("ExtrasGrid", m.meeting); }
public ActionResult Index(int? id, bool? showall, bool? sortbyname, bool? CurrentMembers, bool? showlarge) { if (!id.HasValue) return RedirectShowError("no id"); var m = new MeetingModel(id.Value) { currmembers = CurrentMembers ?? false, showall = showall == true, sortbyname = sortbyname == true, showlarge = showlarge ?? false }; if (m.meeting == null) return RedirectShowError("no meeting"); if (Util2.OrgMembersOnly) { if (m.org.SecurityTypeId == 3) return NotAllowed("You do not have access to this page", m.org.OrganizationName); else if (m.org.OrganizationMembers.All(om => om.PeopleId != Util.UserPeopleId)) return NotAllowed("You must be a member of this organization", m.org.OrganizationName); } else if (Util2.OrgLeadersOnly) { var oids = DbUtil.Db.GetLeaderOrgIds(Util.UserPeopleId); if (!oids.Contains(m.org.OrganizationId)) return NotAllowed("You must be a leader of this organization", m.org.OrganizationName); } if (m.org.LimitToRole.HasValue()) if (!User.IsInRole(m.org.LimitToRole)) return NotAllowed("no privilege to view ", m.org.OrganizationName); DbUtil.LogActivity("Viewing Meeting for {0}".Fmt(m.meeting.Organization.OrganizationName)); return View(m); }
public ContentResult EditGroup(string id, string value) { var i = id.Substring(2).ToInt(); var m = new MeetingModel(i); m.meeting.GroupMeetingFlag = value == "true"; DbUtil.Db.SubmitChanges(); if (m.meeting.GroupMeetingFlag) return Content("Group (headcount)"); return Content("Regular"); }
public ContentResult EditAttendCredit(string id, string value) { var i = id.Substring(2).ToInt(); var m = new MeetingModel(i); m.meeting.AttendCreditId = value.ToInt(); DbUtil.Db.SubmitChanges(); return Content(m.AttendCreditType()); }
public ContentResult Edit(string id, string value) { try { var i = id.Substring(2).ToInt(); var m = new MeetingModel(i); switch (id[0]) { case 'd': m.meeting.Description = value; break; case 'h': m.meeting.HeadCount = value.ToInt(); break; } DbUtil.Db.SubmitChanges(); return Content(value); } catch (Exception ex) { return Content("error: " + ex.Message); } }
public ViewResult DeleteExtra(int id, string field) { var e = DbUtil.Db.MeetingExtras.Single(ee => ee.MeetingId == id && ee.Field == field); DbUtil.Db.MeetingExtras.DeleteOnSubmit(e); DbUtil.Db.SubmitChanges(); var m = new MeetingModel(id); return View("ExtrasGrid", m.meeting); }