Exemplo n.º 1
0
        /// <summary>
        /// 重置用户初始化状态的方法
        /// </summary>
        /// <param name="redisdb">redis连接对象</param>
        public void ResetInitstatus(IDatabase redisdb, SqlConnection connection, string loginUserName)
        {
            NetCarInfo netCarInfo = NetCar.GetNetCarMac();
            string     delkey     = String.Format($"init{netCarInfo.NetCarMac}");
            string     dellogkey  = String.Format($"loginstatus{netCarInfo.NetCarMac}");
            string     delprokey  = String.Format($"projectpath{netCarInfo.NetCarMac}");

            this.DelKey(delkey, redisdb);
            this.DelKey(dellogkey, redisdb);
            this.DelKey(delprokey, redisdb);
            string sqlcmd = this.UpdataDeleteFlag(loginUserName);

            this.UpdataSQL(sqlcmd, connection);
        }
Exemplo n.º 2
0
        public string LoginStatusCheck(IDatabase redisdb)
        {
            NetCarModel netCarModel = new NetCarModel();
            RedisModel  redis       = new RedisModel();
            NetCarInfo  netCarInfo  = netCarModel.GetNetCarMac();
            string      rediskey    = String.Format($"loginstatus{netCarInfo.NetCarMac}");
            string      loginstatus = redis.GetLoginStatus(rediskey, redisdb);

            return(loginstatus);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 设置用户登录状态,写入redis
        /// </summary>
        /// <param name="redisdb"></param>
        /// <param name="loginName"></param>
        public void SetUserLoginStatus(IDatabase redisdb, string loginName)
        {
            NetCarModel netCarModel = new NetCarModel();
            //RedisModel redis = new RedisModel();
            NetCarInfo netCarInfo = netCarModel.GetNetCarMac();
            string     rediskey   = String.Format($"loginstatus{netCarInfo.NetCarMac}");

            this.SetLoginStatus(loginName, redisdb, rediskey);
            Console.WriteLine("登录状态设置成功,下次可以不用输入账号密码登录了");
        }
Exemplo n.º 4
0
        /// <summary>
        /// 登录用户初始化方法
        /// </summary>
        /// <param name="conndetail">sql连接对象</param>
        public void UserInit(SqlConnection connection, IDatabase redisdb, UserInfo inituserInfo)
        {
            NetCarModel netCarModel = new NetCarModel();

            //InitUser initUser = new InitUser();
            //RedisModel redis = new RedisModel();
            //SqlAction sqlAction = new SqlAction();
            //UserInfo userInfo = initUser.Init(loginUserinfo);
            this.UserInsert(inituserInfo, connection);
            NetCarInfo netCarInfo = netCarModel.GetNetCarMac();
            string     rediskey   = String.Format($"init{netCarInfo.NetCarMac}");

            this.SetLoginStatus("inited", redisdb, rediskey);
        }