diff options
author | Paulius Klezys <paul4618@edu.easj.dk> | 2017-05-22 11:20:41 +0200 |
---|---|---|
committer | Paulius Klezys <paul4618@edu.easj.dk> | 2017-05-22 11:20:41 +0200 |
commit | 60385d4477827ed0c75ff2f3800a5c0a7b60ec4d (patch) | |
tree | 151b7a439c725fa180f59b214ce59773a8608a52 /ApartmentManager/HousingWebApi/Models | |
parent | 27515d443a8eab66f4195490a989f0be6561ff45 (diff) | |
parent | 590ce43270fa4f825d964b571c50e2542b2fb15b (diff) |
Merge branch 'master' of https://github.com/marcinzelent/ApartmentAdmin
Diffstat (limited to 'ApartmentManager/HousingWebApi/Models')
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/Apartment.cs | 28 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/ApartmentChange.cs | 44 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/ApartmentResident.cs | 37 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/ChangeComment.cs | 22 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/ChangeDocument.cs | 22 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/Defect.cs | 39 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/DefectComment.cs (renamed from ApartmentManager/HousingWebApi/Models/PastContractOwner.cs) | 13 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/DefectPicture.cs | 22 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/PastUser.cs | 49 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/Resident.cs | 21 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/ResidentList.cs | 20 | ||||
-rw-r--r-- | ApartmentManager/HousingWebApi/Models/User.cs | 41 |
12 files changed, 264 insertions, 94 deletions
diff --git a/ApartmentManager/HousingWebApi/Models/Apartment.cs b/ApartmentManager/HousingWebApi/Models/Apartment.cs index 7481344..d1ac1d5 100644 --- a/ApartmentManager/HousingWebApi/Models/Apartment.cs +++ b/ApartmentManager/HousingWebApi/Models/Apartment.cs @@ -6,40 +6,48 @@ namespace HousingWebApi using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; + [Table("Apartment")] public partial class Apartment { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public Apartment() { + ApartmentChanges = new HashSet<ApartmentChange>(); Defects = new HashSet<Defect>(); + PastUsers = new HashSet<PastUser>(); Residents = new HashSet<Resident>(); + Users = new HashSet<User>(); } - [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] - public int ApartmentNumber { get; set; } + public int ApartmentId { get; set; } - public decimal Size { get; set; } + public double? Size { get; set; } - public int NumberOfRooms { get; set; } + public int? NumberOfRooms { get; set; } - [StringLength(10)] - public string MonthlyCharge { get; set; } + public double? MonthlyCharge { get; set; } public int? Floor { get; set; } - [StringLength(50)] + [StringLength(100)] public string Address { get; set; } - [StringLength(200)] - public string PlanPicture { get; set; } + public byte[] PlanPicture { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<ApartmentChange> ApartmentChanges { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<Defect> Defects { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<PastUser> PastUsers { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<Resident> Residents { get; set; } - public virtual User User { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<User> Users { get; set; } } } diff --git a/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs b/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs new file mode 100644 index 0000000..e14a35e --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/ApartmentChange.cs @@ -0,0 +1,44 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("ApartmentChange")] + public partial class ApartmentChange + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ApartmentChange() + { + ChangeComments = new HashSet<ChangeComment>(); + ChangeDocuments = new HashSet<ChangeDocument>(); + } + + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int ChangeId { get; set; } + + public int ApartmentId { get; set; } + + [StringLength(50)] + public string Name { get; set; } + + [Column(TypeName = "date")] + public DateTime? UploadDate { get; set; } + + public string Description { get; set; } + + [StringLength(50)] + public string Status { get; set; } + + public virtual Apartment Apartment { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<ChangeComment> ChangeComments { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<ChangeDocument> ChangeDocuments { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/ApartmentResident.cs b/ApartmentManager/HousingWebApi/Models/ApartmentResident.cs new file mode 100644 index 0000000..092c95f --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/ApartmentResident.cs @@ -0,0 +1,37 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + public partial class ApartmentResident + { + [Key] + [Column(Order = 0)] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int ApartmentNumber { get; set; } + + [Key] + [Column(Order = 1)] + [StringLength(20)] + public string FirstName { get; set; } + + [Key] + [Column(Order = 2)] + [StringLength(20)] + public string LastName { get; set; } + + [Column(TypeName = "date")] + public DateTime? BirthDate { get; set; } + + public int? PhoneNo { get; set; } + + [StringLength(30)] + public string Email { get; set; } + + [Column(TypeName = "image")] + public byte[] Picture { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/ChangeComment.cs b/ApartmentManager/HousingWebApi/Models/ChangeComment.cs new file mode 100644 index 0000000..3c5d8d8 --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/ChangeComment.cs @@ -0,0 +1,22 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("ChangeComment")] + public partial class ChangeComment + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int CommentId { get; set; } + + public int ChangeId { get; set; } + + public string Comment { get; set; } + + public virtual ApartmentChange ApartmentChange { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs b/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs new file mode 100644 index 0000000..9e910dc --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/ChangeDocument.cs @@ -0,0 +1,22 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("ChangeDocument")] + public partial class ChangeDocument + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int DocumentId { get; set; } + + public int ChangeId { get; set; } + + public byte[] Document { get; set; } + + public virtual ApartmentChange ApartmentChange { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/Defect.cs b/ApartmentManager/HousingWebApi/Models/Defect.cs index b439078..5200124 100644 --- a/ApartmentManager/HousingWebApi/Models/Defect.cs +++ b/ApartmentManager/HousingWebApi/Models/Defect.cs @@ -6,41 +6,38 @@ namespace HousingWebApi using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; + [Table("Defect")] public partial class Defect { - [Key] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public Defect() + { + DefectComments = new HashSet<DefectComment>(); + DefectPictures = new HashSet<DefectPicture>(); + } + [DatabaseGenerated(DatabaseGeneratedOption.None)] - public int DefectNumber { get; set; } + public int DefectId { get; set; } - public int ApartmentNr { get; set; } + public int ApartmentId { get; set; } - [Required] [StringLength(50)] public string Name { get; set; } [Column(TypeName = "date")] - public DateTime DateUploaded { get; set; } - - [Required] - [StringLength(200)] - public string Picture { get; set; } - - [StringLength(200)] - public string Picture2 { get; set; } - - [StringLength(200)] - public string Picture3 { get; set; } + public DateTime? UploadDate { get; set; } - [Column(TypeName = "text")] - [Required] public string Description { get; set; } - [Column(TypeName = "text")] - public string Comment { get; set; } - - [StringLength(10)] + [StringLength(50)] public string Status { get; set; } public virtual Apartment Apartment { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<DefectComment> DefectComments { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection<DefectPicture> DefectPictures { get; set; } } } diff --git a/ApartmentManager/HousingWebApi/Models/PastContractOwner.cs b/ApartmentManager/HousingWebApi/Models/DefectComment.cs index 273952a..b05f790 100644 --- a/ApartmentManager/HousingWebApi/Models/PastContractOwner.cs +++ b/ApartmentManager/HousingWebApi/Models/DefectComment.cs @@ -6,12 +6,17 @@ namespace HousingWebApi using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; - public partial class PastContractOwner + [Table("DefectComment")] + public partial class DefectComment { + [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] - public int Id { get; set; } + public int PictureId { get; set; } - [StringLength(10)] - public string ApartmentNr { get; set; } + public int DefectId { get; set; } + + public string Picture { get; set; } + + public virtual Defect Defect { get; set; } } } diff --git a/ApartmentManager/HousingWebApi/Models/DefectPicture.cs b/ApartmentManager/HousingWebApi/Models/DefectPicture.cs new file mode 100644 index 0000000..6a83338 --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/DefectPicture.cs @@ -0,0 +1,22 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("DefectPicture")] + public partial class DefectPicture + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int PictureId { get; set; } + + public int DefectId { get; set; } + + public byte[] Picture { get; set; } + + public virtual Defect Defect { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/PastUser.cs b/ApartmentManager/HousingWebApi/Models/PastUser.cs new file mode 100644 index 0000000..f258d34 --- /dev/null +++ b/ApartmentManager/HousingWebApi/Models/PastUser.cs @@ -0,0 +1,49 @@ +namespace HousingWebApi +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Data.Entity.Spatial; + + [Table("PastUser")] + public partial class PastUser + { + [Key] + [StringLength(30)] + public string Username { get; set; } + + public int ApartmentId { get; set; } + + [Required] + [StringLength(30)] + public string Password { get; set; } + + public bool IsBm { get; set; } + + [StringLength(30)] + public string FirstName { get; set; } + + [StringLength(30)] + public string LastName { get; set; } + + [Column(TypeName = "date")] + public DateTime? BirthDate { get; set; } + + [StringLength(20)] + public string Phone { get; set; } + + [StringLength(50)] + public string Email { get; set; } + + public byte[] Picture { get; set; } + + [Column(TypeName = "date")] + public DateTime? MoveInDate { get; set; } + + [Column(TypeName = "date")] + public DateTime? MoveOutDate { get; set; } + + public virtual Apartment Apartment { get; set; } + } +} diff --git a/ApartmentManager/HousingWebApi/Models/Resident.cs b/ApartmentManager/HousingWebApi/Models/Resident.cs index 319a697..c9a698f 100644 --- a/ApartmentManager/HousingWebApi/Models/Resident.cs +++ b/ApartmentManager/HousingWebApi/Models/Resident.cs @@ -6,31 +6,30 @@ namespace HousingWebApi using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; + [Table("Resident")] public partial class Resident { - [Key] - public int ResidentNr { get; set; } + [DatabaseGenerated(DatabaseGeneratedOption.None)] + public int ResidentId { get; set; } - public int ApartmentNr { get; set; } + public int ApartmentId { get; set; } - [Required] - [StringLength(20)] + [StringLength(30)] public string FirstName { get; set; } - [Required] - [StringLength(20)] + [StringLength(30)] public string LastName { get; set; } [Column(TypeName = "date")] public DateTime? BirthDate { get; set; } - public int? Phone { get; set; } + [StringLength(20)] + public string Phone { get; set; } - [StringLength(30)] + [StringLength(50)] public string Email { get; set; } - [StringLength(220)] - public string Picture { get; set; } + public byte[] Picture { get; set; } public virtual Apartment Apartment { get; set; } } diff --git a/ApartmentManager/HousingWebApi/Models/ResidentList.cs b/ApartmentManager/HousingWebApi/Models/ResidentList.cs deleted file mode 100644 index 9423bc1..0000000 --- a/ApartmentManager/HousingWebApi/Models/ResidentList.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; - -namespace HousingWebApi -{ - public class ResidentList - { - public int ResidentNr { get; set; } - public int ApartmentNr { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public DateTime? BirthDate { get; set; } - public int? Phone { get; set; } - public string Email { get; set; } - public string Picture { get; set; } - - } -}
\ No newline at end of file diff --git a/ApartmentManager/HousingWebApi/Models/User.cs b/ApartmentManager/HousingWebApi/Models/User.cs index e260ede..019e788 100644 --- a/ApartmentManager/HousingWebApi/Models/User.cs +++ b/ApartmentManager/HousingWebApi/Models/User.cs @@ -6,58 +6,43 @@ namespace HousingWebApi using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; + [Table("User")] public partial class User { [Key] - [DatabaseGenerated(DatabaseGeneratedOption.None)] - public int ApartmentNr { get; set; } - - [Required] - [StringLength(15)] + [StringLength(30)] public string Username { get; set; } + public int ApartmentId { get; set; } + [Required] - [StringLength(15)] + [StringLength(30)] public string Password { get; set; } - [Required] - [StringLength(1)] - public string Type { get; set; } + public bool IsBm { get; set; } - [Required] - [StringLength(20)] + [StringLength(30)] public string FirstName { get; set; } - [Required] - [StringLength(20)] + [StringLength(30)] public string LastName { get; set; } [Column(TypeName = "date")] public DateTime? BirthDate { get; set; } - [StringLength(12)] + [StringLength(20)] public string Phone { get; set; } - [StringLength(30)] + [StringLength(50)] public string Email { get; set; } - [Column(TypeName = "image")] public byte[] Picture { get; set; } - [StringLength(20)] - public string SecondName { get; set; } - - [StringLength(20)] - public string SecondLastName { get; set; } - [Column(TypeName = "date")] - public DateTime? SecondBirthDate { get; set; } - - [StringLength(12)] - public string SecondPhone { get; set; } + public DateTime? MoveInDate { get; set; } - [StringLength(30)] - public string SecondEmail { get; set; } + [Column(TypeName = "date")] + public DateTime? MoveOutDate { get; set; } public virtual Apartment Apartment { get; set; } } |