Exemple #1
0
    private void GetPais(int idPais)
    {
        dvSalvarPais.Visible  = true;
        dvListarPaiss.Visible = false;

        var Pais = new Pais();

        Pais.IDPais = idPais;
        Pais.Get();

        txtId.Text   = Pais.IDPais.ToString();
        txtNome.Text = Pais.Nome.ToString();
    }
Exemple #2
0
 public void Tercero2Form()
 {
     this.txtCodigo.Text             = this.tercero.Codigo;
     this.txtNIT.Text                = Convert.ToString(this.tercero.Nit);
     this.txtDigitoVerificacion.Text = Convert.ToString(this.tercero.DigitoVerificacion);
     this.txtNombreComercial.Text    = this.tercero.NombreComercial;
     this.checkInhabilitar.Checked   = this.tercero.Inhabilitar;
     this.txtRazonSocial.Text        = this.tercero.RazonSocial;
     this.txtPrimerNombre.Text       = this.tercero.PrimerNombre;
     this.txtOtroNombre.Text         = this.tercero.OtroNombre;
     this.txtPrimerApellido.Text     = this.tercero.PrimerApellido;
     this.txtSegundoApellido.Text    = this.tercero.SegundoApellido;
     this.txtContacto.Text           = this.tercero.ContactoPrincipal;
     this.txtDireccion.Text          = this.tercero.DireccionPrincipal;
     this.txtTelefono.Text           = this.tercero.TelefonoPrincipal;
     this.txtFax.Text                = this.tercero.Fax;
     this.txtCelular.Text            = this.tercero.TelefonoMovilPrincipal;
     this.txtTelefono2.Text          = this.tercero.OtroTelefonoPrincipal;
     this.txtEmail.Text              = this.tercero.Email;
     this.CargarPaises();
     if (this.tercero.CiudadID != 0)
     {
         Ciudad ciudad = Ciudad.Get(tercero.CiudadID);
         Estado estado = Estado.Get(ciudad.EstadoID.GetValueOrDefault());
         Pais   pais   = Pais.Get(estado.PaisID);
         this.cbPais.SelectedValue         = pais.ID;
         this.cbDepartamento.SelectedValue = estado.ID;
         this.cbMunicipio.SelectedValue    = ciudad.ID;
     }
     this.checkExcentoIVA.Checked        = this.tercero.ExcentoIva;
     this.checkGranContribuyente.Checked = this.tercero.GranContribuyente;
     if (this.tercero.TipoRegimen == Tercero.REGIMEN_COMUN)
     {
         this.rbComun.Checked = true;
     }
     else
     {
         this.rbSimplificado.Checked = true;
     }
     this.checkCliente.Checked           = this.tercero.ClienteNacional;
     this.checkClienteExterior.Checked   = this.tercero.ClienteExtranjero;
     this.checkProveedorExterior.Checked = this.tercero.ProveedorExtranjero;
     this.checkProveedor.Checked         = this.tercero.ProveedorNacional;
     this.checkOtro.Checked            = this.tercero.OtroTipoTercero;
     this.checkInterno.Checked         = this.tercero.Interno;
     this.txtReferenciaComercial.Text  = this.tercero.ReferenciaComercial;
     this.cbCalificacion.SelectedIndex = this.cbCalificacion.FindStringExact(this.tercero.Calificacion.ToString());
     this.cbTipoPrecio.SelectedIndex   = this.cbTipoPrecio.FindStringExact(this.tercero.TipoPrecioVenta.ToString());
     this.txtObservacion.Text          = this.tercero.Observacion;
 }
Exemple #3
0
 private void Clear()
 {
     this.txtCodigo.Text                 = string.Empty;
     this.txtNIT.Text                    = string.Empty;
     this.txtDigitoVerificacion.Text     = string.Empty;
     this.txtNombreComercial.Text        = string.Empty;
     this.checkInhabilitar.Checked       = false;
     this.txtRazonSocial.Text            = string.Empty;
     this.txtPrimerNombre.Text           = string.Empty;
     this.txtOtroNombre.Text             = string.Empty;
     this.txtPrimerApellido.Text         = string.Empty;
     this.txtSegundoApellido.Text        = string.Empty;
     this.txtContacto.Text               = string.Empty;
     this.txtDireccion.Text              = string.Empty;
     this.txtTelefono.Text               = string.Empty;
     this.txtFax.Text                    = string.Empty;
     this.txtCelular.Text                = string.Empty;
     this.txtTelefono2.Text              = string.Empty;
     this.txtEmail.Text                  = string.Empty;
     this.checkExcentoIVA.Checked        = false;
     this.checkGranContribuyente.Checked = false;
     this.rbComun.Checked                = true;
     this.rbSimplificado.Checked         = false;
     this.checkCliente.Checked           = true;
     this.checkClienteExterior.Checked   = false;
     this.checkProveedor.Checked         = false;
     this.checkProveedorExterior.Checked = false;
     this.checkOtro.Checked              = false;
     this.checkInterno.Checked           = false;
     this.txtReferenciaComercial.Text    = string.Empty;
     this.CargarPaises();
     this.cbTipoPrecio.SelectedIndex   = 0;
     this.cbCalificacion.SelectedIndex = 2;
     this.txtObservacion.Text          = string.Empty;
     if (empresa.CiudadID != 0)
     {
         Ciudad ciudad = Ciudad.Get(empresa.CiudadID.GetValueOrDefault());
         Estado estado = Estado.Get(ciudad.EstadoID.GetValueOrDefault());
         Pais   pais   = Pais.Get(estado.PaisID);
         this.cbPais.SelectedValue         = pais.ID;
         this.cbDepartamento.SelectedValue = estado.ID;
         this.cbMunicipio.SelectedValue    = ciudad.ID;
     }
 }
Exemple #4
0
 private void FormTerceros_Load(object sender, EventArgs e)
 {
     CargarPaises();
     this.cbTipoPrecio.SelectedIndex   = 0;
     this.cbCalificacion.SelectedIndex = 2;
     if (!string.IsNullOrEmpty(empresa.CiudadID.ToString()))
     {
         Ciudad ciudad = Ciudad.Get(empresa.CiudadID.GetValueOrDefault());
         Estado estado = Estado.Get(ciudad.EstadoID.GetValueOrDefault());
         Pais   pais   = Pais.Get(estado.PaisID);
         this.cbPais.SelectedValue         = pais.ID;
         this.cbDepartamento.SelectedValue = estado.ID;
         this.cbMunicipio.SelectedValue    = ciudad.ID;
     }
     if (accion == 2)
     {
         Tercero2Form();
     }
 }
Exemple #5
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Pais = new Pais();
        try
        {
            if (txtId.Text != "")
            {
                Pais.IDPais = int.Parse(txtId.Text);
                Pais.Get();
            }

            Pais.Nome = txtNome.Text;

            Pais.Save();
            GetPais((int)Pais.IDPais);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
Exemple #6
0
    protected void btnSalvar_Click(object sender, EventArgs e)
    {
        var Pais = new Pais();

        try
        {
            if (txtId.Text != "")
            {
                Pais.IDPais = int.Parse(txtId.Text);
                Pais.Get();
            }

            Pais.Nome = txtNome.Text;

            Pais.Save();
            GetPais((int)Pais.IDPais);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('Registro salvo.')</script>");
        }
        catch (Exception err)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>alert('" + FormatError.FormatMessageForJAlert(err.Message) + "')</script>");
        }
    }
Exemple #7
0
    private void GetPais(int idPais)
    {
        dvSalvarPais.Visible = true;
        dvListarPaiss.Visible = false;

        var Pais = new Pais();
        Pais.IDPais = idPais;
        Pais.Get();

        txtId.Text = Pais.IDPais.ToString();
        txtNome.Text = Pais.Nome.ToString();
    }
Exemple #8
0
        private void LoadXML()
        {
            empresa      = Empresa.Get();
            preferencias = Preferencias.Get(Entorno.USUARIO);
            string value = "";

            if (preferencias != null)
            {
                checkControlaInventario.Checked  = preferencias.ControlaInventario;
                checkUltimaConfiguracion.Checked = preferencias.UltimaConfiguracion;
                txtLetraCambio.Text            = preferencias.MensajeTituloValor;
                txtAdvertencia.Text            = preferencias.MensajeCentralRiesgo;
                txtFirmaRemision.Text          = preferencias.FirmaRemision;
                txtFirmaFactura.Text           = preferencias.FirmaFactura;
                txtFirmaComprobante.Text       = preferencias.FirmaComprobante;
                txtFirmaNotas.Text             = preferencias.FirmaNotas;
                txtFirmaOrdenCompra.Text       = preferencias.FirmaOrdenCompra;
                txtFirmaOrdenPedido.Text       = preferencias.FirmaOrdenPedido;
                txtFirmaCotizacion.Text        = preferencias.FirmaCotizacion;
                txtColor.Text                  = preferencias.ColorConsecutivo;
                txtPlantillaObservacion1.Text  = preferencias.ObservacionDocumento;
                txtPlantillaObservacion2.Text  = preferencias.OtraObservacionDocumento;
                checkActivarPuntoVenta.Checked = preferencias.ActivarPuntoVenta;
                checkEnvioFormaAnonima.Checked = preferencias.EnvioInformacionAnonima;
                if (preferencias.ActivarPuntoVenta)
                {
                    if (preferencias.TerceroPuntoVentaID != null)
                    {
                        tercero         = Tercero.Get(preferencias.TerceroPuntoVentaID.GetValueOrDefault());
                        txtTercero.Text = tercero.NombreComercial;
                    }
                    if (preferencias.TipoDocumentoPuntoVentaID != null)
                    {
                        cbTipoDocumentoFactura.SelectedValue = preferencias.TipoDocumentoPuntoVentaID;
                    }
                }
                checkActivarCajonMonedero.Checked = preferencias.ActivarCajonMonedero;
                checkImprimirTirilla.Checked      = preferencias.ImprimirTirilla;
                txtCajonMonedero.Text             = preferencias.CodigoCajonMonedero;
                cbPuertoSalida.Text        = preferencias.PuertoSalida;
                rbRedondeoInferior.Checked = preferencias.RedondeoInferior;
                rbRedondeoSistema.Checked  = preferencias.RedondeoSistema;
                rbRedondeoSuperior.Checked = preferencias.RedondeoSuperior;
                TipoMoneda tipoMoneda = TipoMoneda.Get(preferencias.TipoMonedaID.GetValueOrDefault());
                if (tipoMoneda != null)
                {
                    cbTipoMoneda.SelectedValue = tipoMoneda.ID;
                }
                else
                {
                    cbTipoMoneda.SelectedIndex = cbTipoMoneda.FindString(TIPO_MONEDA);
                }
                nudNumeroDecimal.Value = preferencias.NumeroDecimal;
                string separadorMiles = preferencias.SeparadorMiles;
                if (separadorMiles == "es-CO")
                {
                    rbComa.Checked = true;
                }
                else
                {
                    rbPunto.Checked = true;
                }
                checkImpresionEncabezado.Checked = preferencias.ImpresionEncabezado;
                checkImpresionLogotipo.Checked   = preferencias.ImpresionLogotipo;
                cbLectorCodigo.Text = preferencias.BusquedaLector;
                if (preferencias.BusquedaLector == string.Empty)
                {
                    cbLectorCodigo.SelectedIndex = 0;
                }
                if (preferencias.PuertoSalida == string.Empty)
                {
                    cbPuertoSalida.SelectedIndex = 0;
                }
                value = preferencias.ImpresoraPredeterminada;
            }
            if (empresa != null)
            {
                txtIdentidad.Text   = empresa.Nit;
                txtRazonSocial.Text = empresa.RazonSocial;
                txtDireccion.Text   = empresa.Direccion;
                txtTelefono.Text    = empresa.TelefonoPrincipal;
                txtEmail.Text       = empresa.Email;
                txtFax.Text         = empresa.Fax;
                txtFrase.Text       = empresa.Frase;
                txtLogo.Text        = empresa.RutaLogo;
                if (empresa.CiudadID != null)
                {
                    Ciudad ciudad = Ciudad.Get(empresa.CiudadID.GetValueOrDefault());
                    Estado estado = Estado.Get(ciudad.EstadoID.GetValueOrDefault());
                    Pais   pais   = Pais.Get(estado.PaisID);
                    cbPais.SelectedValue         = pais.ID;
                    cbDepartamento.SelectedValue = estado.ID;
                    cbMunicipio.SelectedValue    = ciudad.ID;
                }
                else
                {
                    cbPais.SelectedIndex = 0;
                }
                txtCodigoCIIU.Text    = empresa.CodigoCIIU;
                txtOtroTelefono.Text  = empresa.OtroTelefono;
                txtTelefonoMovil.Text = empresa.Movil;
                txtPaginaWeb.Text     = empresa.PaginaWeb;
                txtFondoPapel.Text    = empresa.RutaFondoPapel;
            }
            int selectedIndex = 0;
            int num           = 0;

            foreach (string text in PrinterSettings.InstalledPrinters)
            {
                cbImpresoras.Items.Add(text);
                if (text.Equals(value))
                {
                    selectedIndex = num;
                }
                num++;
            }
            if (num > 0)
            {
                cbImpresoras.SelectedIndex = selectedIndex;
            }

            /*string item = LicenciaXML.GetItem("ClaveAcceso");
             * if (item != string.Empty && Convert.ToBoolean(item)) {
             *      Sistema sistema = new SistemaFactory().GetSistema();
             *      checkClaveAcceso.Checked = sistema.ClaveAcceso;
             * }*/
        }