Пример #1
0
 public FormAltaEjemplar(BibliotecaNegocio bibliotecaNegocio)
 {
     InitializeComponent();
     this.biblioteca = bibliotecaNegocio;
     this.Refrescar();
     this.comboBox1.DataSource = biblioteca.GetLibros();
 }
Пример #2
0
        static void Main(string[] args)
        {
            BibliotecaNegocio biblioteca = new BibliotecaNegocio();

            try
            {
                //biblioteca.IngresarCliente("pedro", "perez", "asd 123", 12345678, "asdasd@asd", true);
                //biblioteca.IngresarLibro("asd", "jorge", 2,"rouler", 212, "qweq");

                List <Cliente> libros = biblioteca.GetClientes();

                foreach (Cliente l in libros)
                {
                    Console.WriteLine(l.ToString());
                }
            }
            catch (SinClientesException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
        }
        public FormGestionarPrestamo(Prestamo prestamoOrigen, BibliotecaNegocio bibliotecaNegocio)
        {
            InitializeComponent();

            biblioteca = bibliotecaNegocio;
            prestamo   = prestamoOrigen;

            textBox1.Text = prestamo.Id.ToString();
            textBox4.Text = prestamo.IdCliente.ToString();
            textBox2.Text = prestamo.NombreEjemplar;
            textBox3.Text = prestamo.NombreCompletoCliente;
            textBox5.Text = prestamo.Plazo.ToString();
            textBox6.Text = prestamo.FechaAlta.ToShortDateString();
            textBox7.Text = prestamo.FechaBaja.ToShortDateString();
            textBox8.Text = prestamo.FechaBajaReal.ToShortDateString();
        }
Пример #4
0
        public FormInicio()
        {
            InitializeComponent();
            biblioteca        = new BibliotecaNegocio();
            this.Text         = "Gestión de Biblioteca";
            this.label13.Text = "Bienvenido a la Biblioteca General Jeremías Springfield";
            this.CargaInicial();
            this.CargarArrays();
            this.comboBox1.DataSource = biblioteca.GetLibros();

            if (biblioteca.GetLibros().Count == 0)
            {
                this.comboBox1.Items.Add("No hay libros cargados");
                this.comboBox1.Enabled = false;
            }
        }
Пример #5
0
 public FormAltaPrestamo(BibliotecaNegocio biblioteca)
 {
     InitializeComponent();
     _biblioteca = biblioteca;
     try
     {
         foreach (Ejemplar ejemplar in _biblioteca.Ejemplares)
         {
             if (ejemplar.Prestado == false && ejemplar.IdLibro != 0)
             {
                 comboBox1.Items.Add(ejemplar);
             }
         }
         foreach (Cliente cliente in _biblioteca.Clientes)
         {
             if (cliente.Activo)
             {
                 comboBox2.Items.Add(cliente);
             }
         }
         textBox2.Enabled = false;
         textBox3.Enabled = false;
         textBox4.Enabled = false;
         textBox5.Enabled = false;
         textBox6.Enabled = false;
         //comboBox1.Enabled = false;
     }
     catch (SinClientesException ex)
     {
         FormException formException = new FormException("No hay clientes", ex.Message);
         formException.Owner = this;
         formException.Show();
         this.Enabled = false;
     }
     catch (SinLibrosException ex)
     {
         FormException formException = new FormException("No hay libros", ex.Message);
         formException.Owner = this;
         formException.Show();
         this.Enabled = false;
     }
 }
Пример #6
0
 public FormAltaLibro(BibliotecaNegocio bibliotecaNegocio)
 {
     InitializeComponent();
     this.biblioteca = bibliotecaNegocio;
 }