예제 #1
0
    private ArrayList loadBrokers()
    {
        ArrayList aOut = new ArrayList();

        /*
        dsComboTableAdapters.brokerPorNombreTableAdapter asTa = new dsComboTableAdapters.brokerPorNombreTableAdapter();
        dsCombo.brokerPorNombreDataTable asDt = asTa.GetData(msKeyword.Replace("'", "''"));
        */

        dsAutoCompletesTableAdapters.BrokerAutoCompleteTableAdapter brokerTa = new dsAutoCompletesTableAdapters.BrokerAutoCompleteTableAdapter();
        dsAutoCompletes.BrokerAutoCompleteDataTable brokerDt = brokerTa.GetData(msKeyword.Replace("'", "''"), this.mnNumMenuItems);

        ASBMenuItem oMenuItem;

        foreach (dsAutoCompletes.BrokerAutoCompleteRow fila in brokerDt)
        {
            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = fila.persona;
            oMenuItem.Value = fila.personaId.ToString();

            aOut.Add(oMenuItem);

        }

        return aOut;
    }
예제 #2
0
    private ArrayList loadAsegurados()
    {
        ArrayList aOut = new ArrayList();

        dsComboTableAdapters.AseguradoPorNombreTableAdapter asTa = new dsComboTableAdapters.AseguradoPorNombreTableAdapter();
        dsCombo.AseguradoPorNombreDataTable asDt = asTa.GetData(msKeyword.Replace("'", "''"));

        ASBMenuItem oMenuItem;

        foreach (dsCombo.AseguradoPorNombreRow fila in asDt)
        {
            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = fila.persona;
            oMenuItem.Value = fila.personaid.ToString();

            aOut.Add(oMenuItem);

        }

        return aOut;
    }
예제 #3
0
    /// <summary>Get all cities that contain specified keyword</summary>
    /// <param name="sKeyword">Keyword to use in a query</param>
    /// <returns></returns>
    private ArrayList LoadCities()
    {
        ArrayList aOut = new ArrayList();

        string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\databases\\AutoSuggestBox_Demo.mdb;User Id=admin;Password=;";
        OleDbConnection oCn = new OleDbConnection(sConnString);

        //Return only specified number of results plus one more
        //Need one more to see if there are more results to display 'more' menu item
        string sSql = "SELECT TOP " + (mnNumMenuItems + 1) + " tblCity.Name as CityName, " +
            "tblCity.Code as CityCode, " +
            "tblCountry.Name as CountryName, " +
            "tblState.Name as StateName " +
            " FROM (tblCity INNER JOIN tblCountry ON tblCity.CountryID=tblCountry.ID) " +
            "		LEFT OUTER JOIN tblState ON tblCity.StateID=tblState.ID " +
            " WHERE (tblCity.Name LIKE '" + msKeyword.Replace("'", "''") + "%') " +
            " ORDER BY tblCity.Name";

        OleDbCommand oCmd = new OleDbCommand(sSql, oCn);
        oCn.Open();

        OleDbDataReader oReader = oCmd.ExecuteReader();

        string sCity;
        string sCityCode;
        string sState;
        string sCountry;

        string sLabel;

        ASBMenuItem oMenuItem;

        while (oReader.Read())
        {
            //Build label using City, Country & State
            sCity = oReader.GetString(0);
            sCityCode = oReader.GetString(1);
            sCountry = oReader.GetString(2);

            if (oReader.GetValue(3) == System.DBNull.Value)
                sState = "";
            else
                sState = oReader.GetString(3);

            sLabel = sCity;

            //Append either city or country
            if (sState != "")
                sLabel += ", " + sState;
            else
                sLabel += ", " + sCountry;

            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = sLabel;
            oMenuItem.Value = sCityCode;

            aOut.Add(oMenuItem);
        }

        oReader.Close();
        oCn.Close();

        return aOut;
    }
예제 #4
0
    private ArrayList loadUbigeo()
    {
        ArrayList aOut = new ArrayList();

        dsUbigeoTableAdapters.UBIGEOTableAdapter ubigeoTA = new dsUbigeoTableAdapters.UBIGEOTableAdapter();
        dsUbigeo.UBIGEODataTable ubigeoDataTable = ubigeoTA.GetData( msKeyword.Replace("'", "''"));

        ASBMenuItem oMenuItem;

        foreach (dsUbigeo.UBIGEORow distrito in ubigeoDataTable)
        {
            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = distrito.ubigeo;
            oMenuItem.Value = distrito.ubigeoId;

            aOut.Add(oMenuItem);

        }

        return aOut;
    }
예제 #5
0
    private ArrayList loadTipoActividad()
    {
        ArrayList aOut = new ArrayList();

        /*
        dsUbigeoTableAdapters.UBIGEOTableAdapter ubigeoTA = new dsUbigeoTableAdapters.UBIGEOTableAdapter();
        dsUbigeo.UBIGEODataTable ubigeoDataTable = ubigeoTA.GetData(msKeyword.Replace("'", "''"));
        */

        dsTipoActividadTableAdapters.TipoActividadTableAdapter tipoActividadTA = new dsTipoActividadTableAdapters.TipoActividadTableAdapter();
        dsTipoActividad.TipoActividadDataTable tipoActividadDT = tipoActividadTA.GetData(msKeyword.Replace("'","''"));

        ASBMenuItem oMenuItem;

        foreach (dsTipoActividad.TipoActividadRow tipoActividadRow in tipoActividadDT)
        {
            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = tipoActividadRow.TipoActividad;
            oMenuItem.Value = tipoActividadRow.tipoActividadId.ToString();

            aOut.Add(oMenuItem);

        }

        return aOut;
    }
예제 #6
0
    private ArrayList loadEjecutivos()
    {
        ArrayList aOut = new ArrayList();

        if (this.msFilters[0] == "-1")
        {
            ASBMenuItem oMenuItem;
            oMenuItem = new ASBMenuItem();
            oMenuItem.Label = "Debe elegir una Aseguradora primero";
            oMenuItem.Value = "";
            oMenuItem.IsSelectable = false;
            aOut.Add(oMenuItem);
        }
        else
        {
            /*
            dsComboTableAdapters.brokerPorNombreTableAdapter asTa = new dsComboTableAdapters.brokerPorNombreTableAdapter();
            dsCombo.brokerPorNombreDataTable asDt = asTa.GetData(msKeyword.Replace("'", "''"));
            */

            dsAutoCompletesTableAdapters.EjecutivoAutoCompleteTableAdapter EjecutivoTa = new dsAutoCompletesTableAdapters.EjecutivoAutoCompleteTableAdapter();
            dsAutoCompletes.EjecutivoAutoCompleteDataTable EjecutivoDt = EjecutivoTa.GetData(msKeyword.Replace("'", "''"), Convert.ToDecimal(this.msFilters[0]), this.mnNumMenuItems);

            ASBMenuItem oMenuItem;

            foreach (dsAutoCompletes.EjecutivoAutoCompleteRow fila in EjecutivoDt)
            {
                oMenuItem = new ASBMenuItem();
                oMenuItem.Label = fila.persona;
                oMenuItem.Value = fila.personaId.ToString();

                aOut.Add(oMenuItem);

            }
        }
        return aOut;
    }
예제 #7
0
    private ArrayList loadCompanias()
    {
        ArrayList aOut = new ArrayList();

          dsAutoCompletesTableAdapters.companiasAutoCompleteByPersonNameTableAdapter companiasTa = new dsAutoCompletesTableAdapters.companiasAutoCompleteByPersonNameTableAdapter();
          dsAutoCompletes.companiasAutoCompleteByPersonNameDataTable companiasDt = companiasTa.GetData(msKeyword.Replace("'", "''"));

          ASBMenuItem oMenuItem;

          foreach (dsAutoCompletes.companiasAutoCompleteByPersonNameRow fila in companiasDt)
          {
        oMenuItem = new ASBMenuItem();
        oMenuItem.Label = fila.persona;
        oMenuItem.Value = fila.personaId.ToString();

        aOut.Add(oMenuItem);

          }

          return aOut;
    }