summaryrefslogtreecommitdiff
path: root/Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs')
-rw-r--r--Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs117
1 files changed, 117 insertions, 0 deletions
diff --git a/Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs b/Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs
new file mode 100644
index 0000000..780cf09
--- /dev/null
+++ b/Gestor.Model/Gestor.Model.CalculoWeb.Auto/Veiculo.cs
@@ -0,0 +1,117 @@
+namespace Gestor.Model.CalculoWeb.Auto;
+
+public class Veiculo
+{
+ private string _combustivel;
+
+ public string NumeroChassi { get; set; }
+
+ public string Placa { get; set; }
+
+ public string Uf { get; set; }
+
+ public string Modelo { get; set; }
+
+ public string Fabricante { get; set; }
+
+ public string AnoFabricacao { get; set; }
+
+ public string AnoModelo { get; set; }
+
+ public string CodigoFipe { get; set; }
+
+ public string Rastreador { get; set; }
+
+ public string Antifurto { get; set; }
+
+ public string KitGas { get; set; }
+
+ public string ZeroKm { get; set; }
+
+ public string Alienado { get; set; }
+
+ public string Combustivel
+ {
+ get
+ {
+ return _combustivel;
+ }
+ set
+ {
+ _combustivel = value;
+ ConvertCombustivelCalculo(_combustivel);
+ }
+ }
+
+ public string CepPernoite { get; set; }
+
+ public Fipe Fipe { get; set; }
+
+ public string Blindado { get; set; }
+
+ public long Id { get; set; }
+
+ private static string ConvertCombustivelCalculo(string combustivel)
+ {
+ if (combustivel != null)
+ {
+ int length = combustivel.Length;
+ if (length == 1)
+ {
+ switch (combustivel[0])
+ {
+ case '4':
+ return "1";
+ case '2':
+ return "2";
+ case '1':
+ return "3";
+ case '3':
+ return "4";
+ case '9':
+ break;
+ case '5':
+ case '7':
+ case '8':
+ return "6";
+ default:
+ goto IL_00c7;
+ }
+ goto IL_00b5;
+ }
+ if (length == 2)
+ {
+ switch (combustivel[1])
+ {
+ case '0':
+ break;
+ case '2':
+ goto IL_007f;
+ case '1':
+ if (!(combustivel == "11"))
+ {
+ goto IL_00c7;
+ }
+ return "7";
+ default:
+ goto IL_00c7;
+ }
+ if (combustivel == "10")
+ {
+ goto IL_00b5;
+ }
+ }
+ }
+ goto IL_00c7;
+ IL_00c7:
+ return string.Empty;
+ IL_00b5:
+ return "5";
+ IL_007f:
+ if (combustivel == "12")
+ {
+ goto IL_00b5;
+ }
+ goto IL_00c7;
+ }
+}