Exemple #1
0
        public void RegisterTest()
        {
            AccountInfo account = new AccountInfo() { UserName = "******", Password = "******" }; // TODO: 初始化为适当的值
            object[] expected = null; // TODO: 初始化为适当的值
            object[] actual;
            actual = AccountBL.Register(account);

            Console.WriteLine("{0},{1}", actual[0], actual[1]);
        }
Exemple #2
0
        public object[] Register(AccountInfo account)
        {
            if (string.IsNullOrEmpty(account.UserName) || string.IsNullOrEmpty(account.Password))
            {
                return null;
            }

            return SqlMapper.QueryForObject<object[]>("AccountInfoMap.Register", account);
        }
Exemple #3
0
        private static void AccountCookieSet(AccountInfo account)
        {
            HttpCookie cookie = AccountCookieGet();
            cookie.Value = GetCryptographyString(string.Format("{0}|{1}|{2}|{3}", Context.Request.UserHostName, account.UserName, account.Id, DateTime.Now.Ticks));

            CacheCommand<AccountInfo> cache = new CacheCommand<AccountInfo>(cookie.Value);
            cache.Set(account, cookie.Expires);

            if (Context.Request.Cookies.Get(cookie.Name) == null)
            {
                Context.Response.Cookies.Add(cookie);
            }
            else
            {
                Context.Response.Cookies.Set(cookie);
            }
        }
Exemple #4
0
 public static object[] Register(AccountInfo account)
 {
     return localDao.Register(account);
 }