Exemple #1
0
        //public void asignarDataBinding()
        //{
        //    this.bindingSource.DataSource = socioNegocio;
        //    foreach (Control control1 in this.Controls)
        //    {
        //        if (control1.Tag != null)
        //            ((DevExpress.XtraEditors.BaseEdit)control1).DataBindings.Add(new System.Windows.Forms.Binding("EditValue", bindingSource, control1.Tag.ToString(), true));

        //    }
        //}

        private void searchControlCliente_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
        {
            if (e.NewValue == null)
            {
                return;
            }
            if (e.NewValue.ToString().Length < 5)
            {
                return;
            }
            SOCIONEGOCIO registro = fs.buscarSocioNegocio(e.NewValue.ToString(), CredencialUsuario.getInstancia().getEmpresaSeleccionada().CODIGOEMPRESA);

            if (registro != null)
            {
                this.bindingSource.DataSource = registro;
            }
            else
            {
                this.bindingSource.DataSource = new SOCIONEGOCIO();
                SystemSounds.Beep.Play();
            }
            //if (registro != null)
            //{

            //    this.textEditDocumento.EditValue = registro.NUMERODOCUMENTO;
            //    this.textEditRazonSocial.EditValue = registro.RAZONSOCIAL;
            //    this.textEditTelefono.EditValue = registro.TELEFONO;
            //    this.textEditDireccion.EditValue = registro.TELEFONO;
        }
        private void textEditDocumento_EditValueChanged(object sender, EventArgs e)
        {
            BaseEdit edit = (BaseEdit)sender;

            if (edit.Text == "" || edit.Text == null || edit.Text.Length < 8)
            {
                return;
            }
            //Utiles.Utiles util = new Utiles.Utiles();
            socionegocioSeleccionado = facturaServicio.buscarSocioNegocio(edit.Text);

            if (socionegocioSeleccionado == null)
            {
                DialogResult resultado = XtraMessageBox.Show("El cliente con documento " + edit.EditValue + " no existe. Desea crearlo?", "Atención", MessageBoxButtons.YesNo);
                if (resultado == System.Windows.Forms.DialogResult.Yes)
                {
                    FormDatoCliente formDatoCliente = new FormDatoCliente(edit.Text);
                    formDatoCliente.ShowDialog();
                    if (formDatoCliente.DialogResult == DialogResult.OK)
                    {
                        socionegocioSeleccionado = formDatoCliente.DatoCliente;
                    }
                }
                else
                {
                    socionegocioSeleccionado = new SOCIONEGOCIO();
                }
            }

            bindingSourceSocioNegocio.DataSource = socionegocioSeleccionado;
        }
Exemple #3
0
        private void textEditDocumento_EditValueChanged(object sender, EventArgs e)
        {
            BaseEdit baseEdit = (BaseEdit)sender;

            if (baseEdit.Text == "" || baseEdit.Text == null || baseEdit.Text.Length < 8)
            {
                return;
            }
            this.socionegocioSeleccionado = this.facturaServicio.buscarSocioNegocio(baseEdit.Text, this.codigoEmpresa);
            if (this.socionegocioSeleccionado == null)
            {
                if (XtraMessageBox.Show("El cliente con documento " + baseEdit.EditValue + " no existe. Desea crearlo?", "Atención", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    FormDatoCliente formDatoCliente = new FormDatoCliente(baseEdit.Text);
                    int             num             = (int)formDatoCliente.ShowDialog();
                    if (formDatoCliente.DialogResult == DialogResult.OK)
                    {
                        this.socionegocioSeleccionado = formDatoCliente.DatoCliente;
                    }
                }
                else
                {
                    this.socionegocioSeleccionado = new SOCIONEGOCIO();
                }
            }
            if (this.socionegocioSeleccionado != null)
            {
                this.bindingSourceSocioNegocio.DataSource = (object)this.socionegocioSeleccionado;
            }
        }
Exemple #4
0
        private void simpleButtonRecuperar_Click(object sender, EventArgs e)
        {
            RecuperarPendienteForm recuperarPendienteForm = new RecuperarPendienteForm();
            int num = (int)recuperarPendienteForm.ShowDialog();

            if (recuperarPendienteForm.DialogResult != DialogResult.OK)
            {
                return;
            }
            this.detalleComprobanteList                    = new List <DETALLECOMPROBANTE>();
            this.comprobante                               = recuperarPendienteForm.getComprobanteSeleccionado();
            this.comprobante.CODIGOBODEGA                  = new long?(this.listadoBodega.First <BODEGA>().CODIGOBODEGA);
            this.cOMPROBANTEBindingSource.DataSource       = (object)this.comprobante;
            this.DETALLECOMPROBANTEGridControl.DataSource  = (object)this.comprobante.DETALLECOMPROBANTE;
            this.IMPUESTOCOMPROBANTEGridControl.DataSource = (object)this.comprobante.IMPUESTOCOMPROBANTE;
            this.socionegocioSeleccionado                  = this.comprobante.SOCIONEGOCIO;
            this.bindingSourceSocioNegocio.DataSource      = (object)this.comprobante.SOCIONEGOCIO;
            this.detalleComprobanteList.AddRange((IEnumerable <DETALLECOMPROBANTE>) this.comprobante.DETALLECOMPROBANTE);
            this.bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>((IList <DETALLECOMPROBANTE>) this.detalleComprobanteList);
            this.DETALLECOMPROBANTEGridControl.EndUpdate();
            this.IMPUESTOCOMPROBANTEGridControl.EndUpdate();
            this.cOMPROBANTEBindingSource.EndEdit();
            this.calcularImpuestos();
            this.EstadoComprobanteActual = this.estadosComprobante.getEstado(3L);
            this.EstadoComprobanteActual.asignarControles();
        }
        private void textEditDocumento_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            FormBuscarSocioNegocio formaBuscar = new FormBuscarSocioNegocio();

            formaBuscar.ShowDialog();
            if (formaBuscar.DialogResult == DialogResult.OK)
            {
                this.socionegocioSeleccionado             = formaBuscar.getSocioNegocioSeleccionado();
                this.bindingSourceSocioNegocio.DataSource = this.socionegocioSeleccionado;
            }
        }
Exemple #6
0
        private void textEditDocumento_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            FormBuscarSocioNegocio buscarSocioNegocio = new FormBuscarSocioNegocio();
            int num = (int)buscarSocioNegocio.ShowDialog();

            if (buscarSocioNegocio.DialogResult != DialogResult.OK)
            {
                return;
            }
            this.socionegocioSeleccionado             = buscarSocioNegocio.getSocioNegocioSeleccionado();
            this.bindingSourceSocioNegocio.DataSource = (object)this.socionegocioSeleccionado;
        }
Exemple #7
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            if (gridViewSocioNegocio.GetSelectedRows().Count() == 0)
            {
                MessageBox.Show("Seleccione un cliente");
                return;
            }
            this.socioNegocioSeleccionado = (SOCIONEGOCIO)gridViewSocioNegocio.GetRow(gridViewSocioNegocio.GetSelectedRows()[0]);
            this.DialogResult             = DialogResult.OK;

            //  MessageBox.Show("Cliente seleccionado: " + socionegocio.RAZONSOCIAL);
            //DataRow data = gridViewSocioNegocio.GetDataRow();
        }
        public bool validarDocumentoCliente()
        {
            bindingSource.EndEdit();
            SOCIONEGOCIO cliente = facturaServcio.buscarSocioNegocio(datoCliente.NUMERODOCUMENTO, CredencialUsuario.getInstancia().getEmpresaSeleccionada().CODIGOEMPRESA);

            if (cliente != null)
            {
                MessageBox.Show("Cliente con documento: " + cliente.NUMERODOCUMENTO + " ya existe");
                this.bindingSource.DataSource = cliente;
                return(false);
            }

            if (!utiles.validarDocumento(datoCliente.NUMERODOCUMENTO))
            {
                MessageBox.Show("Documento no cumple con la validación. Asigne como pasaporte el tipo de documento");
                datoCliente.CODIGOTIPOIDENTIFICACION = (long)EnumTipoIdentificacion.PASAPORTE;

                return(false);
            }
            return(true);
        }
        public override void Buscar()
        {
            FormBuscarComprobante formaBuscar = new FormBuscarComprobante((long)EnumTipoComprobante.FACTURA);

            formaBuscar.ShowDialog();
            if (formaBuscar.DialogResult == DialogResult.OK)
            {
                detalleComprobanteList = new List <DETALLECOMPROBANTE>();
                this.comprobante       = formaBuscar.getComprobanteSeleccionado();
                this.cOMPROBANTEBindingSource.DataSource       = this.comprobante;
                this.DETALLECOMPROBANTEGridControl.DataSource  = comprobante.DETALLECOMPROBANTE;
                this.IMPUESTOCOMPROBANTEGridControl.DataSource = comprobante.IMPUESTOCOMPROBANTE;
                this.socionegocioSeleccionado             = this.comprobante.SOCIONEGOCIO;
                this.bindingSourceSocioNegocio.DataSource = this.comprobante.SOCIONEGOCIO;
                detalleComprobanteList.AddRange(this.comprobante.DETALLECOMPROBANTE);
                bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>(detalleComprobanteList);
                this.DETALLECOMPROBANTEGridControl.EndUpdate();
                this.IMPUESTOCOMPROBANTEGridControl.EndUpdate();
                this.cOMPROBANTEBindingSource.EndEdit();
            }
        }
Exemple #10
0
        public void DatosIniciales()
        {
            this.Tag                           = (object)"FACTURA";
            this.facturaServicio               = new FacturaServicio();
            this.socionegocioSeleccionado      = new SOCIONEGOCIO();
            this.detalleComprobanteList        = new List <DETALLECOMPROBANTE>();
            this.bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>((IList <DETALLECOMPROBANTE>) this.detalleComprobanteList);
            this.codigoEmpresa                 = CredencialUsuario.getInstancia().getEmpresaSeleccionada().CODIGOEMPRESA;
            this.CODIGOTIPOCOMPROBANTELookUpEdit.Properties.DataSource = (object)this.facturaServicio.getTipoComprobante();
            this.CODIGOESTABLECIMIENTOLookUpEdit.Properties.DataSource = (object)this.facturaServicio.getEstablecimiento(this.codigoEmpresa);
            this.CODIGOPUNTOEMISIONLookUpEdit.Properties.DataSource    = (object)this.facturaServicio.getPuntoEmision(CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO);
            this.bindingSourceSocioNegocio.DataSource                = (object)this.socionegocioSeleccionado;
            this.DETALLECOMPROBANTEGridControl.DataSource            = (object)this.bindingListDetalleComprobante;
            this.CODIGOLISTADEPRECIOLookUpEdit.Properties.DataSource = (object)this.facturaServicio.getListadoDePrecio(this.codigoEmpresa);
            IEnumerable <LISTADEPRECIO> listadoDePrecio = this.facturaServicio.getListadoDePrecio(this.codigoEmpresa);

            this.CODIGOLISTADEPRECIOLookUpEdit.Properties.DataSource     = (object)listadoDePrecio;
            this.CODIGOESTADOCOMPROBANTELookUpEdit.Properties.DataSource = (object)this.facturaServicio.getEstadoComprobante();
            this.listadoBodega = this.facturaServicio.getBodega(this.codigoEmpresa, CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO);
            this.CODIGOBODEGALookUpEdit.Properties.ValueMember   = "CODIGOBODEGA";
            this.CODIGOBODEGALookUpEdit.Properties.DisplayMember = "NOMBRE";
            this.CODIGOBODEGALookUpEdit.Properties.DataSource    = (object)this.listadoBodega;
            this.comprobante = new COMPROBANTE();
            this.comprobante.CODIGOPUNTOEMISION      = CredencialUsuario.getInstancia().getPuntoDeEmision().CODIGOPUNTOEMISION;
            this.comprobante.CODIGOESTABLECIMIENTO   = CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO;
            this.comprobante.FECHAEMISION            = DateTime.Now;
            this.comprobante.CODIGOTIPOCOMPROBANTE   = 1L;
            this.comprobante.CODIGOLISTADEPRECIO     = new long?(listadoDePrecio.Min <LISTADEPRECIO>((Func <LISTADEPRECIO, long>)(x => x.CODIGOLISTADEPRECIO)));
            this.comprobante.CODIGOESTADOCOMPROBANTE = 3L;
            this.comprobante.CODIGOEMPRESA           = this.codigoEmpresa;
            this.comprobante.CODIGOBODEGA            = new long?(this.listadoBodega.First <BODEGA>().CODIGOBODEGA);
            this.cOMPROBANTEBindingSource.DataSource = (object)this.comprobante;
            this.EstadoComprobanteActual             = this.estadosComprobante.getEstado(3L);
            this.EstadoComprobanteActual.asignarControles();
            this.setcodigoEstado(3L);
            this.limpiarErrores((Control)this);
        }
        public void DatosIniciales()
        {
            this.Tag = "FACTURA";
            this.socionegocioSeleccionado = new SOCIONEGOCIO();
            detalleComprobanteList        = new List <DETALLECOMPROBANTE>();
            bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>(detalleComprobanteList);
            codigoEmpresa = CredencialUsuario.getInstancia().getEmpresaSeleccionada().CODIGOEMPRESA;
            this.CODIGOTIPOCOMPROBANTELookUpEdit.Properties.DataSource = facturaServicio.getTipoComprobante();
            this.CODIGOESTABLECIMIENTOLookUpEdit.Properties.DataSource = facturaServicio.getEstablecimiento(codigoEmpresa);
            this.CODIGOPUNTOEMISIONLookUpEdit.Properties.DataSource    = facturaServicio.getPuntoEmision(CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO);
            // this.CODIGOVENDEDORLookUpEdit.Properties.DataSource = facturaServicio.getVendedores(codigoEmpresa);
            bindingSourceSocioNegocio.DataSource                     = this.socionegocioSeleccionado;
            this.DETALLECOMPROBANTEGridControl.DataSource            = this.bindingListDetalleComprobante;
            this.CODIGOLISTADEPRECIOLookUpEdit.Properties.DataSource = facturaServicio.getListadoDePrecio(codigoEmpresa);
            IEnumerable <LISTADEPRECIO> listaPrecio = facturaServicio.getListadoDePrecio(codigoEmpresa);

            this.CODIGOLISTADEPRECIOLookUpEdit.Properties.DataSource     = listaPrecio;
            this.CODIGOESTADOCOMPROBANTELookUpEdit.Properties.DataSource = facturaServicio.getEstadoComprobante();
            listadoBodega = facturaServicio.getBodega(codigoEmpresa, CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO);
            this.CODIGOBODEGALookUpEdit.Properties.ValueMember   = "CODIGOBODEGA";
            this.CODIGOBODEGALookUpEdit.Properties.DisplayMember = "NOMBRE";
            this.CODIGOBODEGALookUpEdit.Properties.DataSource    = listadoBodega;
            comprobante = new COMPROBANTE();
            comprobante.CODIGOPUNTOEMISION           = CredencialUsuario.getInstancia().getPuntoDeEmision().CODIGOPUNTOEMISION;
            comprobante.CODIGOESTABLECIMIENTO        = CredencialUsuario.getInstancia().getEstablecimientoSeleccionado().CODIGOESTABLECIMIENTO;
            comprobante.FECHAEMISION                 = DateTime.Now;
            comprobante.CODIGOTIPOCOMPROBANTE        = (long)EnumTipoComprobante.FACTURA;
            comprobante.CODIGOLISTADEPRECIO          = listaPrecio.Min(x => x.CODIGOLISTADEPRECIO);
            comprobante.CODIGOESTADOCOMPROBANTE      = (long)EnumEstadoComprobante.NUEVO;
            comprobante.CODIGOEMPRESA                = codigoEmpresa;
            comprobante.CODIGOBODEGA                 = listadoBodega.First().CODIGOBODEGA;
            this.cOMPROBANTEBindingSource.DataSource = comprobante;
            this.EstadoComprobanteActual             = new EstadoNuevo(this);
            this.setcodigoEstado((long)EnumEstadoComprobante.NUEVO);
            this.limpiarErrores(this);
        }
        private void simpleButton1_Click_1(object sender, EventArgs e)
        {
            RecuperarPendienteForm recuperar = new RecuperarPendienteForm();

            recuperar.ShowDialog();
            if (recuperar.DialogResult == DialogResult.OK)
            {
                detalleComprobanteList   = new List <DETALLECOMPROBANTE>();
                this.comprobante         = recuperar.getComprobanteSeleccionado();
                comprobante.CODIGOBODEGA = listadoBodega.First().CODIGOBODEGA;
                this.cOMPROBANTEBindingSource.DataSource       = this.comprobante;
                this.DETALLECOMPROBANTEGridControl.DataSource  = comprobante.DETALLECOMPROBANTE;
                this.IMPUESTOCOMPROBANTEGridControl.DataSource = comprobante.IMPUESTOCOMPROBANTE;
                this.socionegocioSeleccionado             = this.comprobante.SOCIONEGOCIO;
                this.bindingSourceSocioNegocio.DataSource = this.comprobante.SOCIONEGOCIO;
                detalleComprobanteList.AddRange(this.comprobante.DETALLECOMPROBANTE);
                bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>(detalleComprobanteList);

                this.DETALLECOMPROBANTEGridControl.EndUpdate();
                this.IMPUESTOCOMPROBANTEGridControl.EndUpdate();
                this.cOMPROBANTEBindingSource.EndEdit();
                calcularImpuestos();
            }
        }
Exemple #13
0
        public override void Buscar()
        {
            FormBuscarComprobante buscarComprobante = new FormBuscarComprobante(1L);
            int num = (int)buscarComprobante.ShowDialog();

            if (buscarComprobante.DialogResult != DialogResult.OK)
            {
                return;
            }
            this.detalleComprobanteList = new List <DETALLECOMPROBANTE>();
            this.comprobante            = buscarComprobante.getComprobanteSeleccionado();
            this.cOMPROBANTEBindingSource.DataSource       = (object)this.comprobante;
            this.DETALLECOMPROBANTEGridControl.DataSource  = (object)this.comprobante.DETALLECOMPROBANTE;
            this.IMPUESTOCOMPROBANTEGridControl.DataSource = (object)this.comprobante.IMPUESTOCOMPROBANTE;
            this.socionegocioSeleccionado             = this.comprobante.SOCIONEGOCIO;
            this.bindingSourceSocioNegocio.DataSource = (object)this.comprobante.SOCIONEGOCIO;
            this.detalleComprobanteList.AddRange((IEnumerable <DETALLECOMPROBANTE>) this.comprobante.DETALLECOMPROBANTE);
            this.bindingListDetalleComprobante = new BindingList <DETALLECOMPROBANTE>((IList <DETALLECOMPROBANTE>) this.detalleComprobanteList);
            this.DETALLECOMPROBANTEGridControl.EndUpdate();
            this.IMPUESTOCOMPROBANTEGridControl.EndUpdate();
            this.cOMPROBANTEBindingSource.EndEdit();
            this.EstadoComprobanteActual = this.estadosComprobante.getEstado(this.comprobante.CODIGOESTADOCOMPROBANTE);
            this.EstadoComprobanteActual.asignarControles();
        }
Exemple #14
0
 public void setSocioNegocioSeleccionado(SOCIONEGOCIO socionegocio)
 {
     this.socioNegocioSeleccionado = socionegocio;
 }