Below is the Administrator information table for the model layer
In this model we used asp.net MVC data annotation and verification, can be used as backend verification, Entity Framework to the database mapping
Using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.ComponentModel.DataAnnotations.Schema;
6 using System.ComponentModel.DataAnnotations;
7 using SYSTEM.WEB.MVC;
8 using System.ComponentModel;
9 namespace Snsmodel [Table ("Admininfo")] [public partial class Admininfo [Key] [Display (Name = "number:")] [Column ("Id")] is public int Id {get; Set [Required (errormessage = "* Cannot be empty!")] [RegularExpression (@] ^[\u4e00-\u9fa5\uf900-\ufa2d\w\.\s]{6 , 18}$ ", errormessage =" *6-18 digit pinyin or number ")] [Column (TypeName =" nvarchar ")] [MaxLength ()] [D Isplay (name = "Username:")]///[remote ("Checkusername", "account")] is public string UserName {get; set;} 2 7 [Required (errormessage = "* Cannot be empty!")] [RegularExpression (@ "^[\u4e00-\u9fa5\uf900-\ufa2d\w\.\s]{6,18 }$ ", errormessage =" *6-18 digit pinyin or digit ")] [TypeName = "nvarchar")] [MaxLength] [MinLength (6)] [Display (Nam E = "Password:")] [DataType (Datatype.password)] is public string Password {get; Set (TypeName = "nvarchar")] [Display (name = "real name:")] [MaxLength (20)] 40 public string Truename {get; set;} [Display (Name = "is available:")]? isuseful {get; set;} [ReadOnly (True)] [Display (Name = "creation Time:")] is public DateTime Cre attime {get; set;} [Display (Name = "Rank")] is a public int? Orders {get; set;} [notmapped] [Required (errormessage = "* Cannot be empty!")] [Regularexpressi On (@ "^[\u4e00-\u9fa5\uf900-\ufa2d\w\.\s]{6,18}$", errormessage = "*6-18 bit pinyin or number")] [Display (Name = "New password")] 56 [DataType (Datatype.password)] is public virtual string PassWord1 {get; set;} 58 59 [Notmapped] [Compare ("PassWord1", errormessage = "New password and Confirm password inconsistent!")] [Required (errormessage =] * cannot be empty! ] [RegularExpression (@ "^[\u4e00-\u9fa5\uf900-\ufa2d\w\.\s]{6,18}$", errormessage = "*6-18 bit pinyin or number")] 63 [Display (Name = Confirm password)] [DataType (Datatype.password)] is a public virtual string PassWord2 {get; set; } 66} 67}