30117125 4 lat temu
rodzic
commit
22d8b0bd37

+ 19
- 1
UnivateProperties_API/Containers/Timeshare/WeekDto.cs Wyświetl plik

74
             Region = new RegionDto() { RegionCode = split[24].Trim() };
74
             Region = new RegionDto() { RegionCode = split[24].Trim() };
75
             IsTender = true;
75
             IsTender = true;
76
             ReferedByAgent = false;
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
         public WeekDto(TimeshareWeek week)
96
         public WeekDto(TimeshareWeek week)
102
             SellPrice = week.SellPrice;
119
             SellPrice = week.SellPrice;
103
             IsTender = false;
120
             IsTender = false;
104
             ReferedByAgent = week.ReferedByAgent;
121
             ReferedByAgent = week.ReferedByAgent;
122
+            WeekType = week.WeekType.ToString();
105
         }
123
         }
106
 
124
 
107
         public int Id { get; set; }
125
         public int Id { get; set; }
126
         public double SellPrice { get; set; }
144
         public double SellPrice { get; set; }
127
         public bool IsTender { get; set; }
145
         public bool IsTender { get; set; }
128
         public bool ReferedByAgent { get; set; }
146
         public bool ReferedByAgent { get; set; }
129
-
147
+        public string WeekType { get; set; }
130
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
148
         public string Display => $"{Resort.Display}  ({ArrivalDate.ToShortDateString()} - {DepartureDate.ToShortDateString()})";
131
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
149
         public string WeekUni => $"{Resort.ResortCode}-{UnitNumber}-{WeekNumber}";
132
     }    
150
     }    

+ 8
- 0
UnivateProperties_API/Enums.cs Wyświetl plik

25
         Property,
25
         Property,
26
         Bid
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
Plik diff jest za duży
Wyświetl plik


+ 23
- 0
UnivateProperties_API/Migrations/20200904080501_WeekType added for weeks.cs Wyświetl plik

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 Wyświetl plik

1023
 
1023
 
1024
                     b.Property<bool>("WeekPlacedForRental");
1024
                     b.Property<bool>("WeekPlacedForRental");
1025
 
1025
 
1026
+                    b.Property<int>("WeekType");
1027
+
1026
                     b.HasKey("Id");
1028
                     b.HasKey("Id");
1027
 
1029
 
1028
                     b.HasIndex("AgencyId");
1030
                     b.HasIndex("AgencyId");

+ 1
- 0
UnivateProperties_API/Model/Properties/Property.cs Wyświetl plik

34
         public string PostalCode { get; set; }
34
         public string PostalCode { get; set; }
35
         public string PropertCoords { get; set; }  
35
         public string PropertCoords { get; set; }  
36
         public string AddressURL { get; set; }
36
         public string AddressURL { get; set; }
37
+        public string PropertyRef { get; set; }
37
         public bool Published { get; set; }
38
         public bool Published { get; set; }
38
         public DateTime DatePublished { get; set; }
39
         public DateTime DatePublished { get; set; }
39
         public string VirtualTour { get; set; }
40
         public string VirtualTour { get; set; }

+ 2
- 0
UnivateProperties_API/Model/Timeshare/TimeshareWeek.cs Wyświetl plik

94
 
94
 
95
         [ForeignKey("Status")]
95
         [ForeignKey("Status")]
96
         public int StatusId { get; set; }
96
         public int StatusId { get; set; }
97
+
98
+        public WeekType WeekType { get; set; }
97
         #endregion
99
         #endregion
98
 
100
 
99
         #region Navigation
101
         #region Navigation

+ 8
- 3
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Wyświetl plik

502
         private List<PropertyDisplay> GetDisplayDetails(List<Property> props)
502
         private List<PropertyDisplay> GetDisplayDetails(List<Property> props)
503
         {
503
         {
504
             var properties = new List<PropertyDisplay>();
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
             foreach (var item in props)
507
             foreach (var item in props)
507
             {
508
             {
508
                 PropertyDisplay display = new PropertyDisplay
509
                 PropertyDisplay display = new PropertyDisplay
582
 
583
 
583
         public List<PropertyDisplay> GetLatestDisplay()
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
             return GetDisplayDetails(props);
589
             return GetDisplayDetails(props);
587
         }
590
         }
588
 
591
 
619
 
622
 
620
         public List<PropertyList> GetPropertyList()
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
         private List<PropertyList> SetPropertyList(List<Property> properties)
630
         private List<PropertyList> SetPropertyList(List<Property> properties)

+ 2
- 2
UnivateProperties_API/appsettings.json Wyświetl plik

9
   },
9
   },
10
   "AllowedHosts": "*",
10
   "AllowedHosts": "*",
11
   "ConnectionStrings": {
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
 }

Ładowanie…
Anuluj
Zapisz