Beispiel #1
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" },
            });
        }
Beispiel #2
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");
 }
Beispiel #3
0
        public PropertyEntity() : base("core.property")
        {
            Fields.Chars("name").WithSize(64).WithLabel("Name").WithRequired();
            Fields.Enumeration("type", new Dictionary <string, string>()
            {
                { "integer", "Integer" },
                { "double", "Double" },
                { "binary", "Binary" },
                { "datetime", "Date Time" },
                { "text", "Text" },
            }).WithLabel("Type").WithRequired();

            Fields.Binary("value_binary").WithNotReadonly().WithLabel("Binary Value");
            Fields.Double("value_float").WithNotReadonly().WithLabel("Double Float Value");
            Fields.BigInteger("value_integer").WithNotReadonly().WithLabel("Integer Value");
            Fields.DateTime("value_datetime").WithNotReadonly().WithLabel("Datetime Value");
            Fields.Text("value_text").WithNotReadonly().WithLabel("Text Value");
            Fields.ManyToOne("organization", "core.organization").WithLabel("Organization");
        }
Beispiel #4
0
        public TestEntity()
            : base("test.test_entity")
        {
            IsVersioned = false;

            Fields.Chars("name").WithLabel("姓名").WithSize(64).WithRequired();
            Fields.Chars("address").WithLabel("地址").WithSize(200).WithRequired();
            Fields.Integer("field1").WithLabel("数1");
            Fields.Integer("field2").WithLabel("数2");
            Fields.Integer("field3").WithLabel("数3").WithValueGetter(this.GetField3);
            Fields.BigInteger("big_int_field").WithLabel("Bit Int Field");
            Fields.Boolean("boolean_field").WithLabel("Boolean Field").WithRequired().WithDefaultValueGetter(s => true);
            Fields.Text("text_field").WithLabel("Text Field");
            Fields.Xml("xml_field").WithLabel("XML Field");
            Fields.Double("double_field").WithLabel("Double Field");
            Fields.Decimal("money_field").WithLabel("Decimal Field");
            Fields.Date("date_field").WithLabel("Date Field");
            Fields.Time("time_field").WithLabel("Time Field");
            Fields.DateTime("datetime_field").WithLabel("DateTime Field");

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

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

            Fields.Reference("reference_field").WithLabel("Reference Field").WithOptions(
                new Dictionary <string, string>()
            {
                { "test.master", "Master Entity" },
                { "test.child", "Child Entity" },
            });
        }