/// <summary>
 /// 系统当前登录状态判断
 /// </summary>
 private void UserLoginStatus()
 {
     logInfo.Info("系统登录状态判断");
     Process[] processList = Process.GetProcessesByName("explorer");
     if (processList.Length > 0)
     {
         SingletonInfo.GetInstance().LoginFlag    = true;
         SingletonInfo.GetInstance().IsFirstLogin = false;
         logInfo.Info("系统此时已被登录");
     }
     else
     {
         SingletonInfo.GetInstance().LoginFlag    = false;
         SingletonInfo.GetInstance().IsFirstLogin = true;
         logInfo.Info("系统此时未被登录");
     }
 }
        public ToolManagementService()
        {
            InitializeComponent();
            ClassName  = GetType().Name;
            processDic = new Dictionary <int, int>();
            moduleList = new BindingCollection <TModule>();

            var appSettings = System.Configuration.ConfigurationManager.AppSettings;

            string    sql  = "select * from SQLServerInfo";
            DataTable data = DB.Context.FromSql(sql).ToDataTable();

            if (data.Rows.Count > 0)
            {
                SingletonInfo.GetInstance().SqlServerIP   = data.Rows[0][1].ToString();
                SingletonInfo.GetInstance().SqlServerUser = data.Rows[0][2].ToString();
                SingletonInfo.GetInstance().SqlServerPWD  = data.Rows[0][3].ToString();
            }
        }
        private bool InitModuleDatabase()
        {
            if (sqlServer == null)
            {
                sqlServer = new SqlServerLogic(string.Format("Server={0};uid={1};pwd={2};", SingletonInfo.GetInstance().SqlServerIP, SingletonInfo.GetInstance().SqlServerUser, SingletonInfo.GetInstance().SqlServerPWD));
            }
            int createData = sqlServer.FromSql("CREATE DATABASE volador");

            MixLogHelper.Info(ClassName, createData != -100 ? "volador数据库创建成功" : "volador数据库创建失败");


            string pp      = AppDomain.CurrentDomain.BaseDirectory;
            bool   success = sqlServer.ExecuteCommand(sqlServer.GetSqlFile(Path.Combine(pp, "sqlinit"), "volador"));

            MixLogHelper.Info(ClassName, success ? "volador表创建成功" : "volador表创建失败");

            return(success);
        }