Example #1
0
        public static bool Authenticate(UserMobile user)
        {

            var status = Reachability.IsHostReachable(Reachability.HostName);
            if (status)
            {
                try
                {
                    var u = UserMobileMb.Login(user);
                    if (u.IsLoggedIn)
                    {
                        //u.LastMobileLoginDate = DateTime.UtcNow;
                        SqlAccount account = new SqlAccount(u);
                        new SqlFactory().DeleteProfile().InsertProfile(account);
                        SettingsMobile.Instance.User = u;
                    }
                    return u.IsLoggedIn;
                }
                catch (Exception ex)
                {
                    ErrorHandler.Save(ex, MobileTypeEnum.iPhone);
                }
            }
            return false;

        }
 public SqlFactory InsertProfile(SqlAccount profile)
 {
     database.Insert(profile);
     return this;
 }