Example #1
0
        private void BindData()
        {
            List <Data.BackupItem> backupItems = new List <Allegiance.CommunitySecuritySystem.Management.Content.AutoUpdate.Data.BackupItem>();

            List <FileInfo> backupInfos = AutoUpdateManager.GetAvailableBackups();

            foreach (FileInfo backupInfo in backupInfos)
            {
                backupItems.Add(new Data.BackupItem()
                {
                    Name         = Path.GetFileName(backupInfo.Name),
                    DateCreated  = Format.DateTime(backupInfo.CreationTime),
                    LastModified = Format.DateTime(backupInfo.LastWriteTime)
                });
            }

            if (backupItems.Count > 0)
            {
                gvBackups.DataSource = backupItems;
                gvBackups.DataBind();
            }
            else
            {
                lblNoBackups.Visible = true;
                gvBackups.Visible    = false;
            }
        }