Exemplo n.º 1
0
        public bool Consultar()
        {
            DsServicioRecorridos ds = this.GetServicioRecorridosDataSet();

            if (ds == null)
            {
                return(false);
            }

            DsServicioRecorridos.DatosRow dr = ds.Datos.FindByServicioTransporteIDServicioRecorridoIDAgenciaParadaID(this.ServicioTransporteID, this.ServicioRecorridoID, this.AgenciaParadaID);
            if (dr == null)
            {
                return(false);
            }

            this.ParadaDescrip = dr.ParadaDescrip;
            this.ParadaCodigo  = dr.ParadaCodigo;
            this.ParadaOrden   = dr.ParadaOrden;
            this.MinutosEspera = dr.MinutosEspera;
            this.HoraPartida   = dr.HoraPartida;
            return(true);
        }
Exemplo n.º 2
0
        private void BindGrid(int currentPage)
        {
            try
            {
                SisPackController.AdministrarGrillas.Configurar(this.dtgParadas, "ParadaCodigo", this.CantidadOpciones);

                if (Session["dtgParadas"] == null)
                {
                    IServicioTransporte servicio = ServicioTransporteFactory.GetServicioTransporte();
                    servicio.ServicioTransporteID = Utiles.Validaciones.obtieneEntero(this.ddlServicios.SelectedValue);
                    servicio.Consultar();

                    IServicioRecorrido recorrido = ServicioRecorridoFactory.GetServicioRecorrido();
                    this.dsParadas = recorrido.GetServicioRecorridosConsultaByServicioDataSet(servicio.ServicioTransporteDescrip);
                }
                else
                {
                    this.dsParadas = (DsServicioRecorridos)Session["dtgParadas"];
                    foreach (DataGridItem item in this.dtgParadas.Items)
                    {
                        DsServicioRecorridos.DatosRow dr = (DsServicioRecorridos.DatosRow) this.dsParadas.Datos.Rows[item.DataSetIndex];

                        CheckBox chk = (CheckBox)item.FindControl("chkAsignar");
                        dr.Seleccionado = chk.Checked;
                    }
                }
                // actualizo la grilla
                Session["dtgParadas"]       = this.dsParadas;
                dtgParadas.DataSource       = this.dsParadas;
                dtgParadas.CurrentPageIndex = currentPage;
                dtgParadas.DataBind();
            }
            catch (Exception ex)
            {
                ManejaErrores(ex);
            }
        }