public bool Agregar()
        {
            busqueda = new ServiciosBusquedaBD();
            conexion = new ConexionesBasicasAbrirCerrarBD();

            Detalleid = numero + 1;;
            Cantidad  = Int32.Parse(facturacionProducto.getCantidad());
            Precio    = 5000;
            Producto_codigoproducto = Int32.Parse(facturacionProducto.GetCodigo());
            //Codigo_Servicio = Int32.Parse(facturacionServicio.GetCodigo());
            Factura_facturaid = Int32.Parse(factura.GetNumFactura());
            try
            {
                conexion.AbrirConexion();

                cmd = new SqlCommand("insert into Multicentro.dbo.detalle (detalleid,cantidad,producto_codigoproducto, precio,factura_facturaid)" +
                                     " values('" + Detalleid + "', '" + Cantidad + "',  '" + Producto_codigoproducto + "', '" + Precio + "', '" + Factura_facturaid + "')", conexion.GetSqlConnection());
                cmd.ExecuteNonQuery();
                conexion.CerrarConexion();

                busqueda.BuscarPorCodigo(Detalleid.ToString(), facturacionProducto.GetDataView());
                MessageBox.Show("Información agregada");
                return(true);
            }

            catch (FormatException ex)
            {
                MensajesStandard.MensajeFormatoIncorrectoDatos();
                return(false);
            }
            catch (SqlException ex)
            {
                MensajesStandard.MensajeErrorGeneralBaseDatos();
                return(false);
            }
            catch (Exception ex)
            {
                MensajesStandard.MensajeGeneralExcepcionGenerica(ex);
                return(false);
            }
            return(false);
        }
        //Implementación de método de la interfaz

        /// <summary>
        /// método para agregar datos a servicios
        /// </summary>
        public bool Agregar()
        {
            busqueda = new ServiciosBusquedaBD();
            conexion = new ConexionesBasicasAbrirCerrarBD();
            Nombre   = guiServiciosIngreso.GetNombre();
            Codigo   = guiServiciosIngreso.GetCodigo();
            Precio   = guiServiciosIngreso.GetPrecio();
            try
            {
                if (VerificarInformacion())
                {
                    conexion.AbrirConexion();

                    cmd = new SqlCommand("insert into Multicentro.dbo.servicio (codigoservicio,nombre,precio)" +
                                         " values('" + int.Parse(Codigo) + "', '" + Nombre + "', '" + double.Parse(Precio) + "')", conexion.GetSqlConnection());
                    cmd.ExecuteNonQuery();
                    conexion.CerrarConexion();

                    busqueda.BuscarPorCodigo(guiServiciosIngreso.GetCodigo(), guiServiciosIngreso.GetDataView());
                    MessageBox.Show("Información agregada");
                    return(true);
                }
            }

            catch (FormatException ex)
            {
                MensajesStandard.MensajeFormatoIncorrectoDatos();
                return(false);
            }
            catch (SqlException ex)
            {
                MensajesStandard.MensajeErrorGeneralBaseDatos();
                return(false);
            }
            catch (Exception ex)
            {
                MensajesStandard.MensajeGeneralExcepcionGenerica(ex);
                return(false);
            }
            return(false);
        }