public void RegisterInstall(string userEmail, MobileAppType appType)
 {
     if (string.IsNullOrEmpty(userEmail)) return;
     registrator.RegisterInstall(userEmail, appType);
     cache.Insert(GetCacheKey(userEmail, null), true, cacheExpiration);
     cache.Insert(GetCacheKey(userEmail, appType), true, cacheExpiration);
 }
Example #2
0
 public void RegisterInstall(string userEmail, MobileAppType appType)
 {
     if (string.IsNullOrEmpty(userEmail))
     {
         return;
     }
     registrator.RegisterInstall(userEmail, appType);
     cache.Insert(GetCacheKey(userEmail, null), true, cacheExpiration);
     cache.Insert(GetCacheKey(userEmail, appType), true, cacheExpiration);
 }
Example #3
0
        public void RegisterInstall(string userEmail, MobileAppType appType)
        {
            var query =
                new SqlInsert("mobile_app_install", true)
                .InColumnValue("user_email", userEmail)
                .InColumnValue("app_type", (int)appType)
                .InColumnValue("registered_on", DateTime.UtcNow);

            using (var db = GetDbManager())
            {
                db.ExecuteNonQuery(query);
            }
        }
        public bool IsInstallRegistered(string userEmail, MobileAppType? appType)
        {
            if (string.IsNullOrEmpty(userEmail)) return false;
            object cachedValue = cache.Get(GetCacheKey(userEmail, appType));
            if (cachedValue != null)
            {
                return (bool)cachedValue;
            }

            var isRegistered = registrator.IsInstallRegistered(userEmail, appType);
            cache.Insert(GetCacheKey(userEmail, appType), isRegistered, cacheExpiration);
            return isRegistered;
        }
        public void RegisterInstall(string userEmail, MobileAppType appType)
        {
            var mai = new MobileAppInstall
            {
                AppType      = (int)appType,
                UserEmail    = userEmail,
                RegisteredOn = DateTime.UtcNow,
                LastSign     = DateTime.UtcNow
            };

            DbContext.MobileAppInstall.Add(mai);
            DbContext.SaveChanges();
        }
        public void RegisterInstall(string userEmail, MobileAppType appType)
        {
            var query =
                new SqlInsert("mobile_app_install", true)
                    .InColumnValue("user_email", userEmail)
                    .InColumnValue("app_type", (int) appType)
                    .InColumnValue("registered_on", DateTime.UtcNow);

            using (var db = GetDbManager())
            {
                db.ExecuteNonQuery(query);
            }
        }
Example #7
0
 public void RegisterInstall(string userEmail, MobileAppType appType)
 {
     DbManager.ExecuteNonQuery(
         "INSERT INTO `mobile_app_install` (`user_email`, `app_type`, `registered_on`, `last_sign`)" +
         " VALUES (@user_email, @app_type, @registered_on, @last_sign)" +
         " ON DUPLICATE KEY UPDATE `last_sign`=@last_sign",
         new
     {
         user_email    = userEmail,
         app_type      = (int)appType,
         registered_on = DateTime.UtcNow,
         last_sign     = DateTime.UtcNow
     });
 }
        public bool IsInstallRegistered(string userEmail, MobileAppType? appType)
        {
            var query = new SqlQuery("mobile_app_install")
                .SelectCount()
                .Where("user_email", userEmail);

            if (appType.HasValue)
                query.Where("app_type", (int) appType.Value);

            using (var db = GetDbManager())
            {
                return db.ExecuteScalar<int>(query) > 0;
            }
        }
 public string RegisterDevice(int tenantID, string userID, string token, MobileAppType type)
 {
     return(Channel.RegisterDevice(tenantID, userID, token, type));
 }
        public void RegisterMobileAppInstall(MobileAppType type)
        {
            var currentUser = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);

            mobileAppRegistrator.RegisterInstall(currentUser.Email, type);
        }
Example #11
0
 public void RegisterMobileAppInstall(MobileAppType type)
 {
     var currentUser = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);
     mobileAppRegistrator.RegisterInstall(currentUser.Email, type);
 }
 private string GetCacheKey(string userEmail, MobileAppType? appType)
 {
     return appType.HasValue ? userEmail + "/" + appType.ToString() : userEmail;
 }