コード例 #1
0
ファイル: LoginForm.cs プロジェクト: novakvova/DatabaseVPU911
        public LoginForm()
        {
            context = new MyContext();
            InitializeComponent();

            DbSeeder.SeedAll(context);
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Artem2021-Step/FilterHW
        private void MainForm_Load(object sender, EventArgs e)
        {
            DbSeeder.SeedAll(_context);
            var filters = GetFilterNameModels();

            FillCheckedList(filters);
        }
コード例 #3
0
        public MainForm()
        {
            //LoginForm login_dlg = new LoginForm();
            //if (login_dlg.ShowDialog() == DialogResult.OK)
            //{
            isAuth   = true;
            _context = new MyContext();
            DbSeeder.SeedAll(_context);

            var info = _context.Sessions
                       .Where(x => x.UserId == 1)
                       .Select(x => new
            {
                Name     = x.User.LastName + " " + x.User.FirstName,
                Begin    = x.Begin,
                End      = x.End,
                Mark     = x.Marks,
                Quesions = x.Results.Select(y => new
                {
                    Text   = y.Answer.Question.Text,
                    isTrue = y.Answer.IsTrue
                })
            }).ToList();

            //}
            InitializeComponent();
        }
コード例 #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this._context = new EFContext();
            DbSeeder.SeedAll(_context);
            var elements = this._context.Categories.Where(x => x.IsCore);
            List <CategoryNodeModel> models = RecursAddTree(elements.ToList());

            foreach (var item in ShowAllInTreeView(models))
            {
                this.tvMain.Nodes.Add(item);
            }
        }
コード例 #5
0
        public static void Main(string[] args)
        {
            IWebHost host = BuildWebHost(args);

            using (IServiceScope scope = host.Services.CreateScope())
            {
                IServiceProvider services = scope.ServiceProvider;
                try
                {
                    AppDbContext context = services.GetRequiredService <AppDbContext>();
                    DbSeeder.SeedAll(context);
                }
                catch (Exception ex)
                {
                    ILogger <Program> logger = services.GetRequiredService <ILogger <Program> >();
                    logger.LogError(ex, "An error occurred while seeding the database");
                }
            }

            host.Run();
        }
コード例 #6
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     DbSeeder.SeedAll(this._context);
     FillParentsTreeView();
 }
コード例 #7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DbSeeder.SeedAll(_context);

            ReloadProject();
        }