/*
 * Author       : pamecruza
 * Generated on : 23-Nov-2009 01:54:55
 * 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  Telefono
            (
                type  =  text
            )

            must  have  Correo
            (
                type  =  email
            )

            Direccion
            (
                type  =  text
            )

            must  have  Ciudad
            (
                type  =  text
            )

            must  have  Pais
            (
                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
                Telefono
                Correo
                Direccion
                Ciudad
                Pais
            )
            filters 
            (
                Pais
            )
            options
            (
                display rows = 100
            )
        }

        form  pais
        {
            
            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
            )
        }

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

            must  have  Productos
            (
                type  =  text
            )

            de_Productos
            (
                displayname  =  "# de Productos"
                type  =  number
                width  =  20
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "pamecruza@yahoo.com.mx" 
                                From     :  zoho.adminuserid 
                                Subject  :  "" 
                                Message  :  "" 
                            )
                        }
                    )
                    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 
            (
                Productos
                de_Productos as "# de Productos"
                Nombre
            )
            filters 
            (
                Nombre
            )
            options
            (
                display rows = 100
            )
        }

    }

}
