Exemple #1
0
 public CategoryEntity()
     : base("test.category")
 {
     IsVersioned = false;
     Hierarchy   = true;
     Fields.Chars("name").WithLabel("Name").WithNotRequired().WithSize(64);
 }
Exemple #2
0
 public ChildEntity()
     : base("test.child")
 {
     Fields.Chars("name").WithLabel("Name").WithRequired().WithSize(64);
     Fields.ManyToOne("master", "test.master").WithLabel("Master")
     .WithNotRequired().OnDelete(OnDeleteAction.SetNull);
 }
 public DepartmentEntity()
     : base("test.department")
 {
     Fields.Chars("name").WithLabel("Name").WithRequired().WithSize(64);
     Fields.ManyToMany("employees", "test.department_employee", "did", "eid")
     .WithLabel("Employees");
 }
Exemple #4
0
 public DepartmentModel()
     : base("test.department")
 {
     Fields.Chars("name").SetLabel("Name").Required().SetSize(64);
     Fields.ManyToMany("employees", "test.department_employee", "did", "eid")
     .SetLabel("Employees");
 }
Exemple #5
0
        public OrganizationEntity() : base("core.organization")
        {
            Hierarchy = true;

            Fields.Chars("code").WithLabel("Code").WithSize(64).WithRequired().WithUnique();
            Fields.Chars("name").WithLabel("Name").WithRequired();
        }
Exemple #6
0
        public TestModel()
            : base("test.test_model")
        {
            IsVersioned = false;

            Fields.Chars("name").SetLabel("姓名").SetSize(64).Required();
            Fields.Chars("address").SetLabel("地址").SetSize(200).Required();
            Fields.Integer("field1").SetLabel("数1");
            Fields.Integer("field2").SetLabel("数2");
            Fields.Integer("field3").SetLabel("数3").SetValueGetter(this.GetField3);
            Fields.BigInteger("big_int_field").SetLabel("Bit Int Field");
            Fields.Boolean("boolean_field").SetLabel("Boolean Field").Required().SetDefaultValueGetter(s => true);
            Fields.Text("text_field").SetLabel("Text Field");
            Fields.Double("double_field").SetLabel("Double Field");
            Fields.Decimal("money_field").SetLabel("Decimal Field");

            Fields.Enumeration("enum_field",
                               new Dictionary <string, string>()
            {
                { "state1", "State 1" }, { "state2", "State2" }
            })
            .SetLabel("Enumeration Field");

            Fields.Binary("binary_field").SetLabel("Binary Field");

            Fields.Reference("reference_field").SetLabel("Reference Field").SetOptions(
                new Dictionary <string, string>()
            {
                { "test.master", "Master Model" },
                { "test.child", "Child Model" },
            });
        }
Exemple #7
0
 public CategoryModel()
     : base("test.category")
 {
     IsVersioned = false;
     Hierarchy   = true;
     Fields.Chars("name").SetLabel("Name").NotRequired().SetSize(64);
 }
Exemple #8
0
 public SalesOrderModel()
     : base("test.sales_order")
 {
     Fields.Chars("name").SetLabel("Code");
     Fields.DateTime("order_date").SetLabel("Date");
     Fields.ManyToOne("organization", "core.organization").SetLabel("Organization").NotRequired();
 }
Exemple #9
0
 public ChildModel()
     : base("test.child")
 {
     Fields.Chars("name").SetLabel("Name").Required().SetSize(64);
     Fields.ManyToOne("master", "test.master").SetLabel("Master")
     .NotRequired().OnDelete(OnDeleteAction.SetNull);
 }
Exemple #10
0
 public EmployeeEntity() : base("demo.employee")
 {
     Fields.Chars("name").WithLabel("姓名").WithRequired();
     Fields.Chars("address").WithLabel("地址");
     Fields.Double("salary").WithLabel("月薪");
     Fields.Date("birthdate").WithLabel("出生日期");
 }
Exemple #11
0
        public OrganizationModel()
            : base("core.organization")
        {
            Hierarchy = true;

            Fields.Chars("code").SetLabel("Code").SetSize(64).Required().Unique();
            Fields.Chars("name").SetLabel("Name").Required();
        }
Exemple #12
0
 public EmployeeModel()
     : base("test.employee")
 {
     Fields.Chars("name").SetLabel("Name").Required().SetSize(64);
     Fields.Integer("age").SetLabel("Age").NotRequired();
     Fields.ManyToMany("departments", "test.department_employee", "eid", "did")
     .SetLabel("Departments");
 }
 public EmployeeEntity()
     : base("test.employee")
 {
     Fields.Chars("name").WithLabel("Name").WithRequired().WithSize(64);
     Fields.Integer("age").WithLabel("Age").WithNotRequired();
     Fields.ManyToMany("departments", "test.department_employee", "eid", "did")
     .WithLabel("Departments");
 }
Exemple #14
0
 public RoleEntity() : base("core.role")
 {
     Fields.Chars("name").WithLabel("Name").WithSize(128).WithRequired();
     Fields.ManyToMany("users", "core.user_role", "role", "user").WithLabel("Users");
     Fields.ManyToMany("rules", "core.rule_role", "role", "rule").WithLabel("Rules");
     Fields.OneToMany("entity_access_entries", "core.entity_access", "role").WithLabel("Entity Access Control");
     Fields.OneToMany("field_access_entries", "core.field_access", "role").WithLabel("Field Access Control");
 }
Exemple #15
0
 public PersonModel()
     : base("test.person")
 {
     Fields.Chars("name").Required();
     Fields.Enumeration("gender", new Dictionary <string, string>()
     {
         { "male", "Male" }, { "female", "Female" }, { "unknown", "Unknown" }
     });
 }
Exemple #16
0
        public ModuleDependencyModel()
            : base(ModelName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").SetLabel("Name").Required().SetSize(128).Unique().Readonly();
            Fields.ManyToOne("module", "core.module").SetLabel("Module").Required().Readonly();
            Fields.Enumeration("state", StateOptions).SetLabel("State").Required().Readonly()
            .SetValueGetter(StateGetter);
        }
Exemple #17
0
        public TestBatManModel()
            : base("test.batman")
        {
            IsVersioned = false;
            Inherit("test.bat", "bat");

            Fields.ManyToOne("bat", "test.bat").Required()
            .OnDelete(OnDeleteAction.Cascade).SetLabel("Base Bat Model");
            Fields.Chars("real_name");
        }
Exemple #18
0
        public TestDogModel()
            : base("test.dog")
        {
            IsVersioned = false;
            Inherit("test.animal", "animal");

            Fields.ManyToOne("animal", "test.dog").Required().OnDelete(OnDeleteAction.Cascade)
            .SetLabel("Base Animal Model");
            Fields.Chars("dogfood").SetLabel("Favorite Dogfood");
        }
Exemple #19
0
        public TestCockerModel()
            : base("test.cocker")
        {
            IsVersioned = false;
            Inherit("test.dog", "dog");

            Fields.ManyToOne("dog", "test.dog").Required().OnDelete(OnDeleteAction.Cascade)
            .SetLabel("Base Animal Model");
            Fields.Chars("color").SetLabel("Color");
        }
 public FunctionalFieldEntities()
     : base(EntityName)
 {
     Fields.Chars("name").WithLabel("Name").WithRequired().WithSize(64);
     Fields.ManyToOne("user", "core.user").WithValueGetter(GetUser);
     Fields.Integer("field1").WithRequired();
     Fields.Integer("field2").WithRequired();
     Fields.Integer("sum_field").WithValueGetter(GetSum).WithReadonly()
     .WithCriterionConverter(this.ConvertSumFieldCriterion);
 }
        public ModuleDependencyEntity()
            : base(EntityName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").WithLabel("Name").WithRequired().WithSize(128).WithUnique().WithReadonly();
            Fields.ManyToOne("module", "core.module").WithLabel("Module").WithRequired().WithReadonly();
            Fields.Enumeration("state", StateOptions).WithLabel("State").WithRequired().WithReadonly()
            .WithValueGetter(StateGetter);
        }
Exemple #22
0
 public AttachmentEntity() : base("core.attachment")
 {
     Fields.Chars("name").WithLabel("Name");
     Fields.Chars("res_name").WithLabel("Related Resource");
     Fields.BigInteger("res_id").WithLabel("Related Resource ID.");
     Fields.Text("description").WithLabel("Description");
     Fields.Chars("link").WithLabel("Link");
     Fields.Binary("content").WithLabel("Content");
     Fields.ManyToOne("organization", "core.organization").WithLabel("Organization");
 }
Exemple #23
0
 public FunctionalFieldObject()
     : base(ModelName)
 {
     Fields.Chars("name").SetLabel("Name").Required().SetSize(64);
     Fields.ManyToOne("user", "core.user").SetValueGetter(GetUser);
     Fields.Integer("field1").Required();
     Fields.Integer("field2").Required();
     Fields.Integer("sum_field").SetValueGetter(GetSum).Readonly()
     .SetCriterionConverter(this.ConvertSumFieldCriterion);
 }
Exemple #24
0
        public MetaEntityEntity()
            : base(EntityName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").WithLabel("Name").WithSize(256).WithRequired().WithUnique().WithReadonly();
            Fields.Chars("label").WithLabel("Label").WithSize(256);
            Fields.Text("info").WithLabel("Information");
            Fields.Chars("module").WithLabel("Module").WithSize(128).WithRequired();
            Fields.OneToMany("fields", MetaFieldEntity.EntityName, "meta_entity").WithLabel("Fields");
        }
        public WindowActionModel()
            : base("core.action_window")
        {
            Inherit("core.action", "action");
            Fields.ManyToOne("action", "core.action")
            .SetLabel("Base Action").Required().OnDelete(OnDeleteAction.Cascade);

            Fields.Chars("model").SetLabel("Related Model").Required().SetSize(128);
            Fields.ManyToOne("view", "core.view").SetLabel("Master View");
            Fields.OneToMany("views", "core.action_window_view", "window_action").SetLabel("Views");
        }
Exemple #26
0
 public AuditLogModel()
     : base(ModelName)
 {
     Fields.ManyToOne("user", "core.user").SetLabel("User");
     Fields.Boolean("marked").SetLabel("Marked As Read")
     .Required().SetDefaultValueGetter(ctx => false);
     Fields.Chars("resource").SetLabel("Resource Name").SetSize(64).Required();
     Fields.BigInteger("resource_id").SetLabel("Resource ID").Required();
     Fields.Chars("description").SetLabel("Description")
     .Required().SetSize(256);
 }
        public ModelDataModel()
            : base(ModelName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").SetLabel("Key").Required().SetSize(128);
            Fields.Chars("module").SetLabel("Module").Required().SetSize(64);
            Fields.Chars("model").SetLabel("Model").Required().SetSize(64);
            Fields.BigInteger("ref_id").SetLabel("Referenced ID").Required();
            Fields.Text("value").SetLabel("Value");
        }
Exemple #28
0
        public ModelModel()
            : base(ModelName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").SetLabel("Name").SetSize(256).Required().Unique().Readonly();
            Fields.Chars("label").SetLabel("Label").SetSize(256);
            Fields.Text("info").SetLabel("Information");
            Fields.Chars("module").SetLabel("Module").SetSize(128).Required();
            Fields.OneToMany("fields", "core.field", "model").SetLabel("Fields");
        }
Exemple #29
0
        public EntityDataEntity()
            : base(entityName)
        {
            this.IsVersioned = false;

            Fields.Chars("name").WithLabel("Key").WithRequired().WithSize(128);
            Fields.Chars("module").WithLabel("Module").WithRequired().WithSize(64);
            Fields.Chars("entity").WithLabel("Entity").WithRequired().WithSize(64);
            Fields.BigInteger("ref_id").WithLabel("Referenced ID").WithRequired();
            Fields.Text("value").WithLabel("Value");
        }
Exemple #30
0
 public RoleModel()
     : base("core.role")
 {
     Fields.Chars("name").SetLabel("Name").SetSize(128).Required();
     Fields.ManyToMany("users", "core.user_role", "role", "user").SetLabel("Users");
     Fields.ManyToMany("rules", "core.rule_role", "role", "rule").SetLabel("Rules");
     Fields.OneToMany("model_access_entries", "core.model_access", "role")
     .SetLabel("Model Access Control");
     Fields.OneToMany("field_access_entries", "core.field_access", "role")
     .SetLabel("Field Access Control");
 }