protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.DocumentoEstandard4 objDocumento = new ALCSA.Negocio.Cobranzas.DocumentoEstandard4();
            objDocumento.ID         = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDocumento4);
            objDocumento.IdCobranza = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza);

            objDocumento.RutDemandado2         = ALCSA.FWK.Web.Control.ExtraerValor(txtRutDeudor2).Replace(".", string.Empty);
            objDocumento.IdDomicilioDemandado  = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDomicilioDeudor);
            objDocumento.IdDomicilioDemandado2 = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDomicilioDeudor2);
            objDocumento.RutRepresLegal        = ALCSA.FWK.Web.Control.ExtraerValor(txtRutRepresentante).Replace(".", string.Empty);
            objDocumento.NomRepresLegal        = ALCSA.FWK.Web.Control.ExtraerValor(txtNombreRepresentante);
            objDocumento.DireRepresLegal       = ALCSA.FWK.Web.Control.ExtraerValor(txtDireccionRepresentante);
            objDocumento.ProfesionRepresLegal  = ALCSA.FWK.Web.Control.ExtraerValor(txtProfesionOficioRepresentante);
            objDocumento.Cuantia             = ALCSA.FWK.Web.Control.ExtraerValorComoDecimal(txtcuantia);
            objDocumento.RelacionHechos      = ALCSA.FWK.Web.Control.ExtraerValor(txtRelaciondeloshechos);
            objDocumento.Petitorio           = ALCSA.FWK.Web.Control.ExtraerValor(txtPetitorio);
            objDocumento.DocFundantes        = ALCSA.FWK.Web.Control.ExtraerValor(txtdocumentosfundantes);
            objDocumento.Observacion         = ALCSA.FWK.Web.Control.ExtraerValor(txtObservacion);
            objDocumento.Delito              = ALCSA.FWK.Web.Control.ExtraerValor(txtDelito);
            objDocumento.FechaComisionDelito = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaComisionDelito);
            objDocumento.SituacionAutor      = ALCSA.FWK.Web.Control.ExtraerValor(txtsituacionautor);

            objDocumento.Guardar();

            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("DocEstandar4{0}{1}", objDocumento.ID, Path.GetExtension(filesubir.PostedFile.FileName));
                // string str8 = UTIL.SubirArchivo(filesubir, Server.MapPath(@"~\DOCUMENTOS"), nomArchivo);

                ALCSA.Negocio.Documentos.Fisicos.Documento objDocumentoFisico = new ALCSA.Negocio.Documentos.Fisicos.Documento()
                {
                    Nombre              = this.filesubir.PostedFile.FileName,
                    Descripcion         = string.Empty,
                    CodigoTipoDocumento = TipoDocumento.TIPO_DOCUMENTO_ESTANDAR_4,
                    FechaIngreso        = DateTime.Now,
                    IdTipoDocumento     = 0,
                    Peso    = this.filesubir.PostedFile.ContentLength,
                    Archivo = this.filesubir.FileBytes
                };
                objDocumentoFisico.Insertar(new List <ALCSA.Entidades.Documentos.Fisicos.Identificador>()
                {
                    new ALCSA.Negocio.Documentos.Fisicos.Identificador()
                    {
                        CodigoTipoIdentificador = TipoIdentificador.TIPO_IDENTIFICADOR_COBRANZA,
                        Valor = objDocumento.IdCobranza.ToString()
                    },
                    new ALCSA.Negocio.Documentos.Fisicos.Identificador()
                    {
                        CodigoTipoIdentificador = TipoIdentificador.TIPO_IDENTIFICADOR_DOCUMENTO_ESTANDAR_4,
                        Valor = objDocumento.ID.ToString()
                    }
                });

                intIdDocumento = objDocumentoFisico.ID;
            }

            // GENERAR ARCHIVO
            if (ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdEsCobranzaNueva) == 1)
            {
                Response.Redirect(string.Format("Cobranza.aspx?mensaje=1&id_doc={0}", intIdDocumento), true);
            }
            else
            {
                Response.Redirect(string.Format("../Demandas/DatosCobranza.aspx?gen_doc=1&id_cob={0}&tipo={1}&id_doc={2}", objDocumento.IdCobranza, ALCSA.Negocio.Cobranzas.Cobranza.TIPO_COBRANZA_DOCUMENTO_ESTANDAR_CUATRO, intIdDocumento), true);
            }
        }