Browse Source

Timeshare Admin Update

master
30117125 4 years ago
parent
commit
ba44c83ea9

+ 6
- 0
UnivateProperties_API/Containers/Timeshare/Detailed/DetailedWeekDto.cs View File

43
             Status = week.Status.Display;
43
             Status = week.Status.Display;
44
             Owner = week.Owner != null ? new DetailedOwner(week.Owner) : new DetailedOwner();
44
             Owner = week.Owner != null ? new DetailedOwner(week.Owner) : new DetailedOwner();
45
             Region = new RegionDto(week.Region.Code, week.Region.Description);
45
             Region = new RegionDto(week.Region.Code, week.Region.Description);
46
+            WeekStatus = week.WeekStatus;
47
+            Publish = week.Publish;
48
+            PulbishedDate = week.PulbishedDate;
46
         }
49
         }
47
 
50
 
48
         public int Id { get; set; }
51
         public int Id { get; set; }
76
         public string Status { get; set; }
79
         public string Status { get; set; }
77
         public DetailedOwner Owner { get; set; }
80
         public DetailedOwner Owner { get; set; }
78
         public RegionDto Region { get; set; }
81
         public RegionDto Region { get; set; }
82
+        public string WeekStatus { get; set; }
83
+        public bool Publish { get; set; }
84
+        public DateTime PulbishedDate { get; set; }
79
     }
85
     }
80
 }
86
 }

+ 6
- 0
UnivateProperties_API/Containers/Timeshare/WeekDto.cs View File

120
             IsTender = false;
120
             IsTender = false;
121
             ReferedByAgent = week.ReferedByAgent;
121
             ReferedByAgent = week.ReferedByAgent;
122
             WeekType = week.WeekType.ToString();
122
             WeekType = week.WeekType.ToString();
123
+            WeekStatus = week.WeekStatus;
124
+            Publish = week.Publish;
125
+            PulbishedDate = week.PulbishedDate;
123
         }
126
         }
124
 
127
 
125
         public int Id { get; set; }
128
         public int Id { get; set; }
147
         public string WeekType { get; set; }
150
         public string WeekType { get; set; }
148
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
151
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
149
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
152
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
153
+        public string WeekStatus { get; set; }
154
+        public bool Publish { get; set; }
155
+        public DateTime PulbishedDate { get; set; }
150
     }    
156
     }    
151
 }
157
 }

+ 2
- 0
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs View File

1017
 
1017
 
1018
                     b.Property<DateTime>("ArrivalDate");
1018
                     b.Property<DateTime>("ArrivalDate");
1019
 
1019
 
1020
+                    b.Property<double>("AskingPrice");
1021
+
1020
                     b.Property<string>("BankedWith");
1022
                     b.Property<string>("BankedWith");
1021
 
1023
 
1022
                     b.Property<int>("Bedrooms");
1024
                     b.Property<int>("Bedrooms");

+ 3
- 1
UnivateProperties_API/Model/Timeshare/TimeshareWeek.cs View File

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, bool mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows, string weekStatus, DateTime datePublished, bool published)
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 askingPrice, double agentCommision, bool mandate, int statusId, Status status, Province region, Individual owner, Agent agent, Agency agency, ICollection<BidItem> bidItems, ICollection<ProcessFlow.ProcessFlow> processFlows, string weekStatus, DateTime datePublished, bool published)
18
         {
18
         {
19
             ReferedByAgent = referedByAgent;
19
             ReferedByAgent = referedByAgent;
20
             AgentId = agentId;
20
             AgentId = agentId;
42
             ArrivalDate = arrivalDate;
42
             ArrivalDate = arrivalDate;
43
             DepartureDate = departureDate;
43
             DepartureDate = departureDate;
44
             SellPrice = sellPrice;
44
             SellPrice = sellPrice;
45
+            AskingPrice = askingPrice;
45
             AgentCommision = agentCommision;
46
             AgentCommision = agentCommision;
46
             Mandate = mandate;
47
             Mandate = mandate;
47
             StatusId = statusId;
48
             StatusId = statusId;
92
         public DateTime DepartureDate { get; set; }
93
         public DateTime DepartureDate { get; set; }
93
         
94
         
94
         public double SellPrice { get; set; }
95
         public double SellPrice { get; set; }
96
+        public double AskingPrice { get; set; }
95
         public double AgentCommision { get; set; }
97
         public double AgentCommision { get; set; }
96
         public bool Mandate { get; set; }
98
         public bool Mandate { get; set; }
97
         public DateTime DateMandated { get; set; }
99
         public DateTime DateMandated { get; set; }

+ 12
- 0
UnivateProperties_API/Repository/Timeshare/WeekRepository.cs View File

296
                 if (item.Mandate)
296
                 if (item.Mandate)
297
                     saved.DateMandated = DateTime.Now;
297
                     saved.DateMandated = DateTime.Now;
298
             }
298
             }
299
+            if (saved.WeekStatus != item.WeekStatus)
300
+            {
301
+                saved.WeekStatus = item.WeekStatus;
302
+            }
303
+            if (saved.Publish != item.Publish)
304
+            {
305
+                saved.Publish = item.Publish;
306
+            }
307
+            if (saved.PulbishedDate != item.PulbishedDate)
308
+            {
309
+                saved.PulbishedDate = item.PulbishedDate;
310
+            }
299
             _dbContext.Entry(saved).State = EntityState.Modified;
311
             _dbContext.Entry(saved).State = EntityState.Modified;
300
             Save();
312
             Save();
301
         }
313
         }

Loading…
Cancel
Save