Exemple #1
0
 private static void GetGroupTypeLabels(GroupTypeCache groupType, List <CheckInLabel> labels, Dictionary <string, object> mergeObjects, List <Guid> labelGuids)
 {
     foreach (var attribute in groupType.Attributes.OrderBy(a => a.Value.Order))
     {
         if (attribute.Value.FieldType.Guid == Rock.SystemGuid.FieldType.LABEL.AsGuid() &&
             attribute.Value.QualifierValues.ContainsKey("binaryFileType") &&
             attribute.Value.QualifierValues["binaryFileType"].Value.Equals(Rock.SystemGuid.BinaryFiletype.CHECKIN_LABEL, StringComparison.OrdinalIgnoreCase))
         {
             Guid?binaryFileGuid = groupType.GetAttributeValue(attribute.Key).AsGuidOrNull();
             if (binaryFileGuid != null)
             {
                 if (labelGuids.Contains(binaryFileGuid ?? new Guid()))
                 {
                     //don't add an already exisiting label
                     continue;
                 }
                 var labelCache = KioskLabel.Get(binaryFileGuid.Value);
                 if (labelCache != null)
                 {
                     var checkInLabel = new CheckInLabel(labelCache, mergeObjects);
                     checkInLabel.FileGuid = binaryFileGuid.Value;
                     labels.Add(checkInLabel);
                     labelGuids.Add(binaryFileGuid ?? new Guid());
                 }
             }
         }
     }
 }
        private List <KioskLabel> GetGroupTypeLabels(GroupTypeCache groupType)
        {
            var labels = new List <KioskLabel>();

            //groupType.LoadAttributes();
            foreach (var attribute in groupType.Attributes.OrderBy(a => a.Value.Order))
            {
                if (attribute.Value.FieldType.Guid == Rock.SystemGuid.FieldType.LABEL.AsGuid() &&
                    attribute.Value.QualifierValues.ContainsKey("binaryFileType") &&
                    attribute.Value.QualifierValues["binaryFileType"].Value.Equals(Rock.SystemGuid.BinaryFiletype.CHECKIN_LABEL, StringComparison.OrdinalIgnoreCase))
                {
                    Guid?binaryFileGuid = groupType.GetAttributeValue(attribute.Key).AsGuidOrNull();
                    if (binaryFileGuid != null)
                    {
                        var labelCache = KioskLabel.Read(binaryFileGuid.Value);
                        labelCache.Order = attribute.Value.Order;
                        if (labelCache != null)
                        {
                            labels.Add(labelCache);
                        }
                    }
                }
            }

            return(labels);
        }
Exemple #3
0
        public int CurrentGraduationYear(GroupTypeCache area)
        {
            var transitionDate = area.GetAttributeValue("GradeTransitionDate").AsDateTime() ?? GlobalAttributesCache.Read().GetValue("GradeTransitionDate").AsDateTime() ?? new DateTime(RockDateTime.Today.Year, 6, 1);

            transitionDate = new DateTime(RockDateTime.Today.Year, transitionDate.Month, transitionDate.Day);
            return(RockDateTime.Now.Date < transitionDate ? transitionDate.Year : transitionDate.Year + 1);
        }
Exemple #4
0
 /// <summary>
 /// Gets the setting.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <returns></returns>
 private string GetSetting(string key)
 {
     if (_checkinType != null)
     {
         return(_checkinType.GetAttributeValue(key));
     }
     return(string.Empty);
 }
Exemple #5
0
 private void GetGroupTypeLabels(GroupTypeCache groupType, List <CheckInLabel> labels, Dictionary <string, object> mergeObjects)
 {
     //groupType.LoadAttributes();
     foreach (var attribute in groupType.Attributes.OrderBy(a => a.Value.Order))
     {
         if (attribute.Value.FieldType.Guid == SystemGuid.FieldType.BINARY_FILE.AsGuid() &&
             attribute.Value.QualifierValues.ContainsKey("binaryFileType") &&
             attribute.Value.QualifierValues["binaryFileType"].Value.Equals(SystemGuid.BinaryFiletype.CHECKIN_LABEL, StringComparison.OrdinalIgnoreCase))
         {
             Guid?binaryFileGuid = groupType.GetAttributeValue(attribute.Key).AsGuidOrNull();
             if (binaryFileGuid != null)
             {
                 var labelCache = KioskLabel.Read(binaryFileGuid.Value);
                 if (labelCache != null)
                 {
                     var checkInLabel = new CheckInLabel(labelCache, mergeObjects);
                     checkInLabel.FileGuid = binaryFileGuid.Value;
                     labels.Add(checkInLabel);
                 }
             }
         }
     }
 }
Exemple #6
0
        private List <KioskLabel> GetGroupTypeLabels(GroupTypeCache groupType)
        {
            var labels = new List <KioskLabel>();

            //groupType.LoadAttributes();
            foreach (var attribute in groupType.Attributes.OrderBy(a => a.Value.Order))
            {
                if (attribute.Value.FieldType.Guid == SystemGuid.FieldType.LABEL.AsGuid())
                {
                    Guid?binaryFileGuid = groupType.GetAttributeValue(attribute.Key).AsGuidOrNull();
                    if (binaryFileGuid != null)
                    {
                        var labelCache = KioskLabel.Read(binaryFileGuid.Value);
                        labelCache.Order = attribute.Value.Order;
                        if (labelCache != null && labelCache.LabelType == KioskLabelType.Checkout)
                        {
                            labels.Add(labelCache);
                        }
                    }
                }
            }

            return(labels);
        }
Exemple #7
0
        private List<KioskLabel> GetGroupTypeLabels( GroupTypeCache groupType )
        {
            var labels = new List<KioskLabel>();

            //groupType.LoadAttributes();
            foreach ( var attribute in groupType.Attributes.OrderBy( a => a.Value.Order ) )
            {
                if ( attribute.Value.FieldType.Guid == SystemGuid.FieldType.BINARY_FILE.AsGuid() &&
                    attribute.Value.QualifierValues.ContainsKey( "binaryFileType" ) &&
                    attribute.Value.QualifierValues["binaryFileType"].Value.Equals( SystemGuid.BinaryFiletype.CHECKIN_LABEL, StringComparison.OrdinalIgnoreCase ) )
                {
                    Guid? binaryFileGuid = groupType.GetAttributeValue( attribute.Key ).AsGuidOrNull();
                    if ( binaryFileGuid != null )
                    {
                        var labelCache = KioskLabel.Read( binaryFileGuid.Value );
                        labelCache.Order = attribute.Value.Order;
                        if ( labelCache != null )
                        {
                            labels.Add( labelCache );
                        }
                    }
                }
            }

            return labels;
        }
Exemple #8
0
 private void GetGroupTypeLabels( GroupTypeCache groupType, List<CheckInLabel> labels, Dictionary<string, object> mergeObjects )
 {
     //groupType.LoadAttributes();
     foreach ( var attribute in groupType.Attributes.OrderBy( a => a.Value.Order ) )
     {
         if ( attribute.Value.FieldType.Guid == SystemGuid.FieldType.BINARY_FILE.AsGuid() &&
             attribute.Value.QualifierValues.ContainsKey( "binaryFileType" ) &&
             attribute.Value.QualifierValues["binaryFileType"].Value.Equals( SystemGuid.BinaryFiletype.CHECKIN_LABEL, StringComparison.OrdinalIgnoreCase ) )
         {
             Guid? binaryFileGuid = groupType.GetAttributeValue( attribute.Key ).AsGuidOrNull();
             if ( binaryFileGuid != null )
             {
                 var labelCache = KioskLabel.Read( binaryFileGuid.Value );
                 if ( labelCache != null )
                 {
                     var checkInLabel = new CheckInLabel( labelCache, mergeObjects );
                     checkInLabel.FileGuid = binaryFileGuid.Value;
                     labels.Add( checkInLabel );
                 }
             }
         }
     }
 }