private string getGroupField(LabelField field, string format, AttendanceGroup group) { if (group == null) { return(""); } switch (field) { case LabelField.GROUP_NAME: return(string.Format(format, group.org.OrganizationName)); case LabelField.GROUP_LOCATION: return(string.Format(format, group.org.Location)); case LabelField.GROUP_SUBGROUPS: return(group.subgroupName); case LabelField.ATTENDANCE_DATE_TIME: return(string.Format(format, group.meeting.MeetingDate)); case LabelField.ATTENDANCE_PAGER: return(""); case LabelField.ATTENDANCE_NOTES: return(""); default: return(""); } }
public LabelEntry(LabelFormatEntry formatEntry, Attendance attendance, AttendanceGroup group = null, int index = 0) { typeID = formatEntry.typeID; switch (formatEntry.typeID) { case 1: try { data = getField((LabelField)formatEntry.fieldID, formatEntry.fieldFormat, attendance, group); } catch (Exception) { data = "Format Exception"; } break; case 4: case 5: data = formatEntry.fieldFormat; break; default: data = ""; break; } font = formatEntry.font; fontSize = formatEntry.fontSize; start.x = formatEntry.startX; start.y = formatEntry.startY + (formatEntry.offset * index); align.x = formatEntry.alignX; align.y = formatEntry.alignY; end.x = formatEntry.endX; end.y = formatEntry.endY + (formatEntry.offset * index); size.x = formatEntry.width; size.y = formatEntry.height; }
public string getField(LabelField field, string format, Attendance attendance, AttendanceGroup group) { switch (field.category()) { case LabelFieldAttribute.CATEGORY_UNUSED: return(""); case LabelFieldAttribute.CATEGORY_PERSON: return(getPersonField(field, format, attendance)); case LabelFieldAttribute.CATEGORY_PARENTS: return(getParentsField(field, format, attendance)); case LabelFieldAttribute.CATEGORY_GROUP: return(getGroupField(field, format, group)); default: return(""); } }
private string getGroupField(AttendanceCacheSet cacheSet, LabelField field, string format, AttendanceGroup group) { if (group == null) { return(""); } Organization org; Meeting meeting; switch (field) { case LabelField.GROUP_NAME: org = cacheSet.getOrganization(group.groupID); return(org == null ? "" : string.Format(format, org.OrganizationName)); case LabelField.GROUP_LOCATION: org = cacheSet.getOrganization(group.groupID); return(org == null ? "" : string.Format(format, org.Location)); case LabelField.GROUP_SUBGROUPS: return(group.subgroupName); case LabelField.ATTENDANCE_DATE_TIME: meeting = cacheSet.getMeeting(group.groupID, group.datetime); return(string.Format(format, meeting.MeetingDate)); case LabelField.ATTENDANCE_PAGER: return(""); case LabelField.ATTENDANCE_NOTES: return(""); default: return(""); } }
public LabelEntry(AttendanceCacheSet cacheSet, LabelFormatEntry formatEntry, Attendance attendance, AttendanceGroup group = null, int index = 0) { typeID = formatEntry.typeID; switch (formatEntry.typeID) { case 1: try { data = getField(cacheSet, (LabelField)formatEntry.fieldID, formatEntry.fieldFormat, attendance, group); } catch (Exception) { data = "Format Exception"; } break; case 4: case 5: data = formatEntry.fieldFormat; break; case 6: // populate box data so that it is printed if data is present // later we remove box entries if they are behind a blank field by querying this data prop try { if (formatEntry.invert && formatEntry.fieldID != 0) { data = getField(cacheSet, (LabelField)formatEntry.fieldID, formatEntry.fieldFormat, attendance, group); } else { data = "print"; } } catch (Exception) { data = "Format Exception"; } break; default: data = ""; break; } font = formatEntry.font; fontSize = formatEntry.fontSize; start.x = formatEntry.startX; start.y = formatEntry.startY + (formatEntry.offset * index); align.x = formatEntry.alignX; align.y = formatEntry.alignY; end.x = formatEntry.endX; end.y = formatEntry.endY + (formatEntry.offset * index); size.x = formatEntry.width; size.y = formatEntry.height; invert = formatEntry.invert; order = formatEntry.order; }
private string getGroupField(AttendanceCacheSet cacheSet, LabelField field, string format, AttendanceGroup group) { if (group == null) { return(""); } Organization org; Meeting meeting; switch (field) { case LabelField.GROUP_NAME: org = cacheSet.getOrganization(group.groupID); return(org == null ? "" : string.Format(format, org.OrganizationName)); case LabelField.GROUP_LOCATION: org = cacheSet.getOrganization(group.groupID); return(org == null ? "" : string.Format(format, org.Location)); case LabelField.GROUP_SUBGROUPS: return(group.subgroupName); case LabelField.GROUP_LOCATION_AND_SUBGROUP: org = cacheSet.getOrganization(group.groupID); List <string> groupItems = new List <string>(); if (org != null && org.Location.HasValue()) { groupItems.Add(org.Location); } if (group.subgroupName.HasValue()) { groupItems.Add(group.subgroupName); } return(string.Format(format, string.Join(" - ", groupItems))); case LabelField.GROUP_NAME_AND_TIME: org = cacheSet.getOrganization(group.groupID); meeting = cacheSet.getMeeting(group.groupID, group.datetime); string orgName = org == null ? "" : org.OrganizationName; return(string.Format(format, orgName, meeting.MeetingDate)); case LabelField.ATTENDANCE_DATE_TIME: meeting = cacheSet.getMeeting(group.groupID, group.datetime); return(string.Format(format, meeting.MeetingDate)); case LabelField.ATTENDANCE_PAGER: return(""); case LabelField.ATTENDANCE_NOTES: return(""); default: return(""); } }
public LabelEntry(AttendanceCacheSet cacheSet, LabelFormatEntry formatEntry, Attendance attendance, AttendanceGroup group = null, int index = 0) { bool conditionalRemovedEntry = false; typeID = formatEntry.typeID; if (formatEntry.orgEV.HasValue()) { Organization org = cacheSet.getOrganization(group.groupID); if (org != null) { var ev = org.OrganizationExtras.SingleOrDefault(e => e.Field == formatEntry.orgEV); if (ev == null) { conditionalRemovedEntry = true; } } else { conditionalRemovedEntry = true; } } if (formatEntry.personFlag.HasValue() && conditionalRemovedEntry == false) { CmsData.Person person = cacheSet.getPerson(attendance.peopleID); if (person != null) { var sf = cacheSet.dataContext.ViewAllStatusFlags.SingleOrDefault(f => f.Flag == formatEntry.personFlag && f.PeopleId == person.PeopleId); if (sf == null) { conditionalRemovedEntry = true; } } else { conditionalRemovedEntry = true; } } switch (formatEntry.typeID) { case 1: try { data = getField(cacheSet, (LabelField)formatEntry.fieldID, formatEntry.fieldFormat, attendance, group); } catch (Exception) { data = "Format Exception"; } break; case 4: case 5: data = formatEntry.fieldFormat; break; case 6: // populate box data so that it is printed if data is present // later we remove box entries if they are behind a blank field by querying this data prop try { if (formatEntry.invert && formatEntry.fieldID != 0) { data = getField(cacheSet, (LabelField)formatEntry.fieldID, formatEntry.fieldFormat, attendance, group); } else { data = "print"; } } catch (Exception) { data = "Format Exception"; } break; default: data = ""; break; } font = formatEntry.font; fontSize = formatEntry.fontSize; start.x = formatEntry.startX; start.y = formatEntry.startY + (formatEntry.offset * index); align.x = formatEntry.alignX; align.y = formatEntry.alignY; end.x = formatEntry.endX; end.y = formatEntry.endY + (formatEntry.offset * index); size.x = formatEntry.width; size.y = formatEntry.height; invert = formatEntry.invert; order = formatEntry.order; if (conditionalRemovedEntry) { data = "ConditionalRemovedEntry"; } }