-
Notifications
You must be signed in to change notification settings - Fork 0
/
Insurance.cs
40 lines (37 loc) · 1.38 KB
/
Insurance.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace WebApplication1.Models
{
public class Insurance
{
[NotMapped]
private const int Default_Code = 400;
[Key]
[Required]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int InsuranceId { get; set; }
[Required]
[StringLength(30,MinimumLength=5)]
[Display(Name="Customer Name")]
public String Name { get; set; }
[Required]
[RegularExpression(@"[+]?[9][1]\d{10}",ErrorMessage="Phone Number should be in +919999999999 format")]
public String PhoneNo { get; set; }
[StringLength(50, MinimumLength = 5)]
public String Address { get; set; }
[RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",ErrorMessage = "Email doesn't look like a valid email address.")]
public String Email { get; set; }
[Required]
public long SumAssured { get; set; }
[DefaultValue(Default_Code)]
public String InsCode { get; set; }
public int Premium { get; set; }
public DateTime DOS { get; set; }
public String Nominee { get; set; }
}
}