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 provider { public provider() { prov_disp_lic_ind = false; } [Key] public int prov_key { get; set; } [Required] [Display(Name = "Title")] [StringLength(7)] public string prov_title { get; set; } [Display(Name = "Initials")] [StringLength(5)] public string prov_initials { get; set; } [Required] [Display(Name = "First Name")] [StringLength(45)] public string prov_first_name { get; set; } [Display(Name = "Middle Name")] [StringLength(45)] public string prov_middle_name { get; set; } [Required] [Display(Name = "Surname")] [StringLength(60)] public string prov_surname { get; set; } [Display(Name = "Provider")] public string prov_full_name { get { return prov_title + " " + prov_first_name + " " + prov_surname; } } //[Required] [Display(Name = "Identity Document Country")] [StringLength(2)] public string prov_country_code { get; set; } [Required] [Display(Name = "Identification Number")] [StringLength(38)] public string prov_id_no { get; set; } [HiddenInput(DisplayValue = false)] [Display(Name = "ID Type")] public int? prov_id_type_key { get; set; } //[Required] [Display(Name = "Gender")] [StringLength(1)] public string prov_gender_code { get; set; } [Display(Name = "VAT Number")] [StringLength(15)] public string prov_vat_no { get; set; } //[Required] [Display(Name = "PDI Status")] [StringLength(1)] public string prov_pdi_status_code { get; set; } [Required] [Display(Name = "Discipline")] public int prov_discipline_code { get; set; } [NotMapped] [Display(Name = "Discipline")] public string prov_discipline_desc { get; set; } [Display(Name = "Sub-Discipline")] public int prov_sub_discipline_key { get; set; } = 0; [NotMapped] [Display(Name = "Sub-Discipline")] public string prov_sub_discipline_desc { get; set; } = ""; [Required] [Display(Name = "HPCSA Number")] [MaxLength(10, ErrorMessage = "HPCSA practice number can be a maximum length of 10 characters ")] [MinLength(9, ErrorMessage = "HPCSA practice number can be a minimum length of 9 characters")] public string prov_hpcsa_no { get; set; } [Required] [EmailAddress] [Display(Name = "Email")] [StringLength(50)] public string prov_email { get; set; } [Display(Name = "Dialing Code")] [StringLength(5)] public string prov_tel_dialling_code { get; set; } [Phone] [Required] [Display(Name = "Practice Phone Number")] [MinLength(10)] [RegularExpression(@"^\+?[()0-9]+$", ErrorMessage = "Primary contact number can only contain numerics, + or ()")] [StringLength(15)] public string prov_tel_no { get; set; } [Phone] [Display(Name = "Fax Number")] [MinLength(10)] [RegularExpression(@"^\+?[()0-9]+$", ErrorMessage = "Fax number can only contain numerics, + or ()")] [StringLength(15)] public string prov_fax_no { get; set; } [Phone] [Required] [Display(Name = "Cellphone Number")] [MinLength(10)] [RegularExpression(@"^\+?[()0-9]+$", ErrorMessage = "Alternative contact number can only contain numerics, + or ()")] [StringLength(15)] public string prov_cell_no { get; set; } // [Required] [Display(Name = "Speciality")] [StringLength(3)] public string prov_speciality_code { get; set; } //[Required] [UIHint("YesNo")] [Display(Name = "Can Dispense")] public bool? prov_disp_lic_ind { get; set; } [Display(Name = "Dispensing Number")] [StringLength(20)] [RegularExpression(@"^\d+$", ErrorMessage = "Dispensing number can only contain numerics")] public string prov_disp_lic_no { get; set; } [Display(Name = "Number of Locations")] public int? prov_no_of_locations { get; set; } [Display(Name = "Date Registered")] public DateTime? prov_registered { get; set; } [Display(Name = "Date De-Registered")] public DateTime? prov_deregistered { get; set; } [HiddenInput(DisplayValue = false)] public DateTime? modified_dt { get; set; } [HiddenInput(DisplayValue = false)] public string modified_by_key { get; set; } [HiddenInput(DisplayValue = false)] public bool? registration_complete { get; set; } } }