Esempio n. 1
0
        public bool agregar(MercadosBLL oMercadosBLL)
        {
            if ((oMercadosBLL.Nombre != "") & Convert.ToBoolean(Convert.ToInt32(oMercadosBLL.Tipo != -1)) & Convert.ToBoolean(Convert.ToInt32(oMercadosBLL.Provincia != 0)))
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into Mercados (Nombre, IdTipo, Telefono1, Porcentaje, Email, Web, Direccion, Localidad, Provincia) VALUES(@Nombre, @IdTipo, @Telefono1, @Porcentaje, @Email, @Web, @Direccion, @Localidad, @Provincia)");
                oleDbComando.Parameters.AddWithValue("@Nombre", SqlDbType.VarChar).Value    = oMercadosBLL.Nombre;
                oleDbComando.Parameters.AddWithValue("@IdTipo", SqlDbType.Int).Value        = oMercadosBLL.Tipo;
                oleDbComando.Parameters.AddWithValue("@Telefono1", SqlDbType.VarChar).Value = oMercadosBLL.Telefono1;
                oleDbComando.Parameters.AddWithValue("@Porcentaje", SqlDbType.Int).Value    = oMercadosBLL.Porcentaje;
                oleDbComando.Parameters.AddWithValue("@Email", SqlDbType.VarChar).Value     = oMercadosBLL.Email;
                oleDbComando.Parameters.AddWithValue("@Web", SqlDbType.VarChar).Value       = oMercadosBLL.Web;
                oleDbComando.Parameters.AddWithValue("@Direccion", SqlDbType.VarChar).Value = oMercadosBLL.Direccion;
                oleDbComando.Parameters.AddWithValue("@Localidad", SqlDbType.VarChar).Value = oMercadosBLL.Localidad;
                oleDbComando.Parameters.AddWithValue("@Provincia", SqlDbType.Int).Value     = oMercadosBLL.Provincia;

                AgregadoDialogTrue oAgregadoDialog = new AgregadoDialogTrue();
                oAgregadoDialog.ShowDialog();

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
Esempio n. 2
0
        public bool agregar(PiezasBLL oPiezasBLL)
        {
            if ((oPiezasBLL.Codigo != "") & Convert.ToBoolean(Convert.ToString(oPiezasBLL.Precio != 0)) & (oPiezasBLL.Estado != -1) & (oPiezasBLL.PiezaTipo != -1) & (oPiezasBLL.Material != 0))
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into Piezas (Codigo, Precio, PiezaTipo, Material, Detalles, Imagen, Estado, CodigoProveedor, Observaciones) VALUES ('" + oPiezasBLL.Codigo + "', '" + oPiezasBLL.Precio + "', " + oPiezasBLL.PiezaTipo + ", " + oPiezasBLL.Material + ", '" + oPiezasBLL.Detalles + "', '" + oPiezasBLL.Imagen + "'," + oPiezasBLL.Estado + ", '" + oPiezasBLL.CodigoProveedor + "', '" + oPiezasBLL.Observaciones + "')");

                AgregadoDialogTrue oAgregadoDialog = new AgregadoDialogTrue();
                oAgregadoDialog.ShowDialog();

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
Esempio n. 3
0
        //public bool agregar(MarcasBLL oMarcasBLL)
        //{
        //    SqlCommand SQLComando = new SqlCommand("Insert into Marcas VALUES(@Nombre)");
        //    SQLComando.Parameters.Add("@Nombre", SqlDbType.VarChar).Value=oMarcasBLL.Nombre;
        //    return conexion.ejecutarMetodoSinRetornoDatos(SQLComando);
        //    //return conexion.ejecutarMetodoSinRetornoDatos("INSERT INTO [dbo].[Marcas]([Nombre])VALUES('" +oMarcasBLL.Nombre +"')");
        //}

        //public DataSet mostrarMarcas()
        //{
        //    SqlCommand sentencia = new SqlCommand("Select * from Marcas order by Nombre");
        //    return conexion.ejecutarSentencia(sentencia);
        //}

        //public int eliminar(MarcasBLL oMarcasBLL)
        //{
        //    conexion.ejecutarMetodoSinRetornoDatos("DELETE FROM Marcas where Id = " +oMarcasBLL.Id);

        //    return 1;
        //}

        //public bool modificar(MarcasBLL oMarcasBLL)
        //{
        //    return conexion.ejecutarMetodoSinRetornoDatos("UPDATE MARCAS SET NOMBRE = '" +oMarcasBLL.Nombre +"' where Id =" +oMarcasBLL.Id);
        //}

        //Implementacion con ACCES
        public bool agregar(MarcasBLL oMarcasBLL)
        {
            if (oMarcasBLL.Nombre != "")
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into Marcas (Nombre) values (@Nombre)");
                oleDbComando.Parameters.AddWithValue("@Nombre", SqlDbType.VarChar).Value = oMarcasBLL.Nombre;

                AgregadoDialogTrue oAgregadoDialog = new AgregadoDialogTrue();
                oAgregadoDialog.ShowDialog();

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
Esempio n. 4
0
        public bool agregar(FacturasBLL oFacturasBLL)
        {
            if (oFacturasBLL.Cliente != -1)
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into Facturas (Numero, Cliente, ImporteTotal, FechaEmision) VALUES(" +
                                                             "'" + oFacturasBLL.Numero
                                                             + "', " + oFacturasBLL.Cliente
                                                             + ", '" + oFacturasBLL.ImporteTotal
                                                             + "', '" + DateTime.Now.Date.ToString("dd/MM/yyy") + "')");

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
Esempio n. 5
0
        public bool insertarFacturasItems(int FacturaId, int PiezaId, string PiezaCodigo, int Cantidad, string Descripcion, decimal PrecioUnitario, decimal Bonificacion, decimal ItemImporteTotal, string porcBonif)
        {
            if (FacturaId != 0)
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into FacturasItems (FacturaId, PiezaId, PiezaCodigo, Cantidad, Descripcion, PrecioUnitario, Bonificacion, ItemImporteTotal, PorcBonif) VALUES(" +
                                                             FacturaId + ", " +
                                                             +PiezaId + ", '" +
                                                             PiezaCodigo + "', " +
                                                             Cantidad + ", '" +
                                                             Descripcion + "', '" +
                                                             PrecioUnitario + "', '" +
                                                             Bonificacion + "', '" +
                                                             ItemImporteTotal + "', '" +
                                                             porcBonif + "')");

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }