-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
341 additions
and
413 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
using Xamarin.Forms.Xaml; | ||
using Xamarin.Forms.Xaml; | ||
|
||
[assembly: XamlCompilation(XamlCompilationOptions.Compile)] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
using SQLite; | ||
using System; | ||
using SQLite; | ||
using System; | ||
|
||
namespace KentekenShit.Models | ||
{ | ||
public class Item | ||
{ | ||
[PrimaryKey, AutoIncrement] | ||
public string Id { get; set; } | ||
public string Text { get; set; } | ||
public string Description { get; set; } | ||
public string Id { get; set; } | ||
public string Text { get; set; } | ||
public string Description { get; set; } | ||
|
||
public string Plate { get; set; } | ||
public string Make { get; set; } | ||
public string Seets { get; set; } | ||
public string Cylinders { get; set; } | ||
public string Doors { get; set; } | ||
public string Wheels { get; set; } | ||
public string Price { get; set; } | ||
public string TaxiSign { get; set; } | ||
public string Plate { get; set; } | ||
public string Make { get; set; } | ||
public string Seets { get; set; } | ||
public string Cylinders { get; set; } | ||
public string Doors { get; set; } | ||
public string Wheels { get; set; } | ||
public string Price { get; set; } | ||
public string TaxiSign { get; set; } | ||
|
||
public bool InFavoirites { get; set; } | ||
public bool InFavoirites { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace KentekenShit.Services | ||
{ | ||
public interface IDataStore<T> | ||
{ | ||
Task<bool> AddItemAsync(T item); | ||
Task<bool> UpdateItemAsync(T item); | ||
Task<bool> DeleteItemAsync(string id); | ||
Task<T> GetItemAsync(string id); | ||
Task<List<T>> GetItemsAsync(bool forceRefresh = false); | ||
Task<bool> AddItemAsync(T item); | ||
Task<bool> UpdateItemAsync(T item); | ||
Task<bool> DeleteItemAsync(string id); | ||
Task<T> GetItemAsync(string id); | ||
Task<List<T>> GetItemsAsync(bool forceRefresh = false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,67 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using KentekenShit.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using KentekenShit.Models; | ||
|
||
namespace KentekenShit.Services | ||
{ | ||
public class MockDataStore : IDataStore<Item> | ||
{ | ||
readonly List<Item> items; | ||
readonly List<Item> items; | ||
|
||
public MockDataStore() | ||
{ | ||
items = new List<Item>() | ||
{ | ||
new Item { | ||
new Item | ||
{ | ||
Id = Guid.NewGuid().ToString(), | ||
Plate="48XRFF", | ||
Make="Toyota", | ||
Seets="5", | ||
Cylinders="4", | ||
Doors="4", | ||
Wheels="4", | ||
Price="5", | ||
TaxiSign="No", | ||
Plate = "48XRFF", | ||
Make = "Toyota", | ||
Seets = "5", | ||
Cylinders = "4", | ||
Doors = "4", | ||
Wheels = "4", | ||
Price = "5", | ||
TaxiSign = "No", | ||
InFavoirites = true | ||
}, | ||
}; | ||
}; | ||
} | ||
|
||
public async Task<bool> AddItemAsync(Item item) | ||
{ | ||
items.Add(item); | ||
items.Add(item); | ||
|
||
return await Task.FromResult(true); | ||
return await Task.FromResult(true); | ||
} | ||
|
||
public async Task<bool> UpdateItemAsync(Item item) | ||
{ | ||
var oldItem = items.FirstOrDefault(arg => arg.Id == item.Id); | ||
items.Remove(oldItem); | ||
items.Add(item); | ||
var oldItem = items.FirstOrDefault(arg => arg.Id == item.Id); | ||
items.Remove(oldItem); | ||
items.Add(item); | ||
|
||
return await Task.FromResult(true); | ||
return await Task.FromResult(true); | ||
} | ||
|
||
public async Task<bool> DeleteItemAsync(string id) | ||
{ | ||
var oldItem = items.FirstOrDefault(arg => arg.Id == id); | ||
items.Remove(oldItem); | ||
var oldItem = items.FirstOrDefault(arg => arg.Id == id); | ||
items.Remove(oldItem); | ||
|
||
return await Task.FromResult(true); | ||
return await Task.FromResult(true); | ||
} | ||
|
||
public async Task<Item> GetItemAsync(string id) | ||
{ | ||
return await Task.FromResult(items.FirstOrDefault(s => s.Id == id)); | ||
return await Task.FromResult(items.FirstOrDefault(s => s.Id == id)); | ||
} | ||
|
||
public async Task<List<Item>> GetItemsAsync(bool forceRefresh = false) | ||
{ | ||
return await Task.FromResult(items); | ||
return await Task.FromResult(items); | ||
} | ||
} | ||
} |
Oops, something went wrong.