public static bool SaveAll()
        {
            try
            {
                DatabaseServices.DeleteAll <ItemDB>(Database.connection);

                foreach (var item in Model.Items)
                {
                    var row = new ItemDB();
                    row.id         = item.id;
                    row.Name       = item.Name;
                    row.Address    = item.Address;
                    row.Detail     = item.Detail;
                    row.IconSource = item.Icon.Source as FileImageSource;

                    Database.connection.Insert(row);
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public static bool SaveAll()
        {
            try
            {
                DatabaseServices.DeleteAll <UserDB>(Database.connection);

                foreach (var user in Model.Users)
                {
                    var row = new UserDB();
                    row.UserName  = user.UserName;
                    row.Password  = user.Password;
                    row.ServerURL = user.ServerURL;
                    row.FirstName = user.FirstName;
                    row.Surname   = user.Surname;

                    Database.connection.Insert(row);
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }