Entity
Entity
webpart = Entity( caption = "WebParts", name = "webpart", schema="dbo", table = "webpart");
webpart.addCol(name = "UsuarioId", caption = "Usuario", type = "ref", isnull = "False", ref_schema="dbo", ref_table="Users", ref_col="Nombre");
webpart.addCol(name = "Name", caption = "Nombre", type = "nvarchar", isnull = "False");
webpart.addCol(name = "Version", caption = "Version", type = "nvarchar", isnull = "False");
webpart.addCol(name = "Archivo", caption = "Archivo Zip", type = "file", isnull = "False");
webpart.webPart(name="mvc-net8-list");
webpart = Entity( caption = "WebParts", name = "webpart", schema="dbo", table = "webpart", rol = "Admin");
Parametros
- name
- caption
- schema
- table
- rol
Función addCol
webpart.addCol(name = "UsuarioId", caption = "Usuario", type = "ref", isnull = "false", ref_schema="dbo", ref_table="Users", ref_col="Nombre");
webpart.addCol(name = "Name", caption = "Nombre", type = "nvarchar", isnull = "false");
Parametros
- name
- caption
- type
- default
- isnull
- format
- ref_schema
- ref_table
- ref_col
- options
- filter
- multiple
- html
- sql
webpart.addCol(name = "Name", caption = "Nombre", type = "nvarchar", isnull = "false", default = "");
Tipos de datos
- nvarchar
- text
- int
- decimal
- datetime
- bool
Informe de Laboratorio
| Prueba | Resultado | Unidad | Rango Normal |
|---|---|---|---|
| Glucosa | 110 | mg/dL | 70 - 100 |
| Colesterol total | 220 | mg/dL | < 200 |
| TGP | 65 | U/L | 10 - 40 |
⚠️ Valores fuera de rango.
webpart.addCol(name = "Name", caption = "Nombre", type = "nvarchar", isnull = "false", default = "");
webpart.addCol(name = "Email", caption = "Email", type = "nvarchar", isnull = "false", default = "", sql="unique");
webpart.addCol(name = "content", caption = "Content", type = "ntext", isnull = "false", default = "", html = "summernote");
webpart.addCol(name = "Numero", caption = "Número", type = "int", isnull = "false", default = "0");
webpart.addCol(name = "Moneda", caption = "Moneda", type = "decimal", isnull = "false", default = "0.0", format = "#.00", html = "$" );
webpart.addCol(name = "Fecha", caption = "Fecha", type = "datetime", isnull = "false", format = "dd/MM/yyyy" );
webpart.addCol(name = "Habilitado", caption = "Habilitado", type = "bool", isnull = "false", default ="true" );
Tipos de datos compuestos
- ref
- imagen
- file
- menu
webpart.addCol(name = "UsuarioId", caption = "Usuario", type = "ref", isnull = "false", ref_schema="dbo", ref_table="Users", ref_col="Nombre");
webpart.addCol(name = "Imagen", caption = "Imagen", type = "imagen", isnull = "false", filter = "png", multiple = "false");
webpart.addCol(name = "Doc", caption = "Documeto Word", type = "file", isnull = "false", filter = "doc, docx", multiple = "false");
webpart.addCol(name = "Estado", caption = "Estados", type = "menu", isnull = "false", options = "En Proceso, Terminado, Cancelado" );
Función webPart
webpart.webPart(name="mvc-net8-list");
factura.webPart(name="mvc-net8-list", aggregation = "detail");
cliente.webPart(name="mvc-net8-list", composition = "direcion");
Parametros
- name
- aggregation: se crea a la vez
- composition: se pueden crear la composition despues