Esempio n. 1
0
        public ActionResult Index(int id, bool? showall, bool? sortbyname, bool? CurrentMembers, bool? showlarge)
        {
            var m = new MeetingModel(id)
            {
                currmembers = CurrentMembers ?? false,
                showall = showall == true,
                sortbyname = sortbyname == true,
                showlarge = showlarge ?? false
            };
            if (m.meeting == null)
                return RedirectShowError("no meeting");

            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 {m.meeting.Organization.OrganizationName}");
            return View(m);
        }
Esempio n. 2
0
 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");
 }
Esempio n. 3
0
        public ActionResult iPad(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.OrgLeadersOnly
                && !DbUtil.Db.OrganizationMembers.Any(om =>
                    om.OrganizationId == m.meeting.OrganizationId
                    && om.PeopleId == Util.UserPeopleId
                    && om.MemberType.AttendanceTypeId == AttendTypeCode.Leader))
                return RedirectShowError("You must be a leader of this organization to have access to this page");
            DbUtil.LogActivity($"iPad Meeting for {m.meeting.OrganizationId}({m.meeting.MeetingDate:d})");
            return View(m);
        }
Esempio n. 4
0
 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());
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 public ActionResult TicketMeeting(int id)
 {
     var m = new MeetingModel(id);
     return View(m);
 }
Esempio n. 8
0
 public ContentResult JoinAllVisitors(int id)
 {
     var m = new MeetingModel(id);
     var 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 {n} visitors");
     }
     return Content("no visitors");
 }
Esempio n. 9
0
 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;
             case 't':
                 DbUtil.Db.ExecuteCommand("update dbo.Attend set MeetingDate = {0} where MeetingId = {1}",
                     value.ToDate(), m.meeting.MeetingId);
                 m.meeting.MeetingDate = value.ToDate();
                 break;
         }
         DbUtil.Db.SubmitChanges();
         return Content(value);
     }
     catch (Exception ex)
     {
         return Content("error: " + ex.Message);
     }
 }