Przeglądaj źródła

Mail update & Property Coords

master
30117125 4 lat temu
rodzic
commit
324b1f4369

+ 1
- 0
UnivateProperties_API/Controllers/Communication/MailController.cs Wyświetl plik

29
                     case 0:
29
                     case 0:
30
                         _repo.ContactUs(mm);
30
                         _repo.ContactUs(mm);
31
                         break;
31
                         break;
32
+
32
                 }
33
                 }
33
                 return new OkResult();
34
                 return new OkResult();
34
             }
35
             }

+ 1551
- 0
UnivateProperties_API/Migrations/20200828154257_PropertyCoordsUpdate.Designer.cs
Plik diff jest za duży
Wyświetl plik


+ 43
- 0
UnivateProperties_API/Migrations/20200828154257_PropertyCoordsUpdate.cs Wyświetl plik

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

646
 
646
 
647
                     b.Property<string>("PricePer");
647
                     b.Property<string>("PricePer");
648
 
648
 
649
+                    b.Property<string>("PropertCoords");
650
+
649
                     b.Property<string>("PropertyName");
651
                     b.Property<string>("PropertyName");
650
 
652
 
651
                     b.Property<int>("PropertyTypeId");
653
                     b.Property<int>("PropertyTypeId");
676
 
678
 
677
                     b.HasIndex("OwnerId");
679
                     b.HasIndex("OwnerId");
678
 
680
 
681
+                    b.HasIndex("PropertyTypeId");
682
+
679
                     b.ToTable("Properties");
683
                     b.ToTable("Properties");
680
                 });
684
                 });
681
 
685
 
1413
                     b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
1417
                     b.HasOne("UnivateProperties_API.Model.Users.Individual", "Owner")
1414
                         .WithMany("Properties")
1418
                         .WithMany("Properties")
1415
                         .HasForeignKey("OwnerId");
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
             modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>
1427
             modelBuilder.Entity("UnivateProperties_API.Model.Properties.PropertyImage", b =>

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

26
         public string AddressLine1 { get; set; }
26
         public string AddressLine1 { get; set; }
27
         public string AddressLine2 { get; set; }
27
         public string AddressLine2 { get; set; }
28
         public string AddressLine3 { get; set; }
28
         public string AddressLine3 { get; set; }
29
+        public string PropertCoords { get; set; }
29
         public int SuburbId { get; set; }
30
         public int SuburbId { get; set; }
30
         public int CityId { get; set; }
31
         public int CityId { get; set; }
31
         public int ProvinceId { get; set; }
32
         public int ProvinceId { get; set; }

+ 2
- 0
UnivateProperties_API/Repository/Communication/MailRepository.cs Wyświetl plik

55
             client.Disconnect(true);
55
             client.Disconnect(true);
56
             client.Dispose();
56
             client.Dispose();
57
         }
57
         }
58
+
59
+
58
     }
60
     }
59
 }
61
 }

+ 2
- 1
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Wyświetl plik

47
 
47
 
48
         public PropertyContainer GetDetailed(int id, bool detailed)
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
             if (property != null)
52
             if (property != null)
52
             {
53
             {
53
                 return GetDetail(property, detailed);
54
                 return GetDetail(property, detailed);

+ 1
- 1
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;",
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_test.sch&CLUB=LPA&RESORT=ALL&SUMMARY=N&HEAD=N"
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
 }

Ładowanie…
Anuluj
Zapisz