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.NonDbModels { public class provider_short { public provider_short() { prov_country_code = "ZA"; } [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 = "Discipline")] public int prov_discipline_code { get; set; } [NotMapped] [Display(Name = "Discipline")] public string prov_discipline_desc { get; set; } [Required] [Display(Name = "Sub-Discipline")] public int prov_sub_discipline_key { get; set; } [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; } [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] [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; } [Display(Name = "Date Registered")] public DateTime? prov_registered { get; set; } [HiddenInput(DisplayValue = false)] public DateTime? modified_dt { get; set; } [HiddenInput(DisplayValue = false)] public string modified_by_key { get; set; } } }