private RegistroReparaciones recuperarRegistro() { RegistroReparaciones toret = new RegistroReparaciones(); toret = toret.RecuperaXml(); return(toret); }
static void Main(string[] args) { RegistroReparaciones reparaciones = RegistroReparaciones.RecuperaXml(); var r = new Radio(10, "sony", "am"); var tele = new Televisor(1234, "LG", 52); var reparacion1 = Reparacion.Crea(1.5, tele.precioHora, tele.numSerie); reparaciones.Add(reparacion1); Console.WriteLine(r); Console.WriteLine(tele); Console.WriteLine(reparacion1); Console.WriteLine(reparacion1.calcularPrecio(100)); reparaciones.GuardaXml(); }
private void showBorrarDatos() { RegistroAparatos registro = new RegistroAparatos(); RegistroReparaciones registro2 = new RegistroReparaciones(); registro.Clear(); registro2.Clear(); Label label1 = new Label() { Dock = DockStyle.Bottom, Text = "Datos Borrados" }; label1.UseMnemonic = true; label1.Size = new Size(label1.PreferredWidth, label1.PreferredHeight); this.Controls.Add(label1); }
private void build() { RegistroAparatos registroa = recuperarRegistroa(); RegistroReparaciones registro = recuperarRegistro(); var pnlTable = new TableLayoutPanel(); pnlTable.SuspendLayout(); pnlTable.Dock = DockStyle.Fill; Label apratos = new Label() { Dock = DockStyle.Top, Text = registroa.toString() }; Label label1 = new Label() { Dock = DockStyle.Top, Text = registro.ToString() }; apratos.UseMnemonic = true; label1.UseMnemonic = true; apratos.Size = new Size(apratos.PreferredWidth, apratos.PreferredHeight); label1.Size = new Size(label1.PreferredWidth, label1.PreferredHeight); this.Controls.Add(label1); this.Controls.Add(apratos); pnlTable.ResumeLayout(false); this.Controls.Add(pnlTable); this.MinimumSize = new Size(320, 240); }
private void build() { registro = registro.RecuperaXml(); var pnl = new WFrms.Panel { Dock = WFrms.DockStyle.Top }; var lblns = new WFrms.Label { Dock = WFrms.DockStyle.Top, Text = "Numero de serie" }; this.Edns = new WFrms.TextBox { Dock = WFrms.DockStyle.Top, TextAlign = WFrms.HorizontalAlignment.Left, Text = "0" }; var lblh = new WFrms.Label { Dock = WFrms.DockStyle.Top, Text = "Horas (decimal acabado en .0 o .5)" }; this.Edh = new WFrms.TextBox { Dock = WFrms.DockStyle.Top, TextAlign = WFrms.HorizontalAlignment.Left, Text = "0" }; double horas; int numSerie; double.TryParse(Edh.Text, out horas); int.TryParse(Edns.Text, out numSerie); switch (tipo) { case "tdt": registro.AddReparacion(new Reparacion(AdaptadorTDT.precio, horas, numSerie)); break; case "radio": registro.AddReparacion(new Reparacion(Radio.precio, horas, numSerie)); break; case "dvd": registro.AddReparacion(new Reparacion(ReproductorDVD.precio, horas, numSerie)); break; case "tv": registro.AddReparacion(new Reparacion(Televisor.precio, horas, numSerie)); break; } pnl.Controls.Add(this.Edh); pnl.Controls.Add(lblh); pnl.Controls.Add(this.Edns); pnl.Controls.Add(lblns); pnl.ResumeLayout(false); this.Controls.Add(pnl); registro.GuardaXml(); }