static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #region "Datos" /*List<Estudio> Estudios = new List<Estudio>(); * Estudio e = new Estudio("Lucas Films", "Aqui", "Hoy"); * Estudios.Add(e); * * List<Persona> Personas = new List<Persona>(); * Director d = new Director("Joaquin", "Tellez", "1995", "naci"); * Actor a = new Actor("Joaquin", "Sim", "1996", "nose"); * Productor pr = new Productor("Jats", "Tell", "1998", "buena"); * Personas.Add(d); * Personas.Add(a); * Personas.Add(pr); * * List<Pelicula> Peliculas = new List<Pelicula>(); * Pelicula p = new Pelicula("Star Wars", d, "2018", " ", 100, e); * Peliculas.Add(p); * * List<PeliculaActor> Pactor = new List<PeliculaActor>(); * PeliculaActor pa = new PeliculaActor(p, a); * Pactor.Add(pa); * * List<PeliculaProductor> Pproductor = new List<PeliculaProductor>(); * PeliculaProductor pp = new PeliculaProductor(p, pr); * Pproductor.Add(pp); * * Base_de_Datos Data = new Base_de_Datos(Peliculas, Personas, Estudios, Pactor, Pproductor); * * * using (Stream stream = new FileStream("Data.bin", FileMode.Create, FileAccess.Write, FileShare.None)) * { * IFormatter formatter = new BinaryFormatter(); * formatter.Serialize(stream, Data); * stream.Close(); * }*/ #endregion Base_de_Datos Data = null; try { using (Stream stream = new FileStream("Data.bin", FileMode.Open, FileAccess.Read, FileShare.Read)) { IFormatter formatter = new BinaryFormatter(); Data = (Base_de_Datos)formatter.Deserialize(stream); stream.Close(); } } catch (IOException) { } Application.Run(new Form1(Data)); }
public Principal(Base_de_Datos Datos) { Data = Datos; InitializeComponent(); Controller controlador = new Controller(Data, this); listBox1.Hide(); textBox1.Hide(); textBox2.Hide(); textBox3.Hide(); numericUpDown1.Hide(); textBox5.Hide(); comboBox1.Hide(); comboBox2.Hide(); groupBox1.Hide(); label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); label6.Hide(); label7.Hide(); button9.Hide(); button10.Hide(); button11.Hide(); }
public Controller2(Base_de_Datos Datos, ButtonView MiVista) { Data = Datos; Vista = MiVista; Vista.OnCritica += Vista_OnCritica; Vista.AsignarActor += Vista_AsignarActor; Vista.AsignarProductor += Vista_AsignarProductor; }
public Controller(Base_de_Datos Datos, Principal MiMain) { Data = Datos; main = MiMain; main.OnCrear += main_OnCrear; main.AgregarPelicula += main_AgregarPelicula; main.AgregarEstudio += main_AgregarEstudio; }
public Form1(Base_de_Datos Datos) { Data = Datos; InitializeComponent(); }
public ButtonView(Base_de_Datos Datos, string tipos) { Data = Datos; tipo = tipos; InitializeComponent(); Controller2 controller2 = new Controller2(Data, this); label12.Hide(); listBox4.Hide(); listBox2.Hide(); label9.Hide(); label10.Hide(); textBox8.Hide(); textBox9.Hide(); if (tipo == "Peliculas") { textBox1.Show(); textBox2.Show(); textBox3.Hide(); textBox4.Show(); textBox5.Show(); textBox6.Show(); textBox7.Show(); label2.Text = "Fecha de Estreno"; label5.Text = "Descripcion"; label1.Show(); label2.Show(); label3.Hide(); label4.Show(); label5.Show(); label6.Show(); label7.Show(); label8.Hide(); button3.Hide(); button4.Hide(); button5.Show(); button6.Hide(); foreach (Pelicula p in Data.Pelicula) { listBox1.Items.Add(p.Nombre); } label11.Text = "Staff"; label12.Show(); listBox4.Show(); } else if (tipo == "Actores") { textBox1.Show(); textBox2.Show(); textBox3.Show(); textBox4.Hide(); textBox5.Show(); textBox6.Hide(); textBox7.Hide(); label2.Text = "Apellido"; label3.Text = "Fecha de Nacimiento"; label5.Text = "Biografia"; label1.Show(); label2.Show(); label3.Show(); label4.Hide(); label5.Show(); label6.Hide(); label7.Hide(); label8.Hide(); button3.Hide(); button4.Show(); button5.Hide(); button6.Hide(); foreach (Persona a in Data.Persona) { if (a.GetType().Name == "Actor") { listBox1.Items.Add(a.Nombre + " " + a.Apellido); } } label11.Text = "Peliculas Actuadas"; } else if (tipo == "Directores") { textBox1.Show(); textBox2.Show(); textBox3.Show(); textBox4.Hide(); textBox5.Show(); textBox6.Hide(); textBox7.Hide(); label2.Text = "Apellido"; label3.Text = "Fecha de Nacimiento"; label5.Text = "Biografia"; label1.Show(); label2.Show(); label3.Show(); label4.Hide(); label5.Show(); label6.Hide(); label7.Hide(); label8.Hide(); button3.Hide(); button4.Hide(); button5.Hide(); button6.Hide(); foreach (Persona d in Data.Persona) { if (d.GetType().Name == "Director") { listBox1.Items.Add(d.Nombre + " " + d.Apellido); } } label11.Text = "Peliculas Dirigidas"; } else if (tipo == "Productores") { textBox1.Show(); textBox2.Show(); textBox3.Show(); textBox4.Hide(); textBox5.Show(); textBox6.Hide(); textBox7.Hide(); label2.Text = "Apellido"; label3.Text = "Fecha de Nacimiento"; label5.Text = "Biografia"; label1.Show(); label2.Show(); label3.Show(); label4.Hide(); label5.Show(); label6.Hide(); label7.Hide(); label8.Hide(); button3.Show(); button4.Hide(); button5.Hide(); button6.Hide(); foreach (Persona pr in Data.Persona) { if (pr.GetType().Name == "Productor") { listBox1.Items.Add(pr.Nombre + " " + pr.Apellido); } } label11.Text = "Peliculas Producidas"; } else if (tipo == "Estudios") { textBox1.Show(); textBox2.Show(); textBox3.Show(); textBox4.Hide(); textBox5.Hide(); textBox6.Hide(); textBox7.Hide(); label2.Text = "Direccion"; label3.Text = "Fecha de Apertura"; label1.Show(); label2.Show(); label3.Show(); label4.Hide(); label5.Hide(); label6.Hide(); label7.Hide(); label8.Hide(); button3.Hide(); button4.Hide(); button5.Hide(); button6.Hide(); foreach (Estudio e in Data.Estudio) { listBox1.Items.Add(e.Nombre); } label11.Text = "Peliculas Producidas"; } }