using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LLNet.DAL.Oracle.Idioma
{
    public partial class Idioma : LLNet.DAL.OracleDAL
    {
        public Idioma()
        {
            InitializeComponent();
            OnLoadQueries += new OnLoadQueriesEventHandler(LoadQueries);
            LoadQueries();
        }

        private void LoadQueries()
        {
            QueryMap.Add("InsertIdioma", @"INSERT INTO SFA_DICCIONARIO(ID, FRASE) VALUES (&&id&&, '&&frase&&')");
            QueryMap.Add("InsertIdiomaTraduccion", @"INSERT INTO SFA_DICCIONARIO_TRADUCCION(ID, IDIOMA) VALUES (&&id&&, '&&idioma&&')");
            QueryMap.Add("TraduccionPalabra", @"SELECT nvl(frase,'') FROM SFA_V_DICCIONARIO WHERE frase = '&&frase&&'");
            QueryMap.Add("CodigoIdioma", @"SELECT nvl(RV_LOW_VALUE,'') FROM CG_REF_CODES WHERE RV_DOMAIN = 'IDIOMA' and RV_MEANING = '&&idioma&&'");
            QueryMap.Add("ExistePalabra", @"SELECT count(frase) FROM SFA_DICCIONARIO WHERE frase = '&&frase&&'");
            QueryMap.Add("ExisteTraduccion", @"SELECT count(id) FROM SFA_V_TRADUCCION WHERE id = &&id&& and idioma = '&&idioma&&'");
            QueryMap.Add("CodigoFrase", @"SELECT id FROM SFA_DICCIONARIO WHERE frase = '&&frase&&'");
            //QueryMap.Add("Diccionario", @"select id,idioma,frase,traduccion from sfa_v_traduccion where idioma = '&&IDIOMA&&' order by frase");
        }
    }
}

