Пример #1
0
    protected void btnConfAgregar_Click(object sender, EventArgs e)
    {
        pnlAgregar.Visible  = false;
        pnlConsulta.Visible = true;

        double Precio;

        Precio = Double.Parse(txtPrecio.Text);
        DateTime fechaConstruccion;

        fechaConstruccion = DateTime.Parse(txtFechaConstruccion.Text);

        try
        {
            GestorProductos.agregarProducto(txtNombre.Text, Precio, comboBoxTipoProducto.SelectedIndex, fechaConstruccion);
        }
        catch (Exception ex)
        {
            //    lblMensaje.Text = ex.Message;
            MostrarMensajeCheto("No se puede agregar un nuevo registro por que ya existe un producto con ese nombre, por favor intente otro");
        }
        MostrarMensajeCheto("Registro agregado Satisfactoriamente");
        refrescarGrilla();
        txtNombre.Text = "";
    }