30117125 4 jaren geleden
bovenliggende
commit
22d8b0bd37

+ 19
- 1
UnivateProperties_API/Containers/Timeshare/WeekDto.cs Bestand weergeven

@@ -74,6 +74,23 @@ namespace UnivateProperties_API.Containers.Timeshare
74 74
             Region = new RegionDto() { RegionCode = split[24].Trim() };
75 75
             IsTender = true;
76 76
             ReferedByAgent = false;
77
+            // F-Fixed T-Timeshare (Fixed Timeshare Week) 
78
+            //PML - Peak / Medium / Low Felxi
79
+            switch (split[25].Trim())
80
+            {
81
+                case "T":
82
+                case "F":
83
+                    WeekType = "Fixed";
84
+                    break;
85
+                case "P":
86
+                case "M":
87
+                case "L":
88
+                    WeekType = "Peak Flexi";
89
+                    break;
90
+                default:
91
+                    WeekType = "";
92
+                    break;
93
+            }
77 94
         }
78 95
 
79 96
         public WeekDto(TimeshareWeek week)
@@ -102,6 +119,7 @@ namespace UnivateProperties_API.Containers.Timeshare
102 119
             SellPrice = week.SellPrice;
103 120
             IsTender = false;
104 121
             ReferedByAgent = week.ReferedByAgent;
122
+            WeekType = week.WeekType.ToString();
105 123
         }
106 124
 
107 125
         public int Id { get; set; }
@@ -126,7 +144,7 @@ namespace UnivateProperties_API.Containers.Timeshare
126 144
         public double SellPrice { get; set; }
127 145
         public bool IsTender { get; set; }
128 146
         public bool ReferedByAgent { get; set; }
129
-
147
+        public string WeekType { get; set; }
130 148
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
131 149
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
132 150
     }    

+ 8
- 0
UnivateProperties_API/Enums.cs Bestand weergeven

@@ -25,4 +25,12 @@
25 25
         Property,
26 26
         Bid
27 27
     }
28
+
29
+    public enum WeekType
30
+    {
31
+        Flexi,
32
+        Fixed,
33
+        Module,
34
+        Syndicate
35
+    }
28 36
 }

+ 1563
- 0
UnivateProperties_API/Migrations/20200904080501_WeekType added for weeks.Designer.cs
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 23
- 0
UnivateProperties_API/Migrations/20200904080501_WeekType added for weeks.cs Bestand weergeven

@@ -0,0 +1,23 @@
1
+using Microsoft.EntityFrameworkCore.Migrations;
2
+
3
+namespace UnivateProperties_API.Migrations
4
+{
5
+    public partial class WeekTypeaddedforweeks : Migration
6
+    {
7
+        protected override void Up(MigrationBuilder migrationBuilder)
8
+        {
9
+            migrationBuilder.AddColumn<int>(
10
+                name: "WeekType",
11
+                table: "Weeks",
12
+                nullable: false,
13
+                defaultValue: 0);
14
+        }
15
+
16
+        protected override void Down(MigrationBuilder migrationBuilder)
17
+        {
18
+            migrationBuilder.DropColumn(
19
+                name: "WeekType",
20
+                table: "Weeks");
21
+        }
22
+    }
23
+}

+ 2
- 0
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs Bestand weergeven

@@ -1023,6 +1023,8 @@ namespace UnivateProperties_API.Migrations
1023 1023
 
1024 1024
                     b.Property<bool>("WeekPlacedForRental");
1025 1025
 
1026
+                    b.Property<int>("WeekType");
1027
+
1026 1028
                     b.HasKey("Id");
1027 1029
 
1028 1030
                     b.HasIndex("AgencyId");

+ 1
- 0
UnivateProperties_API/Model/Properties/Property.cs Bestand weergeven

@@ -34,6 +34,7 @@ namespace UnivateProperties_API.Model.Properties
34 34
         public string PostalCode { get; set; }
35 35
         public string PropertCoords { get; set; }  
36 36
         public string AddressURL { get; set; }
37
+        public string PropertyRef { get; set; }
37 38
         public bool Published { get; set; }
38 39
         public DateTime DatePublished { get; set; }
39 40
         public string VirtualTour { get; set; }

+ 2
- 0
UnivateProperties_API/Model/Timeshare/TimeshareWeek.cs Bestand weergeven

@@ -94,6 +94,8 @@ namespace UnivateProperties_API.Model.Timeshare
94 94
 
95 95
         [ForeignKey("Status")]
96 96
         public int StatusId { get; set; }
97
+
98
+        public WeekType WeekType { get; set; }
97 99
         #endregion
98 100
 
99 101
         #region Navigation

+ 8
- 3
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Bestand weergeven

@@ -502,7 +502,8 @@ namespace UnivateProperties_API.Repository.Properties
502 502
         private List<PropertyDisplay> GetDisplayDetails(List<Property> props)
503 503
         {
504 504
             var properties = new List<PropertyDisplay>();
505
-            props = props.Where(p => p.Published).ToList();
505
+            //Removed publish check for now
506
+            //props = props.Where(p => p.Published).ToList();
506 507
             foreach (var item in props)
507 508
             {
508 509
                 PropertyDisplay display = new PropertyDisplay
@@ -582,7 +583,9 @@ namespace UnivateProperties_API.Repository.Properties
582 583
 
583 584
         public List<PropertyDisplay> GetLatestDisplay()
584 585
         {
585
-            List<Property> props = GetAll().Where(x => x.Published).OrderByDescending(x => x.DatePublished).Take(3).ToList();
586
+            //Removed Published Check for now
587
+            //List<Property> props = GetAll().Where(x => x.Published).OrderByDescending(x => x.DatePublished).Take(3).ToList();
588
+            List<Property> props = GetAll().OrderByDescending(x => x.Created).Take(3).ToList();
586 589
             return GetDisplayDetails(props);
587 590
         }
588 591
 
@@ -619,7 +622,9 @@ namespace UnivateProperties_API.Repository.Properties
619 622
 
620 623
         public List<PropertyList> GetPropertyList()
621 624
         {
622
-            return SetPropertyList(dBContext.Properties.Where(x => x.Published).ToList());
625
+            //Removed Published check for now
626
+            //return SetPropertyList(dBContext.Properties.Where(x => x.Published).ToList());
627
+            return SetPropertyList(dBContext.Properties.ToList());
623 628
         }
624 629
 
625 630
         private List<PropertyList> SetPropertyList(List<Property> properties)

+ 2
- 2
UnivateProperties_API/appsettings.json Bestand weergeven

@@ -9,7 +9,7 @@
9 9
   },
10 10
   "AllowedHosts": "*",
11 11
   "ConnectionStrings": {
12
-    "DefaultConnection": "Data Source=192.168.0.219;Initial Catalog=UniVateDemo;Persist Security Info=True;User Id=Provision;Password=What123!;Pooling=false;",
13
-    "TenderConnection": "http://www.unipoint-consoft.co.za/nph-srep.exe?cluvavail_test.sch&CLUB=LPA&RESORT=ALL&SUMMARY=N&HEAD=N"
12
+    "DefaultConnection": "Data Source=localhost;Initial Catalog=UniVateDemo;Persist Security Info=True;User Id=Provision;Password=What123!;Pooling=false;",
13
+    "TenderConnection": "http://www.unipoint-consoft.co.za/nph-srep.exe?cluvavail.sch&CLUB=LPA&RESORT=ALL&SUMMARY=N&HEAD=N"
14 14
   }
15 15
 }

Laden…
Annuleren
Opslaan