private void BindGrid()
        {
            SisPackController.AdministrarGrillas.Configurar(this.dtgChoferes, "ChoferID", this.CantidadOpciones);
            try
            {
                IChofer  chofer = ChoferFactory.GetChofer();
                DsChofer ds     = chofer.GetChoferesDataSet();

                string legajo = this.txtLegajo.Text;
                string nombre = this.txtNombre.Text;

                string filtroEspecial = this.txtFiltro.Text;
                string agenciaActual  = this.txtAgenciaActual.Text;
                string filtro         = "LegajoSITT LIKE '" + legajo + "%' AND Nombre LIKE '" + nombre + "%'";

                DsChofer.DatosRow[] drLista = (DsChofer.DatosRow[])ds.Datos.Select(filtro);

                dtgChoferes.DataSource = drLista;
                dtgChoferes.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void BindGrid(int currentPage)
        {
            //espacio de llenado de la grilla
            try
            {
                //creamos una instancia del chofer
                IChofer chofer = ChoferFactory.GetChofer();
                chofer.ChoferEmpresaSITT = "TAQ";
                chofer.LegajoSITT        = this.txtLegajo.Text;
                chofer.Nombre            = this.txtNombre.Text;
                chofer.Apellido          = this.txtApellido.Text;
                chofer.UnidadNegocioID   = 1;

                AdministrarGrillas.Configurar(dtgChoferes, "ChoferID", CantidadOpciones, true, false);
                dtgChoferes.DataSource       = chofer.GetChoferesDataSet();
                dtgChoferes.CurrentPageIndex = currentPage;
                //this.dtgChoferes.ShowFooter = true;
                this.dtgChoferes.PageSize = 50;

                dtgChoferes.DataBind();
            }
            catch (Exception ex)
            {
                ((ErrorWeb)phErrores.Controls[0]).setMensaje(ex.Message);
            }
        }
        private void CargarCombos()
        {
            IChofer  _chofer     = ChoferFactory.GetChofer();
            DsChofer lstChoferes = _chofer.GetChoferesDataSet();

            //ddlNuevoChofer.DataSource = lstChoferes;
            //ddlNuevoChofer.DataValueField = "ChoferID";
            //ddlNuevoChofer.DataTextField = "Nombre";
            //ddlNuevoChofer.DataBind();

            //ddlNuevoGuarda.DataSource = lstChoferes;
            //ddlNuevoGuarda.DataValueField = "ChoferID";
            //ddlNuevoGuarda.DataTextField = "Nombre";
            //ddlNuevoGuarda.DataBind();

            // Diego 18/03/2015 se saca el servicio
            //IAgenciaParada agenciaP = AgenciaParadaFactory.GetAgenciaParada();
            //agenciaP.UnidadNegocioID = UnidadNegocioID;
            //DsAgenciaParada lstParadas = agenciaP.GetAgenciasParadasSELDataSet(-1); // Se pasa -1, por que quiero que me traiga las paradas de todas las agencias

            //ddlOrigen.DataSource = lstParadas;
            //ddlOrigen.DataTextField = "ParadaDescrip";
            //ddlOrigen.DataValueField = "ParadaCodigo";
            //ddlOrigen.DataBind();
            //ddlOrigen.Items.Insert(0, new ListItem("", string.Empty));

            //ddlDestino.DataSource = lstParadas;
            //ddlDestino.DataTextField = "ParadaDescrip";
            //ddlDestino.DataValueField = "ParadaCodigo";
            //ddlDestino.DataBind();
            //ddlDestino.Items.Insert(0, new ListItem("", string.Empty));
        }
Beispiel #4
0
        private void Buscar()
        {
            int total = 0;

            try
            {
                IChofer  chofer = ChoferFactory.GetChofer();
                DsChofer ds     = chofer.GetChoferesDataSet();

                string filtro = "LegajoSITT LIKE '" + this.legajo + "%' AND Nombre LIKE '" + this.nombre + "%'";
                DsChofer.DatosRow[] drLista = (DsChofer.DatosRow[])ds.Datos.Select(filtro);
                total = drLista.Length;

                if (total > 0)
                {
                    if (total == 1)
                    {
                        DsChofer.DatosRow dr = drLista[0];
                        this.txtLegajo.Text   = dr.LegajoSITT;
                        this.txtNombre.Text   = dr.Nombre;
                        this.txtChoferID.Text = dr.ChoferID.ToString();

                        this.txtErrorMsg.Text    = "";
                        this.txtOpen.Text        = "";
                        this.txtSoloLectura.Text = this.soloLectura;
                    }
                    else
                    {
                        this.txtLegajo.Text = this.legajo;
                        this.txtNombre.Text = this.nombre;

                        this.txtOpen.Text          = "S";
                        this.txtFiltro.Text        = this.filtroEspecial;
                        this.txtAgenciaActual.Text = this.agenciaActual;
                        this.txtSoloLectura.Text   = this.soloLectura;
                    }
                }
                else
                {
                    this.txtLegajo.Text      = "";
                    this.txtChoferID.Text    = "";
                    this.txtErrorMsg.Text    = "No se encontraron datos.";
                    this.txtOpen.Text        = "";
                    this.txtSoloLectura.Text = this.soloLectura;
                }
            }
            catch (Exception ex)
            {
                this.txtErrorMsg.Text = "Error al consultar datos de agencias: " + ex.Message;
            }
        }