private void LoadData(int?Id) { using (var e = new posb.Expense { Id = this.Id }) { e.Get(); this.txtName.Text = e.Name; this.txtDescription.Text = e.Description; this.txtAmount.Text = String.Format("{0:0.00}", e.Amount); this.cmbType.SelectedIndex = e.Type.Value + 1; } using (var e = new posb.Config()) { var picture1 = e.GetImage("InputOutput", this.Id.Value); if (picture1 != null) { this.pbPhoto.Image = System.Drawing.Image.FromStream(new MemoryStream(picture1)); this.pbPhoto.Refresh(); } } }
private void LoadData() { this.cmbPrinter.Items.Add("Seleccione..."); foreach (var printer in PrinterSettings.InstalledPrinters) { this.cmbPrinter.Items.Add(printer); } this.cmbPrinter.SelectedIndex = 0; using (var e = new posb.Config()) { this.txtAlta.Text = String.Format("{0:0.00}", e.Alta()); this.txtAltaNegocio.Text = String.Format("{0:0.00}", e.AltaNegocio()); this.txtMensualidad.Text = String.Format("{0:0.00}", e.Mensualidad()); this.txtMensualidadNegocio.Text = String.Format("{0:0.00}", e.MensualidadNegocio()); this.cmbPrinter.Text = e.Printer(); this.txtPresidente.Text = e.Presidente(); this.txtTesorero.Text = e.Tesorero(); this.txtAltaH.Text = String.Format("{0:0.00}", e.AltaH()); this.cbAddNames.Checked = e.AltaAddNames(); this.nudTomas.Value = e.WaterIntakeHabitants(); var picture1 = e.GetImage("Voucher", 1); if (picture1 != null) { this.pbPhoto.Image = System.Drawing.Image.FromStream(new MemoryStream(picture1)); this.pbPhoto.Refresh(); } var picture2 = e.GetImage("Voucher", 2); if (picture1 != null) { this.pbPhoto2.Image = System.Drawing.Image.FromStream(new MemoryStream(picture2)); this.pbPhoto2.Refresh(); } } }
private void Config_Load(object sender, EventArgs e) { this.ConfigureDialogs(); using (var c = new posb.Config()) { var picture1 = c.GetImage(this.EntityName, this.Id.Value); if (picture1 != null) { this.pbPhoto.Image = System.Drawing.Image.FromStream(new MemoryStream(picture1)); this.pbPhoto.Refresh(); } } }