diff --git a/.vs/AutoCat/DesignTimeBuild/.dtbcache.v2 b/.vs/AutoCat/DesignTimeBuild/.dtbcache.v2
index 40b53a3..2420d93 100644
Binary files a/.vs/AutoCat/DesignTimeBuild/.dtbcache.v2 and b/.vs/AutoCat/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/AutoCat/v16/.suo b/.vs/AutoCat/v16/.suo
index e1614ab..f8b431f 100644
Binary files a/.vs/AutoCat/v16/.suo and b/.vs/AutoCat/v16/.suo differ
diff --git a/AutoCat/AutoCat.csproj b/AutoCat/AutoCat.csproj
index 08c1d67..cd98ce6 100644
--- a/AutoCat/AutoCat.csproj
+++ b/AutoCat/AutoCat.csproj
@@ -119,7 +119,13 @@
App.xaml
+
+ ButtonCell.xaml
+
+
+ TextCell.xaml
+
AuthPage.xaml
@@ -159,6 +165,14 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/AutoCat/Controls/ButtonCell.xaml b/AutoCat/Controls/ButtonCell.xaml
new file mode 100644
index 0000000..855a3ed
--- /dev/null
+++ b/AutoCat/Controls/ButtonCell.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AutoCat/Controls/ButtonCell.xaml.cs b/AutoCat/Controls/ButtonCell.xaml.cs
new file mode 100644
index 0000000..a3f5a44
--- /dev/null
+++ b/AutoCat/Controls/ButtonCell.xaml.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
+
+namespace AutoCat.Controls
+{
+ public sealed partial class ButtonCell : UserControl
+ {
+ #region Dependency properties
+
+ public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(TextCell), new PropertyMetadata(null, OnTitleChanged));
+ public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Title", typeof(string), typeof(TextCell), new PropertyMetadata(null, OnValueChanged));
+ public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register("Title", typeof(string), typeof(TextCell), new PropertyMetadata(null, OnValueChanged));
+
+ #endregion
+
+ #region Properties
+
+ public string Title
+ {
+ get => (string)GetValue(TitleProperty);
+ set => SetValue(TitleProperty, value);
+ }
+
+ public string Value
+ {
+ get => (string)GetValue(ValueProperty);
+ set => SetValue(ValueProperty, value);
+ }
+
+ #endregion
+
+ public ButtonCell()
+ {
+ this.InitializeComponent();
+ }
+
+ private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is ButtonCell cell && e.NewValue is string title)
+ {
+ cell.TitleBox.Text = title ?? "";
+ }
+ }
+
+ private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is ButtonCell cell && e.NewValue is string value)
+ {
+ cell.ValueButton.Content = value ?? "";
+ }
+ }
+
+ private static void OnDefaultValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is ButtonCell cell && e.NewValue is string value)
+ {
+ cell.ValueButton.Content = value ?? "";
+ }
+ }
+ }
+}
diff --git a/AutoCat/Controls/TextCell.xaml b/AutoCat/Controls/TextCell.xaml
new file mode 100644
index 0000000..ffbe839
--- /dev/null
+++ b/AutoCat/Controls/TextCell.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AutoCat/Controls/TextCell.xaml.cs b/AutoCat/Controls/TextCell.xaml.cs
new file mode 100644
index 0000000..1bf979a
--- /dev/null
+++ b/AutoCat/Controls/TextCell.xaml.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
+
+namespace AutoCat.Controls
+{
+ public sealed partial class TextCell : UserControl
+ {
+ #region Dependency properties
+
+ public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(TextCell), new PropertyMetadata(null, OnTitleChanged));
+ public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Title", typeof(string), typeof(TextCell), new PropertyMetadata(null, OnValueChanged));
+
+ #endregion
+
+ #region Properties
+
+ public string Title
+ {
+ get => (string)GetValue(TitleProperty);
+ set => SetValue(TitleProperty, value);
+ }
+
+ public string Value
+ {
+ get => (string)GetValue(ValueProperty);
+ set => SetValue(ValueProperty, value);
+ }
+
+ #endregion
+
+ public TextCell()
+ {
+ this.InitializeComponent();
+ }
+
+ private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if(d is TextCell cell && e.NewValue is string title)
+ {
+ cell.TitleBox.Text = title ?? "";
+ }
+ }
+
+ private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is TextCell cell && e.NewValue is string value)
+ {
+ cell.ValueBox.Text = value ?? "";
+ }
+ }
+ }
+}
diff --git a/AutoCat/Pages/AuthPage.xaml.cs b/AutoCat/Pages/AuthPage.xaml.cs
index ea64926..887e716 100644
--- a/AutoCat/Pages/AuthPage.xaml.cs
+++ b/AutoCat/Pages/AuthPage.xaml.cs
@@ -32,8 +32,6 @@ namespace AutoCat.Pages
this.InitializeComponent();
}
-
-
private async void Login_Click(object sender, RoutedEventArgs e)
{
try
diff --git a/AutoCat/Pages/SearchPage.xaml b/AutoCat/Pages/SearchPage.xaml
index 8f39c99..842474f 100644
--- a/AutoCat/Pages/SearchPage.xaml
+++ b/AutoCat/Pages/SearchPage.xaml
@@ -7,6 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:model="using:AutoCatCore.Model"
+ xmlns:converters="using:AutoCatCore.Converters"
xmlns:custom="using:AutoCat.Controls"
mc:Ignorable="d"
d:Width="600"
@@ -14,16 +15,77 @@
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ItemTemplate="{StaticResource VehicleTemplate}" DetailsTemplate="{StaticResource VehicleDetailTemplateNew}">
diff --git a/AutoCat/Resources/Templates/VehicleDetailPage.xaml b/AutoCat/Resources/Templates/VehicleDetailPage.xaml
index 86d690c..753f4c7 100644
--- a/AutoCat/Resources/Templates/VehicleDetailPage.xaml
+++ b/AutoCat/Resources/Templates/VehicleDetailPage.xaml
@@ -2,20 +2,38 @@
x:Class="AutoCat.Resources.Templates.ResourceDictStub"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:model="using:AutoCatCore.Model">
+ xmlns:model="using:AutoCatCore.Model"
+ xmlns:controls="using:AutoCat.Controls">
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AutoCatCore/AutoCatCore.csproj b/AutoCatCore/AutoCatCore.csproj
index f59faa0..14b81ac 100644
--- a/AutoCatCore/AutoCatCore.csproj
+++ b/AutoCatCore/AutoCatCore.csproj
@@ -14,4 +14,10 @@
+
+
+ ..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\References\10.0.19041.0\Windows.Foundation.UniversalApiContract\10.0.0.0\Windows.Foundation.UniversalApiContract.winmd
+
+
+
diff --git a/AutoCatCore/Converters/SteeringWheelPositionConverter.cs b/AutoCatCore/Converters/SteeringWheelPositionConverter.cs
new file mode 100644
index 0000000..6bbc4a6
--- /dev/null
+++ b/AutoCatCore/Converters/SteeringWheelPositionConverter.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Windows.UI.Xaml.Data;
+
+namespace AutoCatCore.Converters
+{
+ public class SteeringWheelPositionConverter: IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ if(value is bool isRightWheel)
+ {
+ return isRightWheel ? "Right" : "Left";
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ if(value is string wheelPosition)
+ {
+ return wheelPosition == "Right";
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/AutoCatCore/Model/Osago.cs b/AutoCatCore/Model/Osago.cs
new file mode 100644
index 0000000..70833d9
--- /dev/null
+++ b/AutoCatCore/Model/Osago.cs
@@ -0,0 +1,40 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class Osago
+ {
+ [JsonProperty("date")]
+ public double Date { get; set; }
+
+ [JsonProperty("number")]
+ public string Number { get; set; }
+
+ [JsonProperty("vin")]
+ public string Vin { get; set; }
+
+ [JsonProperty("plateNumber")]
+ public string PlateNumber { get; set; }
+
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ [JsonProperty("status")]
+ public string Status { get; set; }
+
+ [JsonProperty("restrictions")]
+ public string Restrictions { get; set; }
+
+ [JsonProperty("insurant")]
+ public string Insurant { get; set; }
+
+ [JsonProperty("owner")]
+ public string Owner { get; set; }
+
+ [JsonProperty("usageRegion")]
+ public string UsageRegion { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/Vehicle.cs b/AutoCatCore/Model/Vehicle.cs
index 4480d65..b85ed05 100644
--- a/AutoCatCore/Model/Vehicle.cs
+++ b/AutoCatCore/Model/Vehicle.cs
@@ -1,41 +1,33 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace AutoCatCore.Model
{
- public class VehicleName
- {
- [JsonProperty("original")]
- public string Original { get; set; }
-
- [JsonProperty("normalized")]
- public string Normalized { get; set; }
- }
-
- public class VehicleBrand
- {
- [JsonProperty("name")]
- public VehicleName Name { get; set; }
-
- [JsonProperty("logo")]
- public string Logo { get; set; }
- }
-
- public class VehicleModel
- {
- [JsonProperty("name")]
- public VehicleName Name { get; set; }
- }
-
public class Vehicle
{
[Key]
[JsonProperty("number")]
public string Number { get; set; }
+ [JsonProperty("currentNumber")]
+ public string CurrentNumber { get; set; }
+
+ [JsonProperty("vin1")]
+ public string Vin1 { get; set; }
+
+ [JsonProperty("vin2")]
+ public string Vin2 { get; set; }
+
+ [JsonProperty("sts")]
+ public string Sts { get; set; }
+
+ [JsonProperty("pts")]
+ public string Pts { get; set; }
+
[JsonProperty("brand")]
public VehicleBrand Brand { get; set; }
@@ -50,5 +42,38 @@ namespace AutoCatCore.Model
[JsonProperty("category")]
public string Category { get; set; }
+
+ [JsonProperty("isRightWheel")]
+ public bool? IsRightWheel { get; set; }
+
+ [JsonProperty("isJapanese")]
+ public bool? IsJapanese { get; set; }
+
+ [JsonProperty("addedDate")]
+ public double AddedDate { get; set; }
+
+ [JsonProperty("updatedDate")]
+ public double UpdatedDate { get; set; }
+
+ [JsonProperty("addedBy")]
+ public string AddedBy { get; set; }
+
+ [JsonProperty("engine")]
+ public VehicleEngine Engine { get; set; }
+
+ [JsonProperty("photos")]
+ public List Photos { get; set; }
+
+ [JsonProperty("events")]
+ public List Events { get; set; }
+
+ [JsonProperty("osagoContracts", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public List OsagoContracts { get; set; } = new List();
+
+ [JsonProperty("ownershipPeriods", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public List OwnershipPeriods { get; set; } = new List();
+
+ [JsonProperty("ads")]
+ public List Ads { get; set; }
}
}
diff --git a/AutoCatCore/Model/VehicleAd.cs b/AutoCatCore/Model/VehicleAd.cs
new file mode 100644
index 0000000..ecbbdf9
--- /dev/null
+++ b/AutoCatCore/Model/VehicleAd.cs
@@ -0,0 +1,39 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleAd
+ {
+ [Key]
+ [JsonProperty("id")]
+ public int Id { get; set; }
+
+ [JsonProperty("url")]
+ public string Url { get; set; }
+
+ [JsonProperty("price")]
+ public string Price { get; set; }
+
+ [JsonProperty("date")]
+ public double Date { get; set; }
+
+ [JsonProperty("mileage")]
+ public string Mileage { get; set; }
+
+ [JsonProperty("region")]
+ public string Region { get; set; }
+
+ [JsonProperty("city")]
+ public string City { get; set; }
+
+ [JsonProperty("adDescription")]
+ public string AdDescription { get; set; }
+
+ [JsonProperty("photos")]
+ public List Photos { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleBrand.cs b/AutoCatCore/Model/VehicleBrand.cs
new file mode 100644
index 0000000..fbbc3fe
--- /dev/null
+++ b/AutoCatCore/Model/VehicleBrand.cs
@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleBrand
+ {
+ [JsonProperty("name")]
+ public VehicleName Name { get; set; }
+
+ [JsonProperty("logo")]
+ public string Logo { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleEngine.cs b/AutoCatCore/Model/VehicleEngine.cs
new file mode 100644
index 0000000..6d832d2
--- /dev/null
+++ b/AutoCatCore/Model/VehicleEngine.cs
@@ -0,0 +1,25 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleEngine
+ {
+ [JsonProperty("number")]
+ public string Number { get; set; }
+
+ [JsonProperty("volume")]
+ public int? Volume { get; set; }
+
+ [JsonProperty("powerKw")]
+ public double? PowerKw { get; set; }
+
+ [JsonProperty("powerHp")]
+ public double? PowerHp { get; set; }
+
+ [JsonProperty("fuelType")]
+ public string FuelType { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleEvent.cs b/AutoCatCore/Model/VehicleEvent.cs
new file mode 100644
index 0000000..93dcd9e
--- /dev/null
+++ b/AutoCatCore/Model/VehicleEvent.cs
@@ -0,0 +1,33 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleEvent
+ {
+ [Key]
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("date")]
+ public double Date { get; set; }
+
+ [JsonProperty("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonProperty("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonProperty("speed")]
+ public double Speed { get; set; }
+
+ [JsonProperty("direction")]
+ public double Direction { get; set; }
+
+ [JsonProperty("address")]
+ public string Address { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleModel.cs b/AutoCatCore/Model/VehicleModel.cs
new file mode 100644
index 0000000..f5a97fd
--- /dev/null
+++ b/AutoCatCore/Model/VehicleModel.cs
@@ -0,0 +1,13 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleModel
+ {
+ [JsonProperty("name")]
+ public VehicleName Name { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleName.cs b/AutoCatCore/Model/VehicleName.cs
new file mode 100644
index 0000000..92e41e8
--- /dev/null
+++ b/AutoCatCore/Model/VehicleName.cs
@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleName
+ {
+ [JsonProperty("original")]
+ public string Original { get; set; }
+
+ [JsonProperty("normalized")]
+ public string Normalized { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehicleOwnershipPeriod.cs b/AutoCatCore/Model/VehicleOwnershipPeriod.cs
new file mode 100644
index 0000000..1676514
--- /dev/null
+++ b/AutoCatCore/Model/VehicleOwnershipPeriod.cs
@@ -0,0 +1,43 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehicleOwnershipPeriod
+ {
+ [JsonProperty("lastOperation")]
+ public string LastOperation { get; set; }
+
+ [JsonProperty("ownerType")]
+ public string OwnerType { get; set; }
+
+ [JsonProperty("from")]
+ public Int64 From { get; set; }
+
+ [JsonProperty("to")]
+ public Int64 To { get; set; }
+
+ [JsonProperty("region")]
+ public string Region { get; set; }
+
+ [JsonProperty("registrationRegion")]
+ public string RegistrationRegion { get; set; }
+
+ [JsonProperty("locality")]
+ public string Locality { get; set; }
+
+ [JsonProperty("code")]
+ public string Code { get; set; }
+
+ [JsonProperty("street")]
+ public string Street { get; set; }
+
+ [JsonProperty("building")]
+ public string Building { get; set; }
+
+ [JsonProperty("inn")]
+ public string Inn { get; set; }
+ }
+}
diff --git a/AutoCatCore/Model/VehiclePhoto.cs b/AutoCatCore/Model/VehiclePhoto.cs
new file mode 100644
index 0000000..d5cffc4
--- /dev/null
+++ b/AutoCatCore/Model/VehiclePhoto.cs
@@ -0,0 +1,22 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace AutoCatCore.Model
+{
+ public class VehiclePhoto
+ {
+ [JsonProperty("brand")]
+ public string Brand { get; set; }
+
+ [JsonProperty("model")]
+ public string Model { get; set; }
+
+ [JsonProperty("date")]
+ public double Date { get; set; }
+
+ [JsonProperty("url")]
+ public string Url { get; set; }
+ }
+}