예제 #1
0
    private void carga_trailers()
    {
        try
        {
            ddl_id_shortrec2.Enabled = false;
            ddl_id_shortrec2.ClearSelection();
            CaractCargaBC cc = new CaractCargaBC();
            DataTable     dt = cc.obtenertrailersCompatibles(this.hf_localesSeleccionados.Value, Convert.ToInt32(this.txt_totalPallets.Text), this.hf_caractSolicitud.Value, Convert.ToInt32(this.dropsite.SelectedValue));


            this.ViewState["trailers"] = dt;
            string query = "SOLI_ID = 0";


            if (this.ddl_idShortek.SelectedIndex > 0)
            {
                query += string.Format(" AND ID_SHORTEK = '{0}'  ", this.ddl_idShortek.SelectedValue);
                DataTable dt2;
                try
                {
                    dt2 = dt.Select(query).CopyToDataTable();
                }
                catch (Exception ex3)
                {
                    ddl_id_shortrec2.Enabled = true;
                    dt2 = new DataTable();
                }

                dt = dt2;
            }
            else
            {
                DataTable dt2 = dt.Select(query).CopyToDataTable();
                dt = dt2;
            }


            try
            {
                utils.CargaDrop_patentes(this.ddl_trailers, "TRAI_ID", "TRAI_PATENTE", this.TopDataRow(dt, 20), null, "id_shortek", this.ddl_idShortek.SelectedValue);
            }
            catch (Exception)
            {
                ddl_id_shortrec2.Enabled = true;

                this.ddl_trailers.Items.Clear();
                this.ddl_trailers.Items.Add(new ListItem("No Disponibles", "0"));
            }

            this.ddl_trailers.ClearSelection();
        }
        catch (Exception ex)
        {
        }
    }