diff --git a/Yavsc/Model/Forms/Field.cs b/Yavsc/Model/Forms/Field.cs new file mode 100644 index 00000000..e2e12b6f --- /dev/null +++ b/Yavsc/Model/Forms/Field.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Model.Forms.Validation; + +namespace Yavsc.Model.Forms +{ + public abstract class Field + { + [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id {  get; set; } + public abstract Method [] ValidationMethods (); + + public string Name { get; set; } + + public string Label { get; set; } + public string PlaceHolder { get; set; } + + public string ValueType { get; set; } + + } +} \ No newline at end of file diff --git a/Yavsc/Model/Forms/FieldSet.cs b/Yavsc/Model/Forms/FieldSet.cs new file mode 100644 index 00000000..93ebae4f --- /dev/null +++ b/Yavsc/Model/Forms/FieldSet.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace Yavsc.Model.Forms +{ + public class FieldSet + { + public string Legend {get; set;} + public List Fields { get; set; } + + } +} \ No newline at end of file diff --git a/Yavsc/Model/Forms/Form.cs b/Yavsc/Model/Forms/Form.cs new file mode 100644 index 00000000..683fd6f2 --- /dev/null +++ b/Yavsc/Model/Forms/Form.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Yavsc.Model.Forms +{ + public class Form + { + [Key] + public string Id {get; set;} + + public string Summary { get; set; } + public List Content { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Model/Forms/Validation/Method.cs b/Yavsc/Model/Forms/Validation/Method.cs new file mode 100644 index 00000000..13649d94 --- /dev/null +++ b/Yavsc/Model/Forms/Validation/Method.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; + +namespace Yavsc.Model.Forms.Validation +{ + public class Method + { + [Key] + public string Name {get; set; } + + /// + /// TODO localisation ... + /// + /// + [Required] + public string ErrorMessage { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Model/Forms/Validation/Required.cs b/Yavsc/Model/Forms/Validation/Required.cs new file mode 100644 index 00000000..3008c121 --- /dev/null +++ b/Yavsc/Model/Forms/Validation/Required.cs @@ -0,0 +1,7 @@ +namespace Yavsc.Model.Forms.Validation +{ + public class Required : Method + { + + } +} \ No newline at end of file