Exemplo n.º 1
0
        public string ReturnCheckBanUsers(string username)
        {
            string message          = "";
            var    ListAccountBlock = LoadDataConfig.LoadListAccountBlock();

            if (ListAccountBlock.Count > 0)
            {
                foreach (var item in ListAccountBlock)
                {
                    if (item.name == username)
                    {
                        message = string.Format("<span style='color:red; font-weight:bold'>Tài khoản đang bị Block, lý do: {0} - Thời hạn đến: {1}</span>", item.namereasonblock, item.endtimeblock);
                    }
                }
            }
            return(message);
        }
Exemplo n.º 2
0
        public bool CheckBanUsers(string username)
        {
            var ListAccountBlock = LoadDataConfig.LoadListAccountBlock();

            if (ListAccountBlock.Count > 0)
            {
                foreach (var item in ListAccountBlock)
                {
                    if (item.name.Trim() == username.Trim())
                    {
                        if (DateTime.Now >= DateTime.Parse(item.endtimeblock))
                        {
                            DeleteAccountBlock(item.key);
                            return(false);
                        }
                        return(true);
                    }
                }
            }
            return(false);
            //Bỏ Return đọc từ file txt cũ - huandh
            //return BanUsers.Contains(username);
        }