using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; using System.ComponentModel.DataAnnotations.Schema; namespace HealthchoiceMVC.Models { public class Practice { [Key] public int PracticeId { get; set; } [Required] [Display(Name = "Practice Name")] [MaxLength(150)] public string PracticeName { get; set; } [Display(Name = "Trading Name")] [MaxLength(150)] public string PracticeTradingName { get; set; } [Required] [Display(Name = "BHF Practice Number / PCNS")] [MaxLength(7)] [MinLength(7)] [RegularExpression(@"^\d{7}$", ErrorMessage = "Practice number can only contain numbers")] public string PracticeNumber { get; set; } [Required] [Display(Name = "SASP Number")] [MaxLength(10)] [MinLength(7)] public string AffiliationNumber { get; set; } [Display(Name = "VAT Number")] [MaxLength(10)] public string VatNumber { get; set; } = ""; [Display(Name = "Company Registration Number")] [MaxLength(30)] public string RegistrationNumber { get; set; } = ""; [Required] [Display(Name = "Partner Initiative")] public int NetworkAffiliationId { get; set; } [Required] [Display(Name = "Address Line 1")] public string AddressLineOne { get; set; } [Display(Name = "Address Line 2")] public string AddressLineTwo { get; set; } [Display(Name = "Area or Suburb")] [MaxLength(50)] public string AreaSuburb { get; set; } [Required] [Display(Name = "City or Town")] [MaxLength(250)] public string CityTown { get; set; } [Required] [Display(Name = "Postal Code")] [MaxLength(250)] public string PostalCode { get; set; } [Display(Name = "Practice Primary Contact Number")] [MaxLength(15)] [Phone] //[RegularExpression(@"^\+?[()0-9]+$", ErrorMessage = "Primary primary contact number can only contain numerics, + or ()")] public string PracticePrimaryContactNumber{ get; set; } [Display(Name = "Practice Primary Contact Email")] [EmailAddress] [MaxLength(150)] public string PracticePrimaryContactEmail { get; set; } [Display(Name = "Is Active")] public bool ActiveIndic { get; set; } = false; [Display(Name = "Validated Date")] public DateTime? ValidatedDate { get; set; } [ForeignKey("NetworkAffiliationId")] public virtual NetworkAffiliation NetworkAffiliation { get; set; } public virtual ICollection PracticeLocations { get; set; } } }