Skip to content
Permalink
Browse files
Db setup
  • Loading branch information
olowofev committed Nov 15, 2020
1 parent 7904df4 commit eb9ffc6ce552802c9b3da2cde9def3dc753d0a98
Show file tree
Hide file tree
Showing 66 changed files with 619 additions and 26 deletions.
BIN +9.5 KB (100%) .vs/UEngage/v16/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
@@ -1,4 +1,4 @@
IsIncrementalBuild=true
IsIncrementalBuild=false
AndroidUseAapt2=True
UseSharedRuntime=true
UseFastDeployment=false
@@ -22,7 +22,7 @@ CodegenTarget=
AndroidDexTool=d8
AndroidLinkTool=
AndroidEnableProfiledAot=
AndroidInstallAfterBuild=True
AndroidSessionId=4c7a675a-11a3-4c9a-a0a2-92e741ff8786
AndroidInstallAfterBuild=False
AndroidSessionId=
BuildConfiguration=Debug
TemplateName={c9e5eea5-ca05-42a1-839b-61506e0a37df}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -73,7 +73,7 @@ mono_aot_mode_name:
.section .rodata.env.str.8,"aMS",@progbits,1
.type .L.env.str.8, @object
.L.env.str.8:
.asciz "cb601afe-2bf4-4ee3-8385-10f61254a217"
.asciz "f2ff23dd-f30f-42d0-9747-4001ecd255f1"
.size .L.env.str.8, 37
.section .rodata.env.str.9,"aMS",@progbits,1
.type .L.env.str.9, @object
Binary file not shown.
@@ -92,7 +92,7 @@ mono_aot_mode_name:
.section .rodata.env.str.8,"aMS",%progbits,1
.type .L.env.str.8, %object
.L.env.str.8:
.asciz "cb601afe-2bf4-4ee3-8385-10f61254a217"
.asciz "f2ff23dd-f30f-42d0-9747-4001ecd255f1"
.size .L.env.str.8, 37
.section .rodata.env.str.9,"aMS",%progbits,1
.type .L.env.str.9, %object
Binary file not shown.
@@ -71,7 +71,7 @@ mono_aot_mode_name:
.section .rodata.env.str.8,"aMS",@progbits,1
.type .L.env.str.8, @object
.L.env.str.8:
.asciz "cb601afe-2bf4-4ee3-8385-10f61254a217"
.asciz "f2ff23dd-f30f-42d0-9747-4001ecd255f1"
.size .L.env.str.8, 37
.section .rodata.env.str.9,"aMS",@progbits,1
.type .L.env.str.9, @object
Binary file not shown.
@@ -72,7 +72,7 @@ mono_aot_mode_name:
.section .rodata.env.str.8,"aMS",@progbits,1
.type .L.env.str.8, @object
.L.env.str.8:
.asciz "cb601afe-2bf4-4ee3-8385-10f61254a217"
.asciz "f2ff23dd-f30f-42d0-9747-4001ecd255f1"
.size .L.env.str.8, 37
.section .rodata.env.str.9,"aMS",@progbits,1
.type .L.env.str.9, @object
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -24,7 +24,7 @@ androidgeneratejnimarshalmethods=false
os=windows_nt
androidincludedebugsymbols=true
androidpackagenamingpolicy=lowercasecrc64
_nugetassetstimestamp=637407436481371022
_nugetassetstimestamp=637409165077096274
typemapkind=strings-asm
androidsupportedabis=arm64-v8a
armeabi-v7a
@@ -1 +1 @@
cb601afe-2bf4-4ee3-8385-10f61254a217
f2ff23dd-f30f-42d0-9747-4001ecd255f1
@@ -24,7 +24,7 @@ androidgeneratejnimarshalmethods=false
os=windows_nt
androidincludedebugsymbols=true
androidpackagenamingpolicy=lowercasecrc64
_nugetassetstimestamp=637407436481371022
_nugetassetstimestamp=637409165077096274
typemapkind=strings-asm
androidsupportedabis=arm64-v8a
armeabi-v7a
@@ -109,6 +109,10 @@
"Xamarin.Forms": {
"target": "Package",
"version": "[4.6.0.1141, )"
},
"sqlite-net-pcl": {
"target": "Package",
"version": "[1.7.335, )"
}
},
"imports": [
@@ -882,7 +882,8 @@
"framework": ".NETStandard,Version=v2.0",
"dependencies": {
"Xamarin.Essentials": "1.5.3.2",
"Xamarin.Forms": "4.6.0.1141"
"Xamarin.Forms": "4.6.0.1141",
"sqlite-net-pcl": "1.7.335"
},
"compile": {
"bin/placeholder/UEngage.dll": {}
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "zaIetjiXpEb2GkF/h0hWKqfWs64UMmN88zfIh7oD+ebWCg4h3YkIrtMT71V5o1OHKi1KdKRC9gdgEt9S3PjGkA==",
"dgSpecHash": "EMCbIGKgARXZsXudV4YRC8tyCgcSIoWMJqNqf6SXSFTShef27YpD5qGuwZy2DuGJ2geTIFcUYT+4DlcR00dTGw==",
"success": true,
"projectFilePath": "C:\\Users\\olamide\\source\\repos\\UEngage\\UEngage.Android\\UEngage.Android.csproj",
"expectedPackageFiles": [
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -120,6 +120,10 @@
"Xamarin.Forms": {
"target": "Package",
"version": "[4.6.0.1141, )"
},
"sqlite-net-pcl": {
"target": "Package",
"version": "[1.7.335, )"
}
},
"imports": [
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -223,7 +223,8 @@
"framework": ".NETStandard,Version=v2.0",
"dependencies": {
"Xamarin.Essentials": "1.5.3.2",
"Xamarin.Forms": "4.6.0.1141"
"Xamarin.Forms": "4.6.0.1141",
"sqlite-net-pcl": "1.7.335"
},
"compile": {
"bin/placeholder/UEngage.dll": {}
@@ -455,7 +456,8 @@
"framework": ".NETStandard,Version=v2.0",
"dependencies": {
"Xamarin.Essentials": "1.5.3.2",
"Xamarin.Forms": "4.6.0.1141"
"Xamarin.Forms": "4.6.0.1141",
"sqlite-net-pcl": "1.7.335"
},
"compile": {
"bin/placeholder/UEngage.dll": {}
@@ -687,7 +689,8 @@
"framework": ".NETStandard,Version=v2.0",
"dependencies": {
"Xamarin.Essentials": "1.5.3.2",
"Xamarin.Forms": "4.6.0.1141"
"Xamarin.Forms": "4.6.0.1141",
"sqlite-net-pcl": "1.7.335"
},
"compile": {
"bin/placeholder/UEngage.dll": {}
@@ -919,7 +922,8 @@
"framework": ".NETStandard,Version=v2.0",
"dependencies": {
"Xamarin.Essentials": "1.5.3.2",
"Xamarin.Forms": "4.6.0.1141"
"Xamarin.Forms": "4.6.0.1141",
"sqlite-net-pcl": "1.7.335"
},
"compile": {
"bin/placeholder/UEngage.dll": {}
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "LyUxmqCEvg8wc+RIEsy+XAasES02M5nCp6tdoXY0ZZZmMNMe1xHC4spc9fWWDJ8hwSCXHrwHa7DPXVL+n4zQ5A==",
"dgSpecHash": "vRqFHeHaP0Lls5b7+ZMSYiCaTN5IbSxDHTDSCbpezaE3muxyfK6jxBBa47rlo+ouCSsvJU46zrpep2zofniaWA==",
"success": true,
"projectFilePath": "C:\\Users\\olamide\\source\\repos\\UEngage\\UEngage.iOS\\UEngage.iOS.csproj",
"expectedPackageFiles": [
@@ -1,11 +1,24 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using UEngage.Data;
using UEngage.Models;

namespace UEngage
{
public partial class App : Application
{
/*static UserDatabase database;
public static NoteDatabase Database
{
get
{
if (database == null){
database = new NoteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Notes.db3"));
}
return database;
}
}*/
public App()
{
InitializeComponent();
@@ -0,0 +1,47 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using SQLite;
using UEngage.Models;

namespace UEngage.Data
{
public class ReportDatabase
{
readonly SQLiteAsyncConnection _database;

public ReportDatabase(string dbPath)
{
_database = new SQLiteAsyncConnection(dbPath);
_database.CreateTableAsync<Report_>().Wait();
}

public Task<List<Report_>> GetReportsAsync()
{
return _database.Table<Report_>().ToListAsync();
}

public Task<Report_> GetReportAsync(int id)
{
return _database.Table<Report_>()
.Where(i => i.ID == id)
.FirstOrDefaultAsync();
}

public Task<int> SaveReportAsync(Report_ report)
{
if (report.ID != 0)
{
return _database.UpdateAsync(report);
}
else
{
return _database.InsertAsync(report);
}
}

public Task<int> DeleteReportAsync(Report report)
{
return _database.DeleteAsync(report);
}
}
}
@@ -0,0 +1,47 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using SQLite;
using UEngage.Models;

namespace UEngage.Data
{
public class UserDatabase
{
readonly SQLiteAsyncConnection _database;

public UserDatabase(string dbPath)
{
_database = new SQLiteAsyncConnection(dbPath);
_database.CreateTableAsync<User_>().Wait();
}

public Task<List<User_>> GetaUsersAsync()
{
return _database.Table<User_>().ToListAsync();
}

public Task<User_> GetUserAsync(int id)
{
return _database.Table<User_>()
.Where(i => i.ID == id)
.FirstOrDefaultAsync();
}

public Task<int> SaveUserAsync(User_ user)
{
if (user.ID != 0)
{
return _database.UpdateAsync(user);
}
else
{
return _database.InsertAsync(user);
}
}

public Task<int> DeleteUserAsync(User_ user)
{
return _database.DeleteAsync(user);
}
}
}
@@ -1,15 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
using SQLite;

namespace UEngage.Models
{
public class Report
public class Report_
{
public int ID { get; set; }
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public string Username { get; set; }
public string ImageUrl { get; set; }
public string Coordinate { get; set; }
public string Description { get; set; }
public DateTime Date { get; set; }
}
}
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
using SQLite;

namespace UEngage.Models
{
public class User_
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public string Firstname { get; set; }
public string Lastname { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Postcode { get; set; }

}
}
@@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<UserSecretsId>848cd38e-bf0a-4436-a6ed-fc2690769cb0</UserSecretsId>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -12,9 +13,11 @@

<ItemGroup>
<Compile Remove="MainPageCS.cs" />
<Compile Remove="Models\Person.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="sqlite-net-pcl" Version="1.7.335" />
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>

0 comments on commit eb9ffc6

Please sign in to comment.