private static int _interval = 60;
private static DatabaseCtx _ctx = DatabaseCtx.Instance;
public static BindingList<Data> Items { get; set; } = new BindingList<Data>();
public ExportGridForm()
{
InitializeComponent();
ReloadData();
bindingSource1.DataSource = Items;
}
private void ReloadData()
{
Items.Clear();
foreach (var data in _ctx.GetDatas()) Items.Add(data);
}
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HeIsBad.Dbl.Models
{
/// <summary>
/// Жалоба
/// </summary>
[Table("blames")]
public class DbBlame
{
/// <summary>
/// Идентификатор
/// </summary>
[Key]
public long Id { get; set; }
/// <summary>
/// Жалоба
/// </summary>
[Required]
public string Body { get; set; }
/// <summary>
/// Дата создания
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Электронная почта жалобщика
/// </summary>
[Required]
public string Email { get; set; }
/// <summary>
/// Причина жалобы
/// </summary>
[Required]
[ForeignKey ("Reason")]
public int ReasonId { get; set; }
public virtual DbBlameReason Reason { get; set; }
/// <summary>
/// Адрес жалобы
/// </summary>
public string BlameUri { get; set; }
/// <summary>
/// Кем создано.
/// </summary>
public long? UserId { get; set; }
/// <summary>
/// Статус жалобы
/// </summary>
[ForeignKey ("BlameStatus")]
public int StatusId { get; set; }
public virtual BlameStatus BlameStatus { get; set; }
}
}