public void readempresa2() { IFormatter locales = new BinaryFormatter(); Stream bf = new FileStream("Locales.bin", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); for (int q = 0; q < i; q++) { Tienda tienda = (Tienda)locales.Deserialize(bf); tiendas2.Add(tienda); total.Add(tienda.infotienda()); } for (int q = 0; q < y; q++) { Restaurantes rest = (Restaurantes)locales.Deserialize(bf); restaurantes2.Add(rest); total.Add(rest.inforestaurante()); } for (int q = 0; q < z; q++) { Cine cine = (Cine)locales.Deserialize(bf); cines2.Add(cine); total.Add(cine.infocine()); } for (int q = 0; q < w; q++) { Recreacional rec = (Recreacional)locales.Deserialize(bf); recreacionals2.Add(rec); Console.WriteLine(rec.inforecreacional()); total.Add(rec.inforecreacional()); } bf.Close(); }
private void button14_Click(object sender, EventArgs e) { paneltienda1.Visible = false; panel4.Visible = false; panel2.Visible = false; particularidad = "no"; Restaurantes rest = new Restaurantes(name, rut, horario, particularidad); local.addlocalRest(rest); }
private void button7_Click(object sender, EventArgs e) { if (z == "tienda") { panel4.Visible = true; panel7.Visible = false; panel8.Visible = false; horario = textBox3.Text; Tienda tienda = new Tienda(name, rut, horario, particularidad); local.addlocaltienda(tienda); } if (z == "restaurante") { panel4.Visible = true; panel7.Visible = true; panel8.Visible = true; horario = textBox3.Text; Restaurantes rest = new Restaurantes(name, rut, horario, particularidad); local.addlocalRest(rest); } if (z == "cine") { panel4.Visible = true; panel7.Visible = true; panel8.Visible = false; horario = textBox3.Text; Cine cine = new Cine(name, rut, horario, particularidad); local.addlocalcine(cine); } if (z == "recreacional") { paneltienda1.Visible = false; panel4.Visible = false; panel2.Visible = false; horario = textBox3.Text; Recreacional rec = new Recreacional(name, rut, horario); local.addlocalre(rec); } }
public void addlocalRest(Restaurantes rest) { restaurantes.Add(rest); y += 1; }