/*
 * Author       : futrera
 * Generated on : 23-Nov-2009 00:53:40
 * Version      : 3.0
 */
application "ebusiness"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Cancun"
    section Home
    {
        form  Clientes
        {
            
            must  have  unique  RFC
            (
                type  =  text
                maxchar  =  13
            )

            must  have  Nombre
            (
                type  =  text
            )

            must  have  Correo
            (
                type  =  email
            )

            Tel_fono
            (
                displayname  =  "Teléfono"
                type  =  text
            )

            Direcci_n
            (
                displayname  =  "Dirección"
                type  =  text
            )

            Ciudad
            (
                type  =  text
            )

            must  have  Pa_s
            (
                displayname  =  "País"
                type  =  picklist
                values  =  pais.pais
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Clientes_View
        {
            displayname = "Clientes View"
            show  all  rows  from  Clientes 
            (
                RFC
                Nombre
                Correo
                Tel_fono as "Teléfono"
                Direcci_n as "Dirección"
                Ciudad
                Pa_s as "País"
            )
            filters 
            (
                Pa_s
            )
            options
            (
                display rows = 100
            )
        }

        form  pais
        {
            
            must  have  pais
            (
                type  =  text
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  pais_View
        {
            displayname = "pais View"
            show  all  rows  from  pais 
            (
                pais
            )
            options
            (
                display rows = 100
            )
        }

        grid  vista1
        {
            displayname = "vista"
            show  all  rows  from  Clientes 
            (
                RFC
                Nombre
                Correo
                Tel_fono as "Teléfono"
                Direcci_n as "Dirección"
                Ciudad
                Pa_s as "País"
            )
            filters 
            (
                Pa_s
            )
            options
            (
                display rows = 100
            )
        }

        form  productos
        {
            
            must  have  unique  Clave
            (
                type  =  text
            )

            must  have  Nombre_producto
            (
                displayname  =  "Nombre producto"
                type  =  text
            )

            must  have  Descripci_n
            (
                displayname  =  "Descripción"
                type  =  textarea
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  productos_View
        {
            displayname = "productos View"
            show  all  rows  from  productos 
            (
                Clave
                Nombre_producto as "Nombre producto"
                Descripci_n as "Descripción"
            )
            options
            (
                display rows = 100
            )
        }

        form  Pedidos
        {
            
            must  have  Cliente
            (
                type  =  picklist
                values  =  Clientes.Nombre
            )

            must  have  Producto
            (
                type  =  picklist
                values  =  productos.Nombre_producto
            )

            must  have  N_mero_de_productos
            (
                displayname  =  "Número de productos"
                type  =  number
                width  =  20
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Pedidos_View
        {
            displayname = "Pedidos View"
            show  all  rows  from  Pedidos 
            (
                Cliente
                Producto
                N_mero_de_productos as "Número de productos"
            )
            filters 
            (
                Cliente
                Producto
            )
            options
            (
                display rows = 100
            )
        }

    }

}
