Ejemplo n.º 1
0
        public void cargarEmpresa(DataRow fila)
        {
            empresa.idEmpresa = fila.Field <int>("Código");
            List <string> parametros = new List <string>();

            parametros.Add(empresa.idEmpresa.ToString());
            DataRow filaResultado = GeneralC.devuelveUnaFila(Sentencias.EMPRESA_CARGAR, parametros);

            if (filaResultado != null)
            {
                empresa.nit                = filaResultado.Field <string>("Nit");
                empresa.razonSocial        = filaResultado.Field <string>("RazonSocial");
                empresa.codigoHabilitacion = filaResultado.Field <string>("CodigoHabilitacion");
                empresa.ubicacion          = filaResultado.Field <int>("IdMunicipio");
                empresa.direccion          = filaResultado.Field <string>("Direccion");
                empresa.telefono           = filaResultado.Field <string>("Telefono");
                empresa.celular            = filaResultado.Field <string>("Celular");
                empresa.email              = filaResultado.Field <string>("Email");
                empresa.sigla              = filaResultado.Field <string>("Sigla");
                empresa.encabezado         = filaResultado.Field <string>("EncabezadoFactura");
                empresa.pie                = filaResultado.Field <string>("PieFactura");
                empresa.logo               = filaResultado.Field <byte[]>("Logo");
                empresa.idResponsable      = filaResultado.Field <int>("IdTercero");

                txtNit.Text        = empresa.nit;
                txtNombre.Text     = empresa.razonSocial;
                txtDireccion.Text  = empresa.direccion;
                txtTelefono.Text   = empresa.telefono;
                txtCelular.Text    = empresa.celular;
                txtMail.Text       = empresa.email;
                txtEncabezado.Text = empresa.encabezado;
                txtPie.Text        = empresa.pie;
                picLogo.Image      = null;
                if (empresa.logo != null)
                {
                    using (MemoryStream memSt = new MemoryStream(empresa.logo))
                    {
                        picLogo.Image = Image.FromStream(memSt);
                    }
                }

                txtIdentificacionRepresentante.Text = filaResultado.Field <string>("identificacion");
                txtNombreResponsable.Text           = filaResultado.Field <string>("nombreTercero");
                cmbPais.SelectedValue         = filaResultado.Field <int>("IdPais");
                cmbDepartamento.SelectedValue = filaResultado.Field <int>("IdDepartamento");
                cmbCiudad.SelectedValue       = empresa.ubicacion;
                GeneralC.posBuscar(this, tstMenuPatron, tsbNuevo, tsbBuscar, tstModificar, tsbAnular);
            }
        }