Beispiel #1
0
        public static void UserLoginInit(UserInfo usr)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict.Add("LastLoginDate", RequestHelper.DateNow);
            dict.Add("LastLoginIP", ClientHelper.IP);
            dict.Add("LoginTimes", usr.LoginTimes + 1);
            UserBLL.UpdatePart(UserInfo.TABLENAME, dict, usr.Id);

            AddUserCookieWeekly(usr);
            CartBLL.CookiesImportDataBase(usr.Id, usr.UserName);
        }
Beispiel #2
0
 /// <summary>
 /// 用户登录之后Cookies购物转入到数据库
 /// </summary>
 public static void CookiesImportDataBase(int userId, string userName)
 {
     foreach (CartInfo cart in CartHelper.ReadCart())
     {
         var dbCart = CartBLL.Read(cart.ProductId, cart.ProductName, userId);
         if (dbCart.Id < 1)
         {
             cart.UserId   = userId;
             cart.UserName = userName;
             dal.Add(cart);
         }
     }
     CartHelper.ClearCart();
 }