UserLoginWindow.cs 884 字节
using BLL;
using System.Windows.Forms;

namespace SmartScan
{
    public static class UserLoginWindow
    {
        public static bool Show()
        {
            if (BLL.Config.Backgrounder)  //后台模式不需要登录
                return true;

            if (BLLCommon.config.EnabledUserLogin)
            {
                FrmUsersLogin frm = new();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    return true;
                }
                else
                {
                    Model.LogNet.log.Info("=====退出登录=====");
                    return false;
                }
            }
            else
            {
                BLLCommon.config.UserName = "None user";
                BLLCommon.config.UserLevel = Model.UserLevel.Admin;
                return true;
            }
        }


    }
}