Ayuda con proyecto

Moderador: raul338

C#, tambien llamado C Sharp

Notapor Vicitor2006 » Mar Jun 12, 2007 9:26 pm

Los listados son como que lo ultimo en todo el proceso

Primero hay que dar de alta los libros

Luego hay que dar de alta los usuarios

Luego hay que prestar los libros

Y despues ya aparecen los listados

como ves no me puedo saltar hasta alla.

Aun falta mucho.
Estoy aki para aprender
Imagen
Avatar de Usuario
Vicitor2006
Usuario Muy Activo
Usuario Muy Activo
 
Mensajes: 127
Registrado: Mié May 23, 2007 11:38 am


:::::::::::

Notapor CHARLY18 » Mar Jun 12, 2007 9:31 pm

OYES COMO CUANTO TIEMPO CREES KE TE LLEVE?, DE TODOS MODOS YO LE ESTOY AVANZANDO LO MAS KE PUEDO
CHARLY18
Usuario Activo
Usuario Activo
 
Mensajes: 46
Registrado: Mié Jun 06, 2007 6:50 pm


Notapor Vicitor2006 » Mar Jun 12, 2007 9:41 pm

Si me va a llevar tiempo, pero ya le hice algunas modificaciones menores al codigo observalo, de todos modos, no deverias confiarte de mi demasiado

Código: Seleccionar todo
  1.  

  2.  

  3. using System;

  4. using System.IO;

  5.  

  6. namespace PROYECTO

  7. {

  8.     /// <summary>

  9.     ///  Aqui es donde inicia el namespace

  10.     /// </summary>

  11.     public class Program

  12.     {

  13.         /// <summary>

  14.         ///  Aqui es donde inicia la clase Program

  15.         /// </summary>

  16.         public class Usuario

  17.         {

  18.             /// <summary>

  19.             ///  Aqui es donde inicia la subclase Usuario

  20.             /// </summary>

  21.             public string Nombre = "";

  22.             public bool Valido = true;

  23.             public bool Alta = true;

  24.             public bool Deudor = false;

  25.             public int TP = 0; // Total de Prestamos

  26.             public int LPA = 0; // Libros Prestaos Ahora

  27.             public string Concatenar()

  28.             {

  29.                 // Aqui es donde inicia el funcion Concatenar de la subclase Usuario

  30.                 string unir = "";

  31.                 unir += Nombre + "@";

  32.                 unir += Valido.ToString() + "@";

  33.                 unir += TP.ToString() + "@";// Total de Prestamos

  34.                 unir += LPA.ToString() + "@";// Libros Prestados Ahora

  35.                 return unir;

  36.                 // Aqui es donde termina la funcion Concatenar de la subclase Usuario

  37.             }

  38.         }

  39.  

  40.         public class Libro

  41.         {

  42.             /// <summary>

  43.             ///  Aqui es donde inicia la subclase Libro

  44.             /// </summary>

  45.             public string Titulo = "";

  46.             public string Autor = "";

  47.             public string Pais = "";

  48.             public string Editorial = "";

  49.             public string Year = "";

  50.             public string Edicion = "";

  51.             public string Asignatura = "";

  52.             public int Cantidad = 0;

  53.             public int Disponibilidad = 0;

  54.             public int Total_Prestamos = 0;

  55.             public int LPA = 0;// Libros Prestados Ahora

  56.             public bool Baja_baja = true;

  57.             public string Concatenar()

  58.             {

  59.                 // Aqui inicia la funcion Concatenar de la subclase Libro

  60.                 string cadena = "";

  61.                 cadena += Titulo + "@";// 0

  62.                 cadena += Autor + "@";// 1

  63.                 cadena += Pais + "@";// 2

  64.                 cadena += Editorial + "@";// 3

  65.                 cadena += Year + "@";// 4

  66.                 cadena += Edicion + "@";// 5

  67.                 cadena += Asignatura + "@";// 6

  68.                 cadena += Cantidad.ToString() + "@";// 7

  69.                 cadena += Disponibilidad.ToString() + "@";// 8

  70.                 cadena += Total_Prestamos.ToString() + "@";// 9

  71.                 cadena += LPA.ToString() + "@";

  72.                 cadena += Baja_baja + "@";

  73.                 return cadena;

  74.                 // Aqui termina la funcion Concatenar de la subclase Libro

  75.             }

  76.             // Aqui termina la calse Libro

  77.         }

  78.  

  79.         static Usuario Creacion_Usuarios()

  80.         {

  81.             Usuario user1 = new Usuario();

  82.             Console.WriteLine("Ha seleccionado la opcion 0 : CREACION DE USUARIOS");

  83.             Console.WriteLine("¿Cual es el nombre del nuevo usuario?");

  84.             user1.Nombre = Console.ReadLine();

  85.             Console.WriteLine("Usuario creado con exito");

  86.             return user1;

  87.         }

  88.  

  89.         static void Consultas(string[] books)

  90.         {

  91.             Console.WriteLine("Ha selecionado la opcion 1 : CONSULTAS");

  92.         }

  93.  

  94.         static Libro Alta_Libros()

  95.         {

  96.             // Aqui inicia la funcion Alta_Libros

  97.             Console.WriteLine("Ha selecionado la opcion 2 : ALTAS DE LIBROS");

  98.             Libro libro1 = new Libro();

  99.             Console.WriteLine("¿Cual es el Titulo del libro?");

  100.             libro1.Titulo = Console.ReadLine();

  101.             Console.WriteLine("¿Quien es el autor del libro?");

  102.             libro1.Autor = Console.ReadLine();

  103.             Console.WriteLine("¿De que pais es el libro?");

  104.             libro1.Pais = Console.ReadLine();

  105.             Console.WriteLine("¿Cual es la editorial del libro?");

  106.             libro1.Editorial = Console.ReadLine();

  107.             Console.WriteLine("¿En que año fue escrito el libro?");

  108.             libro1.Year = Console.ReadLine();

  109.             Console.WriteLine("¿Que edicion es el libro?");

  110.             libro1.Edicion = Console.ReadLine();

  111.             Console.WriteLine("¿A que asignatura va dedicado el libro?");

  112.             libro1.Edicion = Console.ReadLine();

  113.             Console.WriteLine();

  114.             Console.WriteLine("Los siguientes datos deberan ser numeros");

  115.             Console.WriteLine("¿Cuantos libros son?");

  116.             libro1.Cantidad = int.Parse(Console.ReadLine());

  117.             Console.WriteLine("El libro fue dado de alta");

  118.             return libro1;

  119.             // Aqui termina la funcion Alta_Libros

  120.         }

  121.  

  122.         static void Baja_Libros(string[] books)

  123.         {

  124.             Console.WriteLine("Ha selecionado la opcion 3 : BAJAS DE LIBORS");

  125.         }

  126.  

  127.         static void Modificaciones_Libros(string[] books)

  128.         {

  129.             Console.WriteLine("Ha selecionado la opcion 4 : MODIFICACIONES DE LIBROS");

  130.         }

  131.  

  132.         static void Modificaciones_Usuarios(string[] users)

  133.         {

  134.             Console.WriteLine("Ha selecionado la opcion 5 : MODIFICACIONES DE USUARIOS");

  135.         }

  136.  

  137.         static void Libros_mas_pedidos(string[] books)

  138.         {

  139.             Console.WriteLine("Ha selecionado la opcion 6 : LISTA DE LIBROS MAS PEDIDOS");

  140.         }

  141.  

  142.         static void Usuarios_pedidores(string[] users)

  143.         {

  144.             Console.WriteLine("Ha selecionado la opcion 7 : LISTA DE USUARIOS PEDIGEÑOS");

  145.         }

  146.  

  147.         static void libros_prestados(string[] books)

  148.         {

  149.             Console.WriteLine("Ha seleccionado la opcion 8 : LISRA DE LIBROS PRESTADOS POR USUARIO");

  150.         }

  151.  

  152.         static void Usuarios_Deudores(string[] users)

  153.         {

  154.             Console.WriteLine("Ha seleccionado la opcion 9 : LISTA DE USUARIOS DEUDORES");

  155.         }

  156.  

  157.         static void Usuarios_Invalidos(string[] users)

  158.         {

  159.             Console.WriteLine("Ha seleccionado la opcion 10 : LISTA DE USUARIOS INVALIDOS");

  160.         }

  161.  

  162.         static void Baja_Usuarios(string[] users)

  163.         {

  164.             Console.WriteLine("Ha seleccionado la opcion 11 : BAJA DE USUARIOS");

  165.         }

  166.  

  167.         static void Alta_Prestamo(string[] books,string[] users)

  168.         {

  169.             Console.WriteLine("Ha seleccionado la opcion 12 : ALTA DE PRESTAMOS");

  170.         }

  171.  

  172.         static void Baja_Prestamo(string[] books, string[] users)

  173.         {

  174.             Console.WriteLine("Ha seleccionado la opcion 13 : BAJA DE PRESTAMOS");

  175.         }

  176.  

  177.         static int Menu()

  178.         {

  179.             // Aqui es donde inicia la funcion menu

  180.             int menubiblioteca = 1;

  181.             Console.Clear();

  182.             Console.WriteLine(" **************************************** ");

  183.             Console.WriteLine(" *               U V M                  * ");

  184.             Console.WriteLine(" **************************************** ");

  185.             Console.WriteLine("\n\tUniversidad del Valle de Mexico *");

  186.             Console.WriteLine("\n\tCampus: Hispano *");

  187.             Console.WriteLine("\n\tPORTICO *");

  188.             Console.WriteLine("****************************************");

  189.             Console.WriteLine();

  190.             Console.WriteLine("0.  CREACION DE USUARIOS");

  191.             Console.WriteLine("1.  CONSULTA [BUSQUEDA] DE LIBROS");

  192.             Console.WriteLine("2.  REGISTRAR UN LIBRO");

  193.             Console.WriteLine("3.  DAR DE BAJA UN LIBRO");

  194.             Console.WriteLine("4.  CAMBIAR LOS DATOS DE UN LIBRO");

  195.             Console.WriteLine("5.  CAMBIAR LOS DATOS DE UN USUARIO");

  196.             Console.WriteLine();

  197.             Console.WriteLine("6.  LISTA DE LIBROS MAS PEDIDOS");

  198.             Console.WriteLine("7.  LISTA DE USUARIOS PEDIGEÑOS");

  199.             Console.WriteLine("8.  LISTA DE LIBROS PRESTADOS POR USUARIO");

  200.             Console.WriteLine("9.  LISTA DE USUARIOS DEUDORES");

  201.             Console.WriteLine("10. LISTA DE USUARIOS INVALIDOS");

  202.             Console.WriteLine();

  203.             Console.WriteLine("11. BAJA DE USUARIOS");

  204.             Console.WriteLine("12. SE HISO UN PRESTAMO");

  205.             Console.WriteLine("13. SE HISO UNA DEVOLUCION");

  206.             Console.WriteLine("14. SALIR");

  207.             Console.WriteLine();

  208.             Console.Write("Oprima el Numero de la Aplicacion Deseada:");

  209.             menubiblioteca = int.Parse(Console.ReadLine());

  210.             return menubiblioteca;

  211.             // Aqui es donde termina la funcion Menu

  212.         }

  213.  

  214.         static void Main(string[] args)

  215.         {

  216.             // Aqui es donde inicia el metodo Main

  217.             bool salir = false;

  218.             int index = 0;

  219.             int indice = 0;

  220.             string[] books = new string[1000];

  221.             string[] users = new string[100];

  222.             books[0] = "El Ingenioso Hidalgo Don Quijote de la ManchAa" + "@";// Titulo

  223.             books[0] += "Miguel de Cervantes Saabedra" + "@";// Autor

  224.             books[0] += "Mexico" + "@"; // Pais

  225.             books[0] += "Porrua" + "@"; // Editorial

  226.             books[0] += "1707" + "@";   // Year

  227.             books[0] += "Segunda" + "@";// Edicion

  228.             books[0] += "Español" + "@";// Asignatura

  229.             books[0] += "10" + "@";     // Cantidad

  230.             books[0] += "10" + "@";     // Disponibilidad

  231.             books[0] += "0";            // Total de prestamos

  232.             /*-----------------------------------------*/

  233.             users[0] = "Azucena";// Nombre

  234.             users[0] += "true";  // Valido

  235.             users[0] += "0";     // Total de Prestamos

  236.             users[0] += "0";     // Libros Prestados Ahora

  237.             while (salir != true)

  238.             {

  239.                 // Aqui es donde incia el While

  240.                 int menubiblioteca = Menu();

  241.                 switch (menubiblioteca)

  242.                 {

  243.                     // Aqui es donde inicia el Switch

  244.                     case 0:

  245.                         users[indice] = Creacion_Usuarios().Concatenar();

  246.                         indice++;

  247.                         break;

  248.                     case 1:

  249.                         Consultas(books);

  250.                         break;

  251.                     case 2:

  252.                         books[index] = Alta_Libros().Concatenar();

  253.                         index++;

  254.                         break;

  255.                     case 3:

  256.                         Baja_Libros(books);

  257.                         break;

  258.                     case 4:

  259.                         Modificaciones_Libros(books);

  260.                         break;

  261.                     case 5:

  262.                         Modificaciones_Usuarios(users);

  263.                         break;

  264.                     case 6:

  265.                         Libros_mas_pedidos(books);

  266.                         break;

  267.                     case 7:

  268.                         Usuarios_pedidores(users);

  269.                         break;

  270.                     case 8:

  271.                         Libros_mas_pedidos(books);

  272.                         break;

  273.                     case 9:

  274.                         Usuarios_Deudores(users);

  275.                         break;

  276.                     case 10:

  277.                         Usuarios_Invalidos(users);

  278.                         break;

  279.                     case 11:

  280.                         Baja_Usuarios(users);

  281.                         break;

  282.                     case 12:

  283.                         Alta_Prestamo(books,users);

  284.                         break;

  285.                     case 13:

  286.                         Baja_Prestamo(books,users);

  287.                         break;

  288.                     case 14:

  289.                         Console.WriteLine("Ha selecionado la opcion 7 Salir");

  290.                         salir = true;

  291.                         break;

  292.                     default:

  293.                         Console.WriteLine("No ha selecionado una opcion valida");

  294.                         break;

  295.                     // Aqui es donde termina el case

  296.                 }

  297.                 // Aqui es donde termina el While

  298.             }

  299.             // Aqui es donde termina el metodo Main

  300.         }

  301.         // Aqui es donde termina la calse Program

  302.     }

  303.     // Aqui es donde termina el namespace

  304. }

  305.  

  306.  

Estoy aki para aprender
Imagen
Avatar de Usuario
Vicitor2006
Usuario Muy Activo
Usuario Muy Activo
 
Mensajes: 127
Registrado: Mié May 23, 2007 11:38 am

::::::

Notapor CHARLY18 » Mar Jun 12, 2007 9:44 pm

NO MECONFIO PUES TAMBIENE ESTADO INVESTIGANDO DE COMO PONERLE MAS COASAS AL PROGRAMA PERO TE AGRADESCO KE ME AYUDES
CHARLY18
Usuario Activo
Usuario Activo
 
Mensajes: 46
Registrado: Mié Jun 06, 2007 6:50 pm

::::::

Notapor CHARLY18 » Mié Jun 13, 2007 6:40 pm

OYES ME PODRIAS CHECAR ESTE CODIGO ES KE NO ME CORRE FUE EL KE MEPUSISTE PERO NO SE KE ESTE MAL
static class SplitTest
{
static void Usuarios_pedidores()
{
Console.WriteLine("Ha selecionado la opcion 7 : LISTA DE USUARIOS PEDIGEÑOS");
string[] NOMBRES = new string[1000];


string[] split = NOMBRES.Split(new Char[] { ' ', ',', '.', ':' });

foreach (string s in split)
{

if (s.Trim() != "")
Console.WriteLine(s);
Console.ReadLine();

}
}
CHARLY18
Usuario Activo
Usuario Activo
 
Mensajes: 46
Registrado: Mié Jun 06, 2007 6:50 pm

Re: ::::::

Notapor Vicitor2006 » Vie Jun 15, 2007 12:36 pm

CHARLY18 escribió:OYES ME PODRIAS CHECAR ESTE CODIGO ES KE NO ME CORRE FUE EL KE MEPUSISTE PERO NO SE KE ESTE MAL
static class SplitTest
{
static void Usuarios_pedidores()
{
Console.WriteLine("Ha selecionado la opcion 7 : LISTA DE USUARIOS PEDIGEÑOS");
string[] NOMBRES = new string[1000];


string[] split = NOMBRES.Split(new Char[] { ' ', ',', '.', ':' });

foreach (string s in split)
{

if (s.Trim() != "")
Console.WriteLine(s);
Console.ReadLine();

}
}


Debia de estar muy concentrado por que no recuerdo haber puesto eso y hay cosas en ese codigo que no mas no, no se usar el foreach
Estoy aki para aprender
Imagen
Avatar de Usuario
Vicitor2006
Usuario Muy Activo
Usuario Muy Activo
 
Mensajes: 127
Registrado: Mié May 23, 2007 11:38 am

Anterior

    

Volver a C#

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados