コード例 #1
0
        public DataTable ListarVehiculo(BEVehiculo objEVehiculo)
        {
            DataTable dt = new DataTable();
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`ListarVehiculo`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEVehiculo.ID_Vehiculo, ParameterDirection.Input, System.Data.DbType.String));
            conn.Open();
            IDataReader dr = command.ExecuteReader();
            dt.Load(dr);
            conn.Close();
            return dt;
        }
コード例 #2
0
        public Object MantenimientoVehiculo(string ACCION, BEVehiculo objEVehiculo)
        {
            DataTable dt = new DataTable();
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`MantenimientoVehiculo`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEVehiculo.ID_Vehiculo, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_IDCliente", objEVehiculo.ID_Cliente, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Placa", objEVehiculo.Placa, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Color", objEVehiculo.Color, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Marca", objEVehiculo.Marca, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_Kilometraje", objEVehiculo.Kilometraje, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Nro_Serie", objEVehiculo.Nro_Serie, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Nro_Motor", objEVehiculo.Nro_Motor, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Anio", objEVehiculo.Anio, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("ACCION", ACCION, ParameterDirection.Input, System.Data.DbType.String));

            conn.Open();

            try
            {
                if (ACCION.Equals("AGREGAR") || ACCION.Equals("MODIFICAR"))
                {
                    command.ExecuteNonQuery();
                    return "Exito";
                }
                else
                {
                    IDataReader dr = command.ExecuteReader();
                    dt.Load(dr);
                    return dt;
                }
            }
            catch (Exception e)
            {
                throw new Exception("Error interno", e);
            }
            finally
            {
                conn.Close();
            }
        }
コード例 #3
0
 public void ActualizaVehiculo(BEVehiculo objEVehiculo)
 {
     objVehiculo.ActualizaVehiculo(objEVehiculo);
 }
コード例 #4
0
 public DataTable ListarVehiculo(BEVehiculo objEVehiculo)
 {
     return objVehiculo.ListarVehiculo(objEVehiculo);
 }
コード例 #5
0
 public Object MantenimientoVehiculo(string ACCION, BEVehiculo objEVehiculo)
 {
     return objVehiculo.MantenimientoVehiculo(ACCION, objEVehiculo);
 }
コード例 #6
0
 public DataTable ConsultarVehiculo(BEVehiculo objEVehiculo)
 {
     return objVehiculo.ConsultarVehiculo(objEVehiculo);
 }
コード例 #7
0
        public void ActualizaVehiculo(BEVehiculo objEVehiculo)
        {
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`ActualizaVehiculo`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEVehiculo.ID_Vehiculo, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_IDCliente", objEVehiculo.ID_Cliente, ParameterDirection.Input, System.Data.DbType.String));

            conn.Open();

            command.ExecuteNonQuery();
            conn.Close();
        }