using System;
using System.Windows.Forms;

namespace ZhkhApp
{
    internal static class Program
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (LoginForm loginForm = new LoginForm())
            {
                if (loginForm.ShowDialog() == DialogResult.OK)
                {
                    switch (MainForm.CurrentRole)
                    {
                        case "admin":
                            Application.Run(new AdminForm());
                            break;
                        case "operator":
                            Application.Run(new OperatorForm());
                            break;
                        default:
                            Application.Run(new ResidentForm());
                            break;
                    }
                }
                else
                {
                    Application.Exit();
                }
            }
        }
    }
}