예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        private void Save()
        {
            if (this.ValidateForm())
            {
                using (var e = new posb.Config())
                {
                    e.Alta(this.txtAlta.Text);
                    e.AltaNegocio(this.txtAltaNegocio.Text);
                    e.Mensualidad(this.txtMensualidad.Text);
                    e.MensualidadNegocio(this.txtMensualidadNegocio.Text);
                    e.Printer(this.cmbPrinter.Text);
                    e.Presidente(this.txtPresidente.Text);
                    e.Tesorero(this.txtTesorero.Text);
                    e.AltaH(this.txtAltaH.Text);
                    e.AltaAddNames(this.cbAddNames.Checked);
                    e.WaterIntakeHabitants(this.nudTomas.Value.ToString());
                }

                this.Close();
            }
        }