private int RecordAttend2Extracted(int id, int peopleId, bool present, DateTime dt, User u) { //todo: static var meetingId = CurrentDatabase.CreateMeeting(id, dt); Attend.RecordAttendance(peopleId, meetingId, present); CurrentDatabase.UpdateMeetingCounters(id); DbUtil.LogActivity($"Mobile RecAtt o:{id} p:{peopleId} u:{CurrentDatabase.UserPeopleId} a:{present}"); return(meetingId); }
public ActionResult Request0(long ticks, int oid, int limit) { var time = new DateTime(ticks); // ticks here is meeting time var mid = CurrentDatabase.CreateMeeting(oid, time); var vs = new VolunteerRequestModel(mid, Util.UserPeopleId.Value) { limit = limit }; vs.ComposeMessage(); return(View("Request", vs)); }
public ActionResult RollList(int id, DateTime datetime) { if (!Authenticate()) { return(Content("not authorized")); } var u = CurrentDatabase.Users.Single(uu => uu.Username == AccountModel.UserName2); DbUtil.LogActivity($"iphone RollList {id} {datetime:g}"); var mid = CurrentDatabase.CreateMeeting(id, datetime); var meeting = CurrentDatabase.LoadMeetingById(mid); return(new RollListResult(meeting)); }
public ActionResult RecordAttend(string data) { // Authenticate first if (!Auth()) { return(CheckInMessage.createErrorReturn("Authentication failed, please try again", CheckInMessage.API_ERROR_INVALID_CREDENTIALS)); } CheckInMessage dataIn = CheckInMessage.createFromString(data); CheckInAttend cia = JsonConvert.DeserializeObject <CheckInAttend>(dataIn.data); Meeting meeting = CurrentDatabase.Meetings.SingleOrDefault(m => m.OrganizationId == cia.orgID && m.MeetingDate == cia.datetime); if (meeting == null) { int meetingID = CurrentDatabase.CreateMeeting(cia.orgID, cia.datetime); meeting = CurrentDatabase.Meetings.SingleOrDefault(m => m.MeetingId == meetingID); } Attend.RecordAttend(CurrentDatabase, cia.peopleID, cia.orgID, cia.present, cia.datetime); CurrentDatabase.UpdateMeetingCounters(cia.orgID); DbUtil.LogActivity($"Check-In Record Attend Org ID:{cia.orgID} People ID:{cia.peopleID} User ID:{CurrentDatabase.UserPeopleId} Attended:{cia.present}"); // Check Entry Point and replace if Check-In Person person = CurrentDatabase.People.FirstOrDefault(p => p.PeopleId == cia.peopleID); if (person != null && person.EntryPoint != null && person.EntryPoint.Code != null && person.EntryPoint.Code == "CHECKIN" && meeting != null) { person.EntryPoint = meeting.Organization.EntryPoint; CurrentDatabase.SubmitChanges(); } CheckInMessage br = new CheckInMessage(); br.setNoError(); br.count = 1; return(br); }