Ejemplo n.º 1
0
 public static void UpdateUserInfo(DennaUser usr, DennaUser newUser)
 {
     RealmContext.GetInstance().Write(() =>
     {
         usr.Email    = newUser.Email;
         usr.FullName = newUser.FullName;
         RealmContext.GetInstance().Add(usr, update: true);
     });
 }
Ejemplo n.º 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Username.Text = UserService.GetUsername();
            var userInfo = UserService.GetUserInfo();

            FullName.Text = userInfo.FullName;
            Email.Text    = userInfo.Email;
            Ses.Text      = RealmContext.GetInstance().GetSession().State.ToString();
            base.OnNavigatedTo(e);
        }
Ejemplo n.º 3
0
        public static void CreateUserInformation(string name, string email)
        {
            var usr = new DennaUser()
            {
                FullName = name,
                Email    = email
            };

            RealmContext.GetInstance().Write(() =>
            {
                RealmContext.GetInstance().Add(usr);
            });
        }
Ejemplo n.º 4
0
        public void CreateUserInformation(string name, string email, string username)
        {
            var instance = RealmContext.GetInstance();
            var usr      = new DennaUser()
            {
                FullName = name,
                Email    = email,
                Username = username
            };

            instance.Write(() =>
            {
                instance.Add(usr);
            });
        }
Ejemplo n.º 5
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                Username.Text = _usrsvc.GetUsername();
                var userInfo = _usrsvc.GetUserInfo();
                FullName.Text = userInfo.FullName;
                Email.Text    = userInfo.Email;
            }
            catch
            {
                "Something isn't right".ShowMessage("Let us fetch your data from our cloud ...");
            }

            Ses.Text = RealmContext.GetInstance().GetSession().State.ToString();
            base.OnNavigatedTo(e);
        }
Ejemplo n.º 6
0
 public void UpdateUserInfo(DennaUser usr, DennaUser newUser)
 {
     if (usr.Email != newUser.Email || usr.FullName != newUser.FullName)
     {
         try
         {
             var instance = RealmContext.GetInstance();
             instance.Write(() =>
             {
                 usr.Email    = newUser.Email;
                 usr.FullName = newUser.FullName;
                 instance.Add(usr, update: true);
             });
         }
         catch (Exception e)
         {
             "Error".ShowMessage(e.Message);
         }
     }
 }
Ejemplo n.º 7
0
 public DogService()
 {
     _instance = RealmContext.GetInstance();
     repo      = new GenericRepository <Dog>(_instance);
     r         = new Random();
 }
Ejemplo n.º 8
0
        public DennaUser GetUserInfo()
        {
            var instance = RealmContext.GetInstance();

            return(instance.All <DennaUser>().FirstOrDefault());
        }
Ejemplo n.º 9
0
 public TodoService()
 {
     _instance = RealmContext.GetInstance();
     repo      = new GenericRepository <Todo>(_instance);
 }
Ejemplo n.º 10
0
 public static DennaUser GetUserInfo() => RealmContext.GetInstance().All <DennaUser>().FirstOrDefault();