Exemple #1
0
        public static TemporaryAttachment PopulateTemporaryAttachmentFromIDataReader(IDataReader dr)
        {
            TemporaryAttachment temporaryAttachment = new TemporaryAttachment();

            temporaryAttachment.AttachmentID     = DataRecordHelper.GetGuid(dr, "AttachmentID");
            temporaryAttachment.UserID           = DataRecordHelper.GetInt32(dr, "UserID");
            temporaryAttachment.AttachmentType   = (AttachmentType)DataRecordHelper.GetInt32(dr, "AttachmentType");
            temporaryAttachment.FileName         = DataRecordHelper.GetString(dr, "FileName");
            temporaryAttachment.FriendlyFileName = DataRecordHelper.GetString(dr, "FriendlyFileName");
            temporaryAttachment.ContentType      = DataRecordHelper.GetString(dr, "ContentType");
            temporaryAttachment.ContentSize      = DataRecordHelper.GetInt64(dr, "ContentSize");
            temporaryAttachment.Height           = DataRecordHelper.GetInt32(dr, "Height");
            temporaryAttachment.Width            = DataRecordHelper.GetInt32(dr, "Width");
            temporaryAttachment.DisplayOrder     = DataRecordHelper.GetInt32(dr, "DisplayOrder");
            return(temporaryAttachment);
        }
Exemple #2
0
        public static SiteSettings PopulateSiteSettingsFromIDataReader(IDataReader dr)
        {
            SiteSettings settings = null;

            try
            {
                settings = Serializer.ConvertToObject(DataRecordHelper.GetString(dr, "SettingXML", string.Empty)
                                                      , typeof(SiteSettings)) as SiteSettings;
                if (settings == null)
                {
                    settings = new SiteSettings();
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
            settings.SettingsID = DataRecordHelper.GetInt32(dr, "SettingID");
            settings.SiteKey    = DataRecordHelper.GetGuid(dr, "SettingKey", Guid.Empty);
            return(settings);
        }