Diplom_B/Program.cs

44 lines
845 B
C#
Raw Normal View History

2021-07-15 12:21:22 +05:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Diplom_B.DB;
namespace Diplom_B
{
static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
2021-07-15 16:58:51 +05:00
Init();
//Application.Run(new FormLogin());
Application.Run(new IzdForm());
2021-07-15 12:21:22 +05:00
}
static void Init()
{
using (var DB = new MainDB())
{
var usr = (from u in DB.Users
where u.Name == "admin"
select u).ToArray();
if(usr.Length < 1)
{
DB.Users.Add(new DB.User()
{
Name = "admin",
Pass = "admin"
});
}
DB.SaveChanges();
}
}
}
}