Exemple #1
0
        //Metodo CRUD CREATE
        public bool Agregar(ClienteBLL clienteBLL)
        {
            SqlCommand sqlCommand = new SqlCommand("INSERT INTO Cliente(Empresa, Direccion, RFC, Contacto, Giro) VALUES(@Empresa,@Direccion,@RFC,@Contacto,@Giro) "); //Creamos el comando

            sqlCommand.Parameters.Add("@Empresa", SqlDbType.VarChar).Value   = clienteBLL.Empresa;                                                                    //Agregamos los parametros
            sqlCommand.Parameters.Add("@Direccion", SqlDbType.VarChar).Value = clienteBLL.Direccion;
            sqlCommand.Parameters.Add("@RFC", SqlDbType.VarChar).Value       = clienteBLL.RFC;
            sqlCommand.Parameters.Add("@Contacto", SqlDbType.VarChar).Value  = clienteBLL.Contacto;
            sqlCommand.Parameters.Add("@Giro", SqlDbType.VarChar).Value      = clienteBLL.Giro;
            return(conexion.EjecutarComandoSinRetornoDatos(sqlCommand));//Ejecutamos el comando
            //return conexion.EjecutarComandoSinRetornoDatos("INSERT INTO Cliente(Empresa, Direccion, RFC, Contacto, Giro) VALUES('"+clienteBLL.Empresa+ "', '" + clienteBLL.Direccion + "', '" + clienteBLL.RFC + "', '" + clienteBLL.Contacto + "', '" + clienteBLL.Giro + "')");
        }
Exemple #2
0
        public bool Agregar(UsuarioBLL usuarioBLL)
        {
            SqlCommand sqlCommand = new SqlCommand("INSERT INTO Usuario(NombreUsuario, Nombre, Apellido, Cargo, Foto, Password, Permisos) VALUES(@NombreUsuario,@Nombre,@Apellido,@Cargo,@Foto,@Password,@Permisos) "); //Creamos el comando

            sqlCommand.Parameters.Add("@NombreUsuario", SqlDbType.VarChar).Value = usuarioBLL.NombreUsuario;                                                                                                            //Agregamos los parametros
            sqlCommand.Parameters.Add("@Nombre", SqlDbType.VarChar).Value        = usuarioBLL.Nombre;
            sqlCommand.Parameters.Add("@Apellido", SqlDbType.VarChar).Value      = usuarioBLL.Apellido;
            sqlCommand.Parameters.Add("@Cargo", SqlDbType.VarChar).Value         = usuarioBLL.Cargo;
            sqlCommand.Parameters.Add("@Foto", SqlDbType.Image).Value            = usuarioBLL.Foto;
            sqlCommand.Parameters.Add("@Password", SqlDbType.VarChar).Value      = usuarioBLL.Password;
            sqlCommand.Parameters.Add("@Permisos", SqlDbType.Int).Value          = usuarioBLL.Permisos;
            return(conexion.EjecutarComandoSinRetornoDatos(sqlCommand));//Ejecutamos el comando
            //return conexion.EjecutarComandoSinRetornoDatos("INSERT INTO Cliente(Empresa, Direccion, RFC, Contacto, Giro) VALUES('"+clienteBLL.Empresa+ "', '" + clienteBLL.Direccion + "', '" + clienteBLL.RFC + "', '" + clienteBLL.Contacto + "', '" + clienteBLL.Giro + "')");
        }
Exemple #3
0
        //Metodo CRUD CREATE
        public bool Agregar(UnidadBLL unidadBLL)
        {
            SqlCommand sqlCommand = new SqlCommand("INSERT INTO Unidad(placa, modelo, seguro, capacidad, numero_serie, operador, telefono) VALUES(@placa,@modelo,@seguro,@capacidad,@numero_serie,@operador,@telefono) "); //Creamos el comando

            sqlCommand.Parameters.Add("@placa", SqlDbType.VarChar).Value        = unidadBLL.Placa;                                                                                                                         //Agregamos los parametros
            sqlCommand.Parameters.Add("@modelo", SqlDbType.VarChar).Value       = unidadBLL.Modelo;
            sqlCommand.Parameters.Add("@seguro", SqlDbType.VarChar).Value       = unidadBLL.Seguro;
            sqlCommand.Parameters.Add("@capacidad", SqlDbType.VarChar).Value    = unidadBLL.Capacidad;
            sqlCommand.Parameters.Add("@numero_serie", SqlDbType.VarChar).Value = unidadBLL.numeroDeSerie;
            sqlCommand.Parameters.Add("@operador", SqlDbType.VarChar).Value     = unidadBLL.Operador;
            sqlCommand.Parameters.Add("@telefono", SqlDbType.VarChar).Value     = unidadBLL.Telefono;
            return(conexion.EjecutarComandoSinRetornoDatos(sqlCommand));//Ejecutamos el comando

            //return conexion.EjecutarComandoSinRetornoDatos("INSERT INTO Cliente(Empresa, Direccion, RFC, Contacto, Giro) VALUES('"+clienteBLL.Empresa+ "', '" + clienteBLL.Direccion + "', '" + clienteBLL.RFC + "', '" + clienteBLL.Contacto + "', '" + clienteBLL.Giro + "')");
        }
        //Metodo CRUD CREATE
        public bool Agregar(ServicioBLL servicioBLL)
        {
            //MessageBox.Show("AQUIIIIII" + servicioBLL.IDCliente + servicioBLL.IDUnidad + servicioBLL.Origen + servicioBLL.CV);


            SqlCommand sqlCommand = new SqlCommand("INSERT INTO Servicio(id_Cliente, id_Unidad, origen, cv) VALUES(@id_Cliente,@id_Unidad,@origen,@cv)");//Creamos el comando

            //sqlCommand.Parameters.Add("@id", SqlDbType.Int).Value = servicioBLL.ID;//Agregamos los parametros
            sqlCommand.Parameters.Add("@id_Cliente", SqlDbType.Int).Value = servicioBLL.IDCliente;
            sqlCommand.Parameters.Add("@id_Unidad", SqlDbType.Int).Value  = servicioBLL.IDUnidad;
            sqlCommand.Parameters.Add("@origen", SqlDbType.VarChar).Value = servicioBLL.Origen;
            sqlCommand.Parameters.Add("@cv", SqlDbType.VarChar).Value     = servicioBLL.CV;

            return(conexion.EjecutarComandoSinRetornoDatos(sqlCommand));//Ejecutamos el comando

            //return conexion.EjecutarComandoSinRetornoDatos("INSERT INTO Cliente(Empresa, Direccion, RFC, Contacto, Giro) VALUES('"+clienteBLL.Empresa+ "', '" + clienteBLL.Direccion + "', '" + clienteBLL.RFC + "', '" + clienteBLL.Contacto + "', '" + clienteBLL.Giro + "')");
        }