コード例 #1
0
        public FrmDetalleDocumento(DetalleDocumento detalle, DocumentoElectronico documento)
        {
            InitializeComponent();
            _detalle   = detalle;
            _documento = documento;

            detalleDocumentoBindingSource.DataSource = detalle;
            detalleDocumentoBindingSource.ResetBindings(false);

            Load += (s, e) =>
            {
                using (var ctx = new OpenInvoicePeruDb())
                {
                    tipoImpuestoBindingSource.DataSource = ctx.TipoImpuestos.ToList();
                    tipoImpuestoBindingSource.ResetBindings(false);

                    tipoPrecioBindingSource.DataSource = ctx.TipoPrecios.ToList();
                    tipoPrecioBindingSource.ResetBindings(false);
                }
            };
            decimal sumar = 0;

            sumar = documento.Items.Count() + 1;
            idNumericUpDown.Value = (sumar);
        }
コード例 #2
0
        public FrmDatosGuia(DatosGuia datosGuia)
        {
            InitializeComponent();
            _datosGuia = datosGuia;

            datosGuiaBindingSource.DataSource = _datosGuia;
            datosGuiaBindingSource.ResetBindings(false);

            Load += (s, e) =>
            {
                using (var ctx = new OpenInvoicePeruDb())
                {
                    tipoDocumentoContribuyenteBindingSource.DataSource = ctx.TipoDocumentoContribuyentes.ToList();
                    tipoDocumentoContribuyenteBindingSource.ResetBindings(false);

                    modalidadTransporteBindingSource.DataSource = ctx.ModalidadTransportes.ToList();
                    modalidadTransporteBindingSource.ResetBindings(false);
                }
            };

            toolOk.Click += (s, e) =>
            {
                datosGuiaBindingSource.EndEdit();
                _datosGuia.UnidadMedida = unidadMedidaComboBox.Text;

                DialogResult = DialogResult.OK;
            };

            toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel;
        }
コード例 #3
0
ファイル: FrmDiscrepancia.cs プロジェクト: acporras/EJB
        public FrmDiscrepancia(Discrepancia discrepancia, string tipoDoc)
        {
            InitializeComponent();
            _discrepancia = discrepancia;
            _tipoDoc      = tipoDoc;
            discrepanciaBindingSource.DataSource = _discrepancia;
            discrepanciaBindingSource.ResetBindings(false);

            Load += (s, e) =>
            {
                using (var ctx = new OpenInvoicePeruDb())
                {
                    tipoDiscrepanciaBindingSource.DataSource = ctx.TipoDiscrepancias
                                                               .Where(t => t.DocumentoAplicado == _tipoDoc).ToList();

                    tipoDiscrepanciaBindingSource.ResetBindings(false);
                }
            };

            toolOk.Click += (s, e) =>
            {
                discrepanciaBindingSource.EndEdit();

                DialogResult = DialogResult.OK;
            };

            toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel;
        }
コード例 #4
0
        public Form1()
        {
            InitializeComponent();

            Load += (s, e) =>
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;

                    using (var ctx = new OpenInvoicePeruDb())
                    {
                        direccionSunatBindingSource.DataSource = ctx.DireccionesSunat.ToList();
                        direccionSunatBindingSource.ResetBindings(false);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                finally
                {
                    Cursor.Current = Cursors.Default;
                }
            };
            var recursos = herramientas.GetResourcesPath();

            txtRutaCertificado.Text = recursos + "\\Certificado_PiuraTours.pfx";
        }
コード例 #5
0
 public FrmDatosAdicionales(DatoAdicional dato)
 {
     InitializeComponent();
     _dato = dato;
     datoAdicionalBindingSource.DataSource = _dato;
     datoAdicionalBindingSource.ResetBindings(false);
     Load += (s, e) =>
     {
         using (var ctx = new OpenInvoicePeruDb())
         {
             tipoDatoAdicionalBindingSource.DataSource = ctx.TipoDatoAdicionales.ToList();
             tipoDatoAdicionalBindingSource.ResetBindings(false);
         }
     };
     toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel;
 }
コード例 #6
0
        public FrmDocumentoRelacionado(DocumentoRelacionado documentoRelacionado)
        {
            InitializeComponent();
            _documentoRelacionado = documentoRelacionado;
            documentoRelacionadoBindingSource.DataSource = _documentoRelacionado;
            documentoRelacionadoBindingSource.ResetBindings(false);

            Load += (s, e) =>
            {
                using (var ctx = new OpenInvoicePeruDb())
                {
                    tipoDocumentoRelacionadoBindingSource.DataSource = ctx.TipoDocumentoRelacionados.ToList();
                    tipoDocumentoRelacionadoBindingSource.ResetBindings(false);
                }
            };

            toolOk.Click += (s, e) =>
            {
                documentoRelacionadoBindingSource.EndEdit();
                DialogResult = DialogResult.OK;
            };

            toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel;
        }
コード例 #7
0
        public FrmDiscrepancia(Discrepancia discrepancia, string tipoDoc)
        {
            InitializeComponent();
            _tipoDoc = tipoDoc;
            discrepanciaBindingSource.DataSource = discrepancia;
            discrepanciaBindingSource.ResetBindings(false);

            Load += (s, e) =>
            {
                using (var ctx = new OpenInvoicePeruDb())
                {
                    var tipoDocumento = ctx.Set <TipoDocumento>()
                                        .AsNoTracking()
                                        .SingleOrDefault(p => p.Codigo == _tipoDoc);

                    if (tipoDocumento == null)
                    {
                        return;
                    }

                    tipoDiscrepanciaBindingSource.DataSource = ctx.Set <TipoDiscrepancia>()
                                                               .Where(t => t.IdTipoDocumento == tipoDocumento.Id).AsNoTracking().ToList();

                    tipoDiscrepanciaBindingSource.ResetBindings(false);
                }
            };

            toolOk.Click += (s, e) =>
            {
                discrepanciaBindingSource.EndEdit();

                DialogResult = DialogResult.OK;
            };

            toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel;
        }
コード例 #8
0
ファイル: FrmDocumento.cs プロジェクト: acporras/EJB
        private void FrmDocumento_Load(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;

                using (var ctx = new OpenInvoicePeruDb())
                {
                    tipoDocumentoBindingSource.DataSource = ctx.TipoDocumentos.ToList();
                    tipoDocumentoBindingSource.ResetBindings(false);

                    tipoDocumentoContribuyenteBindingSource.DataSource = ctx.TipoDocumentoContribuyentes.ToList();
                    tipoDocumentoContribuyenteBindingSource.ResetBindings(false);

                    tipoDocumentoAnticipoBindingSource.DataSource = ctx.TipoDocumentoAnticipos.ToList();
                    tipoDocumentoAnticipoBindingSource.ResetBindings(false);

                    tipoOperacionBindingSource.DataSource = ctx.TipoOperaciones.ToList();
                    tipoOperacionBindingSource.ResetBindings(false);

                    monedaBindingSource.DataSource = ctx.Monedas.ToList();
                    monedaBindingSource.ResetBindings(false);
                }

                if (_documento.TipoDocumento != null)
                {
                    cboTipoDoc.SelectedValue = _documento.TipoDocumento;
                    String dato;
                    dato   = Convert.ToString(cboTipoDoc.SelectedValue);
                    Numera = AdmNumera.BuscaNumeracion(Convert.ToString(dato));
                    string str = Convert.ToString(Numera.Numeracion);
                    char   pad = '0';
                    numeracion             = Numera.Serie + "-" + str.PadLeft(8, pad);
                    textBox17.Text         = numeracion.ToString();
                    _documento.IdDocumento = numeracion;
                }
                else
                {
                    cboTipoDoc.SelectedIndex = -1;
                }

                comboBox1.SelectedIndex = -1;
                //cboTipoDocRec.SelectedIndex = -1;
                cboTipoDocRec2.SelectedIndex = -1;
                comboBox1.SelectedIndex      = -1;
                txtCorrelativo3.Text         = "R001-0001";
                cboMoneda2.SelectedIndex     = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                Cursor = Cursors.Default;
            }

            #region CARGAR RUC
            try
            {
                CargarImagenSunat();
                LeerCaptchaSunat();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            #endregion
        }