Просмотр исходного кода

Added Agent to timeshare week edit

master
30117125 4 лет назад
Родитель
Сommit
cba95f3f6b

+ 4
- 0
UnivateProperties_API/Containers/Timeshare/WeekDto.cs Просмотреть файл

@@ -104,7 +104,9 @@ namespace UnivateProperties_API.Containers.Timeshare
104 104
             AgentAsRep = week.AgentAsRep;
105 105
             OtherResort = week.OtherResort;
106 106
             Agency = week.Agency?.AgencyName;
107
+            AgencyId = week.AgencyId;
107 108
             Agent = $"{week.Agent?.Name} {week.Agent?.Surname}";
109
+            AgentId = week.AgentId;
108 110
             Owner = week.DisplayOwner;
109 111
             OwnerId = week.Owner.Id;
110 112
             UserId = week.Owner.UserId;
@@ -142,7 +144,9 @@ namespace UnivateProperties_API.Containers.Timeshare
142 144
         public string WeekNumber { get; set; }
143 145
         public string Season { get; set; }
144 146
         public string Agency { get; set; }
147
+        public int? AgencyId { get; set; }
145 148
         public string Agent { get; set; }
149
+        public int? AgentId { get; set; }
146 150
         public string Owner { get; set; }
147 151
         public int OwnerId { get; set; }
148 152
         public int? UserId { get; set; }

+ 9
- 1
UnivateProperties_API/Repository/Timeshare/WeekRepository.cs Просмотреть файл

@@ -418,7 +418,15 @@ namespace UnivateProperties_API.Repository.Timeshare
418 418
                 saved.OwnerId = item.OwnerId;
419 419
             }
420 420
 
421
-            
421
+            if (saved.AgencyId != item.AgencyId)
422
+            {
423
+                saved.AgencyId = item.AgencyId;
424
+            }
425
+
426
+            if (saved.AgentId != item.AgentId)
427
+            {
428
+                saved.AgentId = item.AgentId;
429
+            }
422 430
 
423 431
             if (saved.CustomOwner != item.CustomOwner)
424 432
             {

Загрузка…
Отмена
Сохранить