예제 #1
0
    protected void btnEliminar_Click(object sender, EventArgs e)
    {
        if (gwDatos.SelectedValue == null)
        {
            MostrarMensajeCheto("Seleccione una Fila antes de continuar ");

            return;
        }
        pnlConsulta.Visible      = false;
        pnlAgregar.Visible       = true;
        btnConfElim.Visible      = true;
        btnConfModificar.Visible = false;
        btnConfAgregar.Visible   = false;


        int idInsumo = (int)gwDatos.SelectedValue;

        try
        {
            IngelunEntidades.Insumo Ins = GestorInsumos.buscarPorId(idInsumo);
            txtIdInsumo.Text    = Ins.id_Insumo.ToString();
            txtDescripcion.Text = Ins.nombre;
            txtNumeroSerie.Text = Ins.numeroSerie.ToString();
            txtCosto.Text       = Ins.costo.ToString();
            txtVolumen.Text     = Ins.volumen.ToString();
            comboBoxTipoInsumo.SelectedIndex = (int)Ins.id_Tipo_Insumo;
            chBoxOrigen.Checked = Ins.esNacional;
        }
        catch (Exception ex)
        {
            lblMensaje.Visible = true;
            lblMensaje.Text    = ex.Message;
        }
        txtIdInsumo.Enabled        = false;
        txtCosto.Enabled           = false;
        txtVolumen.Enabled         = false;
        txtDescripcion.Enabled     = false;
        txtNumeroSerie.Enabled     = false;
        comboBoxTipoInsumo.Enabled = false;
        chBoxOrigen.Enabled        = false;
        btnConfElim.Visible        = true;
    }
예제 #2
0
    protected void btnSeleccionarInsumo_Click(object sender, EventArgs e)
    {
        if (gwInsumos.SelectedValue == null)
        {
            mostrarLblMensaje();
            lblMensaje.Text = "Primero Seleccione algún insumo";
            return;
        }
        ocultarLblMensaje();

        int idInsumo = (int)gwInsumos.SelectedValue;

        try
        {
            IngelunEntidades.Insumo insumo = GestorInsumos.buscarPorId(idInsumo);
            Session["idInsumo"] = insumo.id_Insumo;
            txtCosto.Text       = insumo.costo.ToString();
            txtInsumo.Text      = insumo.nombre;
        }
        catch (Exception ex)
        {
            lblMensaje.Text = ex.Message;
        }
    }