public void LLenaCombos()
        {
            //DateTime localDate = DateTime.Now;
            //Calendar1.SelectedDate = localDate;
            txt_fecha.Attributes.Add("readonly", "readonly");

            DataTable IdTecnico = new DataTable();

            IdTecnico = PreparaAcceso.BuscarIdeNomTecnicos(CadenaConexion);
            DropTecnico.DataSource     = IdTecnico;
            DropTecnico.DataValueField = "tec_rut_tec";
            DropTecnico.DataTextField  = "tec_rut_tec";
            DropTecnico.DataBind();

            //Prueba Andres
            DataTable TipoEquipo = new DataTable();

            TipoEquipo = PreparaAcceso.BuscaParametrosPorTabla(Codigo_TablasPadres.CodTipoEquipo, CadenaConexion);
            DropTipoEquipo.DataSource     = TipoEquipo;
            DropTipoEquipo.DataValueField = "PAR_COD_PAR";
            DropTipoEquipo.DataTextField  = "PAR_DES_PAR";
            DropTipoEquipo.DataBind();
            //Fin Prueba Andres
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["NroDetalle"] = 1;
                //DateTime localDate = DateTime.Now;
                //Calendar1.SelectedDate = localDate;
                txt_fecha.Attributes.Add("readonly", "readonly");
                txt_fecha.Text = DateTime.Now.ToString("dd/MM/yyyy");
                DataTable Hardware1 = new DataTable();

                Hardware1 = PreparaAcceso.BuscaParametrosPorTabla(Codigo_TablasPadres.CodTipoHardware, CadenaConexion);
                DropHardware.DataSource     = Hardware1;
                DropHardware.DataValueField = "par_cod_par";
                DropHardware.DataTextField  = "par_des_par";
                DropHardware.DataBind();
                DropHardware.SelectedValue = "-1";

                DataTable rutcliente = new DataTable();

                rutcliente = PreparaAcceso.BuscarRutNomClientes(CadenaConexion);
                DropRutCliente.DataSource     = rutcliente;
                DropRutCliente.DataValueField = "cli_rut_cli";
                DropRutCliente.DataTextField  = "cli_nom_cli";
                DropRutCliente.DataBind();
                DropRutCliente.SelectedValue = "-1";

                DataTable IdTecnico = new DataTable();

                IdTecnico = PreparaAcceso.BuscarIdeNomTecnicos(CadenaConexion);
                DropTecnico.DataSource     = IdTecnico;
                DropTecnico.DataValueField = "tec_rut_tec";
                DropTecnico.DataTextField  = "tec_Ide_tec";
                DropTecnico.DataBind();
                DropTecnico.SelectedValue = "-1";

                //Prueba Andres
                DataTable TipoEquipo = new DataTable();

                TipoEquipo = PreparaAcceso.BuscaParametrosPorTabla(Codigo_TablasPadres.CodTipoEquipo, CadenaConexion);
                DropTipoEquipo.DataSource     = TipoEquipo;
                DropTipoEquipo.DataValueField = "PAR_COD_PAR";
                DropTipoEquipo.DataTextField  = "PAR_DES_PAR";
                DropTipoEquipo.DataBind();
                DropTipoEquipo.SelectedValue = "-1";
                //Fin Prueba Andres

                DataTable lector = new DataTable();
                lector  = PreparaAcceso.BuscarNroEnsamble(CadenaConexion);
                NroHoja = lector.Rows[0][0].ToString();

                this.txtNhoja.Text  = NroHoja;
                txtNhoja.Enabled    = false;
                this.txtNumero.Text = Session["NroDetalle"].ToString();
                txtNumero.Enabled   = false;

                DataTable DT = new DataTable();
                DT.Columns.Add("Numero", Type.GetType("System.String"));
                DT.Columns.Add("Hardware", Type.GetType("System.String"));
                DT.Columns.Add("Marca", Type.GetType("System.String"));
                DT.Columns.Add("Modelo", Type.GetType("System.String"));
                DT.Columns.Add("Serie", Type.GetType("System.String"));
                DT.Columns.Add("Comentarios", Type.GetType("System.String"));

                //Guardamos la información en una variable de sesión
                Session["DT"] = DT;

                //Asignamos el DT al gridview (en este momento el DT esta vacio
                dgvDetalle.DataSource = DT;
                dgvDetalle.DataBind();
            }
        }