Ver código fonte

Univate.2 > Timeshare To Sell Changes

master
George Williams 4 anos atrás
pai
commit
b84fc2c5dd

+ 46
- 2
UnivateProperties_API/Containers/Timeshare/Detailed/DetailedOwner.cs Ver arquivo

@@ -17,10 +17,48 @@ namespace UnivateProperties_API.Containers.Timeshare.Detailed
17 17
             Surname = individual.Surname;
18 18
             IdNumber = individual.IdNumber;
19 19
             CompanyRegNumber = individual.CompanyRegNumber;
20
-            MaritalStatus = individual.MaritalStatus;
20
+            MaritalStatus = individual.HowMarried.ToString();
21 21
             EmailAddress = individual.Email;
22 22
             CellNumber = individual.CellNumber;
23 23
             LandlineNumber = individual.Telephone;
24
+            SpouseCellnumber = individual.SpouseCellnumber;
25
+            SpouseEmail = individual.SpouseEmail;
26
+            SpouseName = individual.SpouseName;
27
+            SpouseSurname = individual.SpouseSurname;
28
+            SpouseTelephone = individual.SpouseTelephone;
29
+            switch (individual.HowMarried)
30
+            {
31
+                case MarriedType.NotApplicable:
32
+                    HowMarried = "N/A";
33
+                    break;
34
+                case MarriedType.ICOP:
35
+                    HowMarried = "In Community Of Property";
36
+                    break;
37
+                case MarriedType.OCOP:
38
+                    HowMarried = "Out of Community Of Property";
39
+                    break;
40
+                case MarriedType.Other:
41
+                    HowMarried = "Other";
42
+                    break;
43
+                case MarriedType.Traditional:
44
+                    HowMarried = "Traditional Wedding";
45
+                    break;
46
+                case MarriedType.Single:
47
+                    HowMarried = "Single";
48
+                    break;
49
+                case MarriedType.Divorced:
50
+                    HowMarried = "Divorced";
51
+                    break;
52
+                case MarriedType.Widow:
53
+                    HowMarried = "Widow";
54
+                    break;
55
+                case MarriedType.CommittedRelationship:
56
+                    HowMarried = "Committed Relationship";
57
+                    break;
58
+                case MarriedType.Partner:
59
+                    HowMarried = "Partner";
60
+                    break;
61
+            }
24 62
             if (individual.Address != null)
25 63
             {
26 64
                 Address = individual.Address != null ? new DetailedAddress(individual.Address) : new DetailedAddress();
@@ -53,7 +91,13 @@ namespace UnivateProperties_API.Containers.Timeshare.Detailed
53 91
         public string MaritalStatus { get; set; }
54 92
         public string EmailAddress { get; set; }
55 93
         public string CellNumber { get; set; }
56
-        public string LandlineNumber { get; set; }
94
+        public string LandlineNumber { get; set; }  
95
+        public string HowMarried { get; set; }
96
+        public string SpouseName { get; set; }
97
+        public string SpouseSurname { get; set; }        
98
+        public string SpouseEmail { get; set; }        
99
+        public string SpouseTelephone { get; set; }        
100
+        public string SpouseCellnumber { get; set; }
57 101
         public DetailedAddress Address { get; set; }
58 102
         public DetailedBankDetails BankingDetails { get; set; }
59 103
     }

+ 1
- 1
UnivateProperties_API/Containers/Timeshare/Detailed/DetailedWeekDto.cs Ver arquivo

@@ -71,7 +71,7 @@ namespace UnivateProperties_API.Containers.Timeshare.Detailed
71 71
         public string DepartureDate { get; set; }
72 72
         public double SellPrice { get; set; }
73 73
         public double AgentCommission { get; set; }
74
-        public string Mandate { get; set; }
74
+        public bool Mandate { get; set; }
75 75
         public string Status { get; set; }
76 76
         public DetailedOwner Owner { get; set; }
77 77
     }

+ 5
- 0
UnivateProperties_API/Containers/Timeshare/TimeshareWeekDto.cs Ver arquivo

@@ -25,6 +25,11 @@ namespace UnivateProperties_API.Containers.Timeshare
25 25
         public string EmailAddress { get; set; }
26 26
         public string CellNumber { get; set; }
27 27
         public string LandlineNumber { get; set; }
28
+        public string SpouseName { get; set; }
29
+        public string SpouseSurname { get; set; }
30
+        public string SpouseEmail { get; set; }
31
+        public string SpouseTelephone { get; set; }
32
+        public string SpouseCellnumber { get; set; }
28 33
         public OwnerAddress Address { get; set; }
29 34
         public OnwerBankingDetails BankingDetails { get; set; }
30 35
     }

+ 14
- 0
UnivateProperties_API/Enums.cs Ver arquivo

@@ -33,4 +33,18 @@
33 33
         Module,
34 34
         Syndicate
35 35
     }
36
+
37
+    public enum MarriedType
38
+    {        
39
+        NotApplicable = 0,       
40
+        ICOP = 1,        
41
+        OCOP = 2,      
42
+        Other = 3,
43
+        Traditional = 4,
44
+        Single = 5,
45
+        Divorced = 6,
46
+        Widow = 7,
47
+        CommittedRelationship = 8,
48
+        Partner = 9
49
+    }
36 50
 }

+ 1599
- 0
UnivateProperties_API/Migrations/20200909062006_AddSpouseDetails.Designer.cs
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 178
- 0
UnivateProperties_API/Migrations/20200909062006_AddSpouseDetails.cs Ver arquivo

@@ -0,0 +1,178 @@
1
+using Microsoft.EntityFrameworkCore.Migrations;
2
+
3
+namespace UnivateProperties_API.Migrations
4
+{
5
+    public partial class AddSpouseDetails : Migration
6
+    {
7
+        protected override void Up(MigrationBuilder migrationBuilder)
8
+        {
9
+            migrationBuilder.AddColumn<int>(
10
+                name: "HowMarried",
11
+                table: "Person",
12
+                nullable: false,
13
+                defaultValue: 0);
14
+
15
+            migrationBuilder.AddColumn<string>(
16
+                name: "SpouseCellnumber",
17
+                table: "Person",
18
+                nullable: true);
19
+
20
+            migrationBuilder.AddColumn<string>(
21
+                name: "SpouseEmail",
22
+                table: "Person",
23
+                nullable: true);
24
+
25
+            migrationBuilder.AddColumn<string>(
26
+                name: "SpouseName",
27
+                table: "Person",
28
+                nullable: true);
29
+
30
+            migrationBuilder.AddColumn<string>(
31
+                name: "SpouseSurname",
32
+                table: "Person",
33
+                nullable: true);
34
+
35
+            migrationBuilder.AddColumn<string>(
36
+                name: "SpouseTelephone",
37
+                table: "Person",
38
+                nullable: true);
39
+
40
+            migrationBuilder.AddColumn<int>(
41
+                name: "HowMarried",
42
+                table: "Individuals",
43
+                nullable: false,
44
+                defaultValue: 0);
45
+
46
+            migrationBuilder.AddColumn<string>(
47
+                name: "SpouseCellnumber",
48
+                table: "Individuals",
49
+                nullable: true);
50
+
51
+            migrationBuilder.AddColumn<string>(
52
+                name: "SpouseEmail",
53
+                table: "Individuals",
54
+                nullable: true);
55
+
56
+            migrationBuilder.AddColumn<string>(
57
+                name: "SpouseName",
58
+                table: "Individuals",
59
+                nullable: true);
60
+
61
+            migrationBuilder.AddColumn<string>(
62
+                name: "SpouseSurname",
63
+                table: "Individuals",
64
+                nullable: true);
65
+
66
+            migrationBuilder.AddColumn<string>(
67
+                name: "SpouseTelephone",
68
+                table: "Individuals",
69
+                nullable: true);
70
+
71
+            migrationBuilder.AddColumn<int>(
72
+                name: "HowMarried",
73
+                table: "Agents",
74
+                nullable: false,
75
+                defaultValue: 0);
76
+
77
+            migrationBuilder.AddColumn<string>(
78
+                name: "SpouseCellnumber",
79
+                table: "Agents",
80
+                nullable: true);
81
+
82
+            migrationBuilder.AddColumn<string>(
83
+                name: "SpouseEmail",
84
+                table: "Agents",
85
+                nullable: true);
86
+
87
+            migrationBuilder.AddColumn<string>(
88
+                name: "SpouseName",
89
+                table: "Agents",
90
+                nullable: true);
91
+
92
+            migrationBuilder.AddColumn<string>(
93
+                name: "SpouseSurname",
94
+                table: "Agents",
95
+                nullable: true);
96
+
97
+            migrationBuilder.AddColumn<string>(
98
+                name: "SpouseTelephone",
99
+                table: "Agents",
100
+                nullable: true);
101
+        }
102
+
103
+        protected override void Down(MigrationBuilder migrationBuilder)
104
+        {
105
+            migrationBuilder.DropColumn(
106
+                name: "HowMarried",
107
+                table: "Person");
108
+
109
+            migrationBuilder.DropColumn(
110
+                name: "SpouseCellnumber",
111
+                table: "Person");
112
+
113
+            migrationBuilder.DropColumn(
114
+                name: "SpouseEmail",
115
+                table: "Person");
116
+
117
+            migrationBuilder.DropColumn(
118
+                name: "SpouseName",
119
+                table: "Person");
120
+
121
+            migrationBuilder.DropColumn(
122
+                name: "SpouseSurname",
123
+                table: "Person");
124
+
125
+            migrationBuilder.DropColumn(
126
+                name: "SpouseTelephone",
127
+                table: "Person");
128
+
129
+            migrationBuilder.DropColumn(
130
+                name: "HowMarried",
131
+                table: "Individuals");
132
+
133
+            migrationBuilder.DropColumn(
134
+                name: "SpouseCellnumber",
135
+                table: "Individuals");
136
+
137
+            migrationBuilder.DropColumn(
138
+                name: "SpouseEmail",
139
+                table: "Individuals");
140
+
141
+            migrationBuilder.DropColumn(
142
+                name: "SpouseName",
143
+                table: "Individuals");
144
+
145
+            migrationBuilder.DropColumn(
146
+                name: "SpouseSurname",
147
+                table: "Individuals");
148
+
149
+            migrationBuilder.DropColumn(
150
+                name: "SpouseTelephone",
151
+                table: "Individuals");
152
+
153
+            migrationBuilder.DropColumn(
154
+                name: "HowMarried",
155
+                table: "Agents");
156
+
157
+            migrationBuilder.DropColumn(
158
+                name: "SpouseCellnumber",
159
+                table: "Agents");
160
+
161
+            migrationBuilder.DropColumn(
162
+                name: "SpouseEmail",
163
+                table: "Agents");
164
+
165
+            migrationBuilder.DropColumn(
166
+                name: "SpouseName",
167
+                table: "Agents");
168
+
169
+            migrationBuilder.DropColumn(
170
+                name: "SpouseSurname",
171
+                table: "Agents");
172
+
173
+            migrationBuilder.DropColumn(
174
+                name: "SpouseTelephone",
175
+                table: "Agents");
176
+        }
177
+    }
178
+}

+ 1573
- 0
UnivateProperties_API/Migrations/20200909075339_PropertiesMoved.Designer.cs
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 132
- 0
UnivateProperties_API/Migrations/20200909075339_PropertiesMoved.cs Ver arquivo

@@ -0,0 +1,132 @@
1
+using Microsoft.EntityFrameworkCore.Migrations;
2
+
3
+namespace UnivateProperties_API.Migrations
4
+{
5
+    public partial class PropertiesMoved : Migration
6
+    {
7
+        protected override void Up(MigrationBuilder migrationBuilder)
8
+        {
9
+            migrationBuilder.DropColumn(
10
+                name: "HowMarried",
11
+                table: "Person");
12
+
13
+            migrationBuilder.DropColumn(
14
+                name: "SpouseCellnumber",
15
+                table: "Person");
16
+
17
+            migrationBuilder.DropColumn(
18
+                name: "SpouseEmail",
19
+                table: "Person");
20
+
21
+            migrationBuilder.DropColumn(
22
+                name: "SpouseName",
23
+                table: "Person");
24
+
25
+            migrationBuilder.DropColumn(
26
+                name: "SpouseSurname",
27
+                table: "Person");
28
+
29
+            migrationBuilder.DropColumn(
30
+                name: "SpouseTelephone",
31
+                table: "Person");
32
+
33
+            migrationBuilder.DropColumn(
34
+                name: "MaritalStatus",
35
+                table: "Individuals");
36
+
37
+            migrationBuilder.DropColumn(
38
+                name: "HowMarried",
39
+                table: "Agents");
40
+
41
+            migrationBuilder.DropColumn(
42
+                name: "SpouseCellnumber",
43
+                table: "Agents");
44
+
45
+            migrationBuilder.DropColumn(
46
+                name: "SpouseEmail",
47
+                table: "Agents");
48
+
49
+            migrationBuilder.DropColumn(
50
+                name: "SpouseName",
51
+                table: "Agents");
52
+
53
+            migrationBuilder.DropColumn(
54
+                name: "SpouseSurname",
55
+                table: "Agents");
56
+
57
+            migrationBuilder.DropColumn(
58
+                name: "SpouseTelephone",
59
+                table: "Agents");
60
+        }
61
+
62
+        protected override void Down(MigrationBuilder migrationBuilder)
63
+        {
64
+            migrationBuilder.AddColumn<int>(
65
+                name: "HowMarried",
66
+                table: "Person",
67
+                nullable: false,
68
+                defaultValue: 0);
69
+
70
+            migrationBuilder.AddColumn<string>(
71
+                name: "SpouseCellnumber",
72
+                table: "Person",
73
+                nullable: true);
74
+
75
+            migrationBuilder.AddColumn<string>(
76
+                name: "SpouseEmail",
77
+                table: "Person",
78
+                nullable: true);
79
+
80
+            migrationBuilder.AddColumn<string>(
81
+                name: "SpouseName",
82
+                table: "Person",
83
+                nullable: true);
84
+
85
+            migrationBuilder.AddColumn<string>(
86
+                name: "SpouseSurname",
87
+                table: "Person",
88
+                nullable: true);
89
+
90
+            migrationBuilder.AddColumn<string>(
91
+                name: "SpouseTelephone",
92
+                table: "Person",
93
+                nullable: true);
94
+
95
+            migrationBuilder.AddColumn<string>(
96
+                name: "MaritalStatus",
97
+                table: "Individuals",
98
+                nullable: true);
99
+
100
+            migrationBuilder.AddColumn<int>(
101
+                name: "HowMarried",
102
+                table: "Agents",
103
+                nullable: false,
104
+                defaultValue: 0);
105
+
106
+            migrationBuilder.AddColumn<string>(
107
+                name: "SpouseCellnumber",
108
+                table: "Agents",
109
+                nullable: true);
110
+
111
+            migrationBuilder.AddColumn<string>(
112
+                name: "SpouseEmail",
113
+                table: "Agents",
114
+                nullable: true);
115
+
116
+            migrationBuilder.AddColumn<string>(
117
+                name: "SpouseName",
118
+                table: "Agents",
119
+                nullable: true);
120
+
121
+            migrationBuilder.AddColumn<string>(
122
+                name: "SpouseSurname",
123
+                table: "Agents",
124
+                nullable: true);
125
+
126
+            migrationBuilder.AddColumn<string>(
127
+                name: "SpouseTelephone",
128
+                table: "Agents",
129
+                nullable: true);
130
+        }
131
+    }
132
+}

+ 1575
- 0
UnivateProperties_API/Migrations/20200909084924_TimeshareAmmendment.Designer.cs
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 38
- 0
UnivateProperties_API/Migrations/20200909084924_TimeshareAmmendment.cs Ver arquivo

@@ -0,0 +1,38 @@
1
+using System;
2
+using Microsoft.EntityFrameworkCore.Migrations;
3
+
4
+namespace UnivateProperties_API.Migrations
5
+{
6
+    //run before update: UPDATE weeks SET Mandate = 0
7
+    public partial class TimeshareAmmendment : Migration
8
+    {
9
+        protected override void Up(MigrationBuilder migrationBuilder)
10
+        {
11
+            migrationBuilder.AlterColumn<bool>(
12
+                name: "Mandate",
13
+                table: "Weeks",
14
+                nullable: false,
15
+                oldClrType: typeof(string),
16
+                oldNullable: true);
17
+
18
+            migrationBuilder.AddColumn<DateTime>(
19
+                name: "DateMandated",
20
+                table: "Weeks",
21
+                nullable: false,
22
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
23
+        }
24
+
25
+        protected override void Down(MigrationBuilder migrationBuilder)
26
+        {
27
+            migrationBuilder.DropColumn(
28
+                name: "DateMandated",
29
+                table: "Weeks");
30
+
31
+            migrationBuilder.AlterColumn<string>(
32
+                name: "Mandate",
33
+                table: "Weeks",
34
+                nullable: true,
35
+                oldClrType: typeof(bool));
36
+        }
37
+    }
38
+}

+ 15
- 3
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs Ver arquivo

@@ -975,6 +975,8 @@ namespace UnivateProperties_API.Migrations
975 975
 
976 976
                     b.Property<bool>("CurrentYearBanked");
977 977
 
978
+                    b.Property<DateTime>("DateMandated");
979
+
978 980
                     b.Property<DateTime>("DepartureDate");
979 981
 
980 982
                     b.Property<bool>("IsDeleted");
@@ -983,7 +985,7 @@ namespace UnivateProperties_API.Migrations
983 985
 
984 986
                     b.Property<double>("LevyAmount");
985 987
 
986
-                    b.Property<string>("Mandate");
988
+                    b.Property<bool>("Mandate");
987 989
 
988 990
                     b.Property<int>("MaxSleep");
989 991
 
@@ -1180,20 +1182,30 @@ namespace UnivateProperties_API.Migrations
1180 1182
 
1181 1183
                     b.Property<string>("Email");
1182 1184
 
1185
+                    b.Property<int>("HowMarried");
1186
+
1183 1187
                     b.Property<string>("IdNumber");
1184 1188
 
1185 1189
                     b.Property<string>("IncomeTaxNumber");
1186 1190
 
1187 1191
                     b.Property<bool>("IsDeleted");
1188 1192
 
1189
-                    b.Property<string>("MaritalStatus");
1190
-
1191 1193
                     b.Property<DateTime>("Modified");
1192 1194
 
1193 1195
                     b.Property<string>("ModifiedBy");
1194 1196
 
1195 1197
                     b.Property<string>("Name");
1196 1198
 
1199
+                    b.Property<string>("SpouseCellnumber");
1200
+
1201
+                    b.Property<string>("SpouseEmail");
1202
+
1203
+                    b.Property<string>("SpouseName");
1204
+
1205
+                    b.Property<string>("SpouseSurname");
1206
+
1207
+                    b.Property<string>("SpouseTelephone");
1208
+
1197 1209
                     b.Property<string>("Surname");
1198 1210
 
1199 1211
                     b.Property<string>("Telephone");

+ 3
- 2
UnivateProperties_API/Model/Timeshare/TimeshareWeek.cs Ver arquivo

@@ -14,7 +14,7 @@ namespace UnivateProperties_API.Model.Timeshare
14 14
         {
15 15
         }
16 16
 
17
-        public TimeshareWeek(bool referedByAgent, int? agentId, int? agencyId, int ownerId, bool agentAsRep, bool otherResort, string otherResortName, string resortCode, string resortName, int regionId, string season, string module, int bedrooms, int maxSleep, string unitNumber, string weekNumber, double levyAmount, bool currentYearBanked, string bankedWith, bool leviesPaidInFull, bool weekPlacedForRental, double originalPurchasePrice, DateTime originalPurchaseDate, DateTime arrivalDate, DateTime departureDate, double sellPrice, double agentCommision, string mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows)
17
+        public TimeshareWeek(bool referedByAgent, int? agentId, int? agencyId, int ownerId, bool agentAsRep, bool otherResort, string otherResortName, string resortCode, string resortName, int regionId, string season, string module, int bedrooms, int maxSleep, string unitNumber, string weekNumber, double levyAmount, bool currentYearBanked, string bankedWith, bool leviesPaidInFull, bool weekPlacedForRental, double originalPurchasePrice, DateTime originalPurchaseDate, DateTime arrivalDate, DateTime departureDate, double sellPrice, double agentCommision, bool mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows)
18 18
         {
19 19
             ReferedByAgent = referedByAgent;
20 20
             AgentId = agentId;
@@ -90,7 +90,8 @@ namespace UnivateProperties_API.Model.Timeshare
90 90
         
91 91
         public double SellPrice { get; set; }
92 92
         public double AgentCommision { get; set; }
93
-        public string Mandate { get; set; }
93
+        public bool Mandate { get; set; }
94
+        public DateTime DateMandated { get; set; }
94 95
 
95 96
         [ForeignKey("Status")]
96 97
         public int StatusId { get; set; }

+ 12
- 4
UnivateProperties_API/Model/Users/Individual.cs Ver arquivo

@@ -20,13 +20,22 @@ namespace UnivateProperties_API.Model.Users
20 20
 
21 21
         #region Properties
22 22
         public string IdNumber { get; set; }
23
-        public string CompanyRegNumber { get; set; }
24
-        public string MaritalStatus { get; set; }
23
+        public string CompanyRegNumber { get; set; }        
25 24
         [ForeignKey("Address")]
26 25
         public int? AddressId { get; set; }
27 26
         public string IncomeTaxNumber { get; set; }
28 27
         [ForeignKey("BankAccount")]
29 28
         public int? BankAccountId { get; set; }
29
+        public MarriedType HowMarried { get; set; }
30
+        public string SpouseName { get; set; }
31
+        public string SpouseSurname { get; set; }
32
+        [DataType(DataType.EmailAddress)]
33
+        public string SpouseEmail { get; set; }
34
+        [Phone]
35
+        public string SpouseTelephone { get; set; }
36
+        [Phone]
37
+        public string SpouseCellnumber { get; set; }
38
+
30 39
         public virtual Address Address { get; set; }
31 40
         public virtual BankAccount BankAccount { get; set; }
32 41
         public virtual ICollection<Property> Properties { get; set; }
@@ -40,8 +49,7 @@ namespace UnivateProperties_API.Model.Users
40 49
                 Name = owner.Name;
41 50
                 Surname = owner.Surname;
42 51
                 IdNumber = owner.IdNumber;
43
-                CompanyRegNumber = owner.CompanyRegNumber;
44
-                MaritalStatus = owner.MaritalStatus;
52
+                CompanyRegNumber = owner.CompanyRegNumber;                
45 53
                 Email = owner.EmailAddress;
46 54
                 CellNumber = owner.CellNumber;
47 55
                 Telephone = owner.LandlineNumber;

+ 53
- 2
UnivateProperties_API/Repository/Timeshare/WeekRepository.cs Ver arquivo

@@ -290,6 +290,13 @@ namespace UnivateProperties_API.Repository.Timeshare
290 290
 
291 291
         public void Update(TimeshareWeek item)
292 292
         {
293
+            var saved = _dbContext.Weeks.Where(w => w.Id == item.Id).FirstOrDefault();
294
+            if (saved.Mandate != item.Mandate)
295
+            {
296
+                if (item.Mandate)
297
+                    item.DateMandated = DateTime.Now;
298
+            }
299
+
293 300
             _dbContext.Entry(item).State = EntityState.Modified;
294 301
             Save();
295 302
         }
@@ -519,12 +526,54 @@ namespace UnivateProperties_API.Repository.Timeshare
519 526
             owner.Name = sellItem.OwnerObject.Name;
520 527
             owner.Surname = sellItem.OwnerObject.Surname;
521 528
             owner.IdNumber = sellItem.OwnerObject.IdNumber;
522
-            owner.CompanyRegNumber = sellItem.OwnerObject.CompanyRegNumber;
523
-            owner.MaritalStatus = sellItem.OwnerObject.MaritalStatus;
529
+            owner.CompanyRegNumber = sellItem.OwnerObject.CompanyRegNumber;            
524 530
             owner.Email = sellItem.OwnerObject.EmailAddress;
525 531
             owner.CellNumber = sellItem.OwnerObject.CellNumber;
526 532
             owner.Telephone = sellItem.OwnerObject.LandlineNumber;
527 533
 
534
+            switch (sellItem.OwnerObject.MaritalStatus.ToUpper())
535
+            {
536
+                case "N/A":
537
+                    owner.HowMarried = MarriedType.NotApplicable;
538
+                    break;
539
+                case "IN COMMUNITY OF PROPERTY":
540
+                    owner.HowMarried = MarriedType.ICOP;
541
+                    break;
542
+                case "OUT OF COMMUNITY OF PROPERTY":
543
+                    owner.HowMarried = MarriedType.OCOP;
544
+                    break;
545
+                case "OTHER":
546
+                    owner.HowMarried = MarriedType.Other;
547
+                    break;
548
+                case "TRADITIONAL WEDDING":
549
+                    owner.HowMarried = MarriedType.Traditional;
550
+                    break;
551
+                case "SINGLE":
552
+                    owner.HowMarried = MarriedType.Single;
553
+                    break;
554
+                case "DIVORCED":
555
+                    owner.HowMarried = MarriedType.Divorced;
556
+                    break;
557
+                case "WIDOW":
558
+                    owner.HowMarried = MarriedType.Widow;
559
+                    break;
560
+                case "COMMITTED RELATIONSHIP":
561
+                    owner.HowMarried = MarriedType.CommittedRelationship;
562
+                    break;
563
+                case "PARTNER":
564
+                    owner.HowMarried = MarriedType.Partner;
565
+                    break;
566
+                default:
567
+                    owner.HowMarried = MarriedType.NotApplicable;
568
+                    break;
569
+            }
570
+
571
+            owner.SpouseCellnumber = sellItem.OwnerObject.SpouseCellnumber;
572
+            owner.SpouseEmail = sellItem.OwnerObject.SpouseEmail;
573
+            owner.SpouseName = sellItem.OwnerObject.SpouseName;
574
+            owner.SpouseSurname = sellItem.OwnerObject.SpouseSurname;
575
+            owner.SpouseTelephone = sellItem.OwnerObject.SpouseSurname;
576
+
528 577
             if (owner.Id == 0)
529 578
             {
530 579
                 _dbContext.Add(owner);
@@ -546,6 +595,8 @@ namespace UnivateProperties_API.Repository.Timeshare
546 595
             week.Region = null;
547 596
             week.RegionId = sellItem.Region.Id;
548 597
             week.OwnerId = owner.Id;
598
+            if (week.Mandate)
599
+                week.DateMandated = DateTime.Now;
549 600
 
550 601
             TemplateRepository templateRepository = new TemplateRepository(_dbContext);
551 602
             

Carregando…
Cancelar
Salvar