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

Mail update & Property Coords

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

+ 1
- 0
UnivateProperties_API/Controllers/Communication/MailController.cs Просмотреть файл

@@ -29,6 +29,7 @@ namespace UnivateProperties_API.Controllers.Communication
29 29
                     case 0:
30 30
                         _repo.ContactUs(mm);
31 31
                         break;
32
+
32 33
                 }
33 34
                 return new OkResult();
34 35
             }

+ 1551
- 0
UnivateProperties_API/Migrations/20200828154257_PropertyCoordsUpdate.Designer.cs
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 43
- 0
UnivateProperties_API/Migrations/20200828154257_PropertyCoordsUpdate.cs Просмотреть файл

@@ -0,0 +1,43 @@
1
+using Microsoft.EntityFrameworkCore.Migrations;
2
+
3
+namespace UnivateProperties_API.Migrations
4
+{
5
+    public partial class PropertyCoordsUpdate : Migration
6
+    {
7
+        protected override void Up(MigrationBuilder migrationBuilder)
8
+        {
9
+            migrationBuilder.AddColumn<string>(
10
+                name: "PropertCoords",
11
+                table: "Properties",
12
+                nullable: true);
13
+
14
+            migrationBuilder.CreateIndex(
15
+                name: "IX_Properties_PropertyTypeId",
16
+                table: "Properties",
17
+                column: "PropertyTypeId");
18
+
19
+            migrationBuilder.AddForeignKey(
20
+                name: "FK_Properties_PropertyTypes_PropertyTypeId",
21
+                table: "Properties",
22
+                column: "PropertyTypeId",
23
+                principalTable: "PropertyTypes",
24
+                principalColumn: "Id",
25
+                onDelete: ReferentialAction.Cascade);
26
+        }
27
+
28
+        protected override void Down(MigrationBuilder migrationBuilder)
29
+        {
30
+            migrationBuilder.DropForeignKey(
31
+                name: "FK_Properties_PropertyTypes_PropertyTypeId",
32
+                table: "Properties");
33
+
34
+            migrationBuilder.DropIndex(
35
+                name: "IX_Properties_PropertyTypeId",
36
+                table: "Properties");
37
+
38
+            migrationBuilder.DropColumn(
39
+                name: "PropertCoords",
40
+                table: "Properties");
41
+        }
42
+    }
43
+}

+ 9
- 0
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs Просмотреть файл

@@ -646,6 +646,8 @@ namespace UnivateProperties_API.Migrations
646 646
 
647 647
                     b.Property<string>("PricePer");
648 648
 
649
+                    b.Property<string>("PropertCoords");
650
+
649 651
                     b.Property<string>("PropertyName");
650 652
 
651 653
                     b.Property<int>("PropertyTypeId");
@@ -676,6 +678,8 @@ namespace UnivateProperties_API.Migrations
676 678
 
677 679
                     b.HasIndex("OwnerId");
678 680
 
681
+                    b.HasIndex("PropertyTypeId");
682
+
679 683
                     b.ToTable("Properties");
680 684
                 });
681 685
 
@@ -1413,6 +1417,11 @@ namespace UnivateProperties_API.Migrations
1413 1417
                     b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
1414 1418
                         .WithMany("Properties")
1415 1419
                         .HasForeignKey("OwnerId");
1420
+
1421
+                    b.HasOne("UnivateProperties_API.Model.Properties.PropertyType", "PropertyType")
1422
+                        .WithMany()
1423
+                        .HasForeignKey("PropertyTypeId")
1424
+                        .OnDelete(DeleteBehavior.Cascade);
1416 1425
                 });
1417 1426
 
1418 1427
             modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>

+ 1
- 0
UnivateProperties_API/Model/Properties/Property.cs Просмотреть файл

@@ -26,6 +26,7 @@ namespace UnivateProperties_API.Model.Properties
26 26
         public string AddressLine1 { get; set; }
27 27
         public string AddressLine2 { get; set; }
28 28
         public string AddressLine3 { get; set; }
29
+        public string PropertCoords { get; set; }
29 30
         public int SuburbId { get; set; }
30 31
         public int CityId { get; set; }
31 32
         public int ProvinceId { get; set; }

+ 2
- 0
UnivateProperties_API/Repository/Communication/MailRepository.cs Просмотреть файл

@@ -55,5 +55,7 @@ namespace UnivateProperties_API.Repository.Communication
55 55
             client.Disconnect(true);
56 56
             client.Dispose();
57 57
         }
58
+
59
+
58 60
     }
59 61
 }

+ 2
- 1
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Просмотреть файл

@@ -47,7 +47,8 @@ namespace UnivateProperties_API.Repository.Properties
47 47
 
48 48
         public PropertyContainer GetDetailed(int id, bool detailed)
49 49
         {
50
-            var property = dBContext.Properties.Include("Status").Where(p => p.Id == id).FirstOrDefault();            
50
+            //var property = dBContext.Properties.Include("StatusId").Where(p => p.Id == id).FirstOrDefault();
51
+            var property = dBContext.Properties.Where(p => p.Id == id).FirstOrDefault();
51 52
             if (property != null)
52 53
             {
53 54
                 return GetDetail(property, detailed);

+ 1
- 1
UnivateProperties_API/appsettings.json Просмотреть файл

@@ -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;",
12
+    "DefaultConnection": "Data Source=localhost;Initial Catalog=UniVateDemo;Persist Security Info=True;User Id=Provision;Password=What123!;Pooling=false;",
13 13
     "TenderConnection": "http://www.unipoint-consoft.co.za/nph-srep.exe?cluvavail_test.sch&CLUB=LPA&RESORT=ALL&SUMMARY=N&HEAD=N"
14 14
   }
15 15
 }

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