protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.DocumentoEstandard1 objDocumento = new ALCSA.Negocio.Cobranzas.DocumentoEstandard1();
            objDocumento.ID                    = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDocumento1);
            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.Guardar();

            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("DocEstandar1{0}{1}", objDocumento.ID, Path.GetExtension(this.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_1,
                    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_1,
                        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_UNO, intIdDocumento), true);
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.DocumentoEstandard2 objDocumento = new ALCSA.Negocio.Cobranzas.DocumentoEstandard2();
            objDocumento.ID         = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDocumento2);
            objDocumento.IdCobranza = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza);

            objDocumento.Txtcaratulajuicio      = ALCSA.FWK.Web.Control.ExtraerValor(txtCaratulaJuicio);
            objDocumento.Txtjuzgado             = ALCSA.FWK.Web.Control.ExtraerValor(txtJuzgado);
            objDocumento.Txtrol                 = ALCSA.FWK.Web.Control.ExtraerValor(txtRol);
            objDocumento.Txttipojuicio          = ALCSA.FWK.Web.Control.ExtraerValor(txtTipoJuicio);
            objDocumento.Txtmateria             = ALCSA.FWK.Web.Control.ExtraerValor(txtMateria);
            objDocumento.Txtdemandante          = ALCSA.FWK.Web.Control.ExtraerValor(txtDemandante);
            objDocumento.Txtdomiciliodemandante = ALCSA.FWK.Web.Control.ExtraerValor(txtDomicilioDemandante);
            objDocumento.Txtrutdemandante       = ALCSA.FWK.Web.Control.ExtraerValor(txtRutDemandante);
            objDocumento.Txtrepresentante       = string.Empty;
            objDocumento.Txtabogado             = ALCSA.FWK.Web.Control.ExtraerValor(txtAbogado);
            objDocumento.Txtdomicilioabogado    = ALCSA.FWK.Web.Control.ExtraerValor(txtDomicilioabogado);
            objDocumento.Txtrutabogado          = ALCSA.FWK.Web.Control.ExtraerValor(txtRutAbogado);
            objDocumento.Txtdemandado           = ALCSA.FWK.Web.Control.ExtraerValor(txtDemandado);
            objDocumento.Txtrutdemandado        = ALCSA.FWK.Web.Control.ExtraerValor(txtRutDemandado);
            objDocumento.Txtrepresentante2      = ALCSA.FWK.Web.Control.ExtraerValor(txtRepresentante2);
            objDocumento.Txtactividad           = ALCSA.FWK.Web.Control.ExtraerValor(txtActividad);
            objDocumento.Txtactividad2          = ALCSA.FWK.Web.Control.ExtraerValor(txtActividad2);
            objDocumento.Txtdomicilio           = ALCSA.FWK.Web.Control.ExtraerValor(txtDomicilio);
            objDocumento.Txtmontodemandado      = ALCSA.FWK.Web.Control.ExtraerValorComoDecimal(txtmontoDemandado);
            objDocumento.Txttitulofunda         = ALCSA.FWK.Web.Control.ExtraerValor(txtNroTitulo);
            objDocumento.Txtnrotitulo           = ALCSA.FWK.Web.Control.ExtraerValor(txtNroTitulo);
            objDocumento.Txttiponotificacion    = ALCSA.FWK.Web.Control.ExtraerValor(txtTipoNotificacion);
            objDocumento.Txtfechasubasta        = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechasubasta);
            objDocumento.Txtminimosubasta       = ALCSA.FWK.Web.Control.ExtraerValor(txtMinimosubasta);
            objDocumento.Txtdocumentosfundantes = ALCSA.FWK.Web.Control.ExtraerValor(txtDocumentosfundantes);
            objDocumento.Txtobservacion         = ALCSA.FWK.Web.Control.ExtraerValor(txtObservacion);

            objDocumento.Guardar();

            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("DocEstandar2{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_2,
                    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_2,
                        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_DOS, intIdDocumento), true);
            }
        }
示例#3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            DataTable table = null;

            table = Consulta.BuscarJuicio(this.hiddidcobranza.Value.ToString());
            if ((table.Rows.Count > 0) && (table != null))
            {
                this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Cobranza ya tiene juicio asociado');</script>");
                this.txtRol.Focus();
                return;
            }

            DateTime datFechaCorte = new DateTime(1900, 1, 1), datFechaRiesgo = new DateTime(1900, 1, 1);

            if (!string.IsNullOrEmpty(txtFechaIngCorte.Text))
            {
                DateTime.TryParseExact(txtFechaIngCorte.Text.Replace("-", "/"), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out datFechaCorte);
            }

            if (!string.IsNullOrEmpty(txtFechaRiesgo.Text))
            {
                DateTime.TryParseExact(txtFechaRiesgo.Text.Replace("-", "/"), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out datFechaRiesgo);
            }

            DataTable table2 = Transaccion.InsertaJuicio(
                this.hiddidcobranza.Value,
                this.Tribunal.SelectedValue,
                this.Abogado.SelectedValue,
                this.Procurador.SelectedValue,
                this.txtRol.Text,
                datFechaCorte,
                this.juris.SelectedValue,
                Convert.ToInt32(ddlRiesgo.SelectedValue),
                datFechaRiesgo
                );

            if (table2 != null && table2.Rows.Count > 0)
            {
                /*string idjuicio = table2.Rows[0][0].ToString();
                 * string nomArchivo = "";
                 * string path = base.Server.MapPath(@"~\DOCUMENTOS");
                 * nomArchivo = "DocJuicio" + idjuicio.ToString() + Path.GetExtension(this.filesubir.PostedFile.FileName);
                 * string str4 = filesubir.HasFile ? UTIL.SubirArchivo(this.filesubir, path, nomArchivo) : "OK";*/

                int intIdDocumento = 0;
                int intIdJuicio    = Convert.ToInt32(table2.Rows[0][0]);

                if (filesubir.HasFile)
                {
                    ALCSA.Negocio.Documentos.Fisicos.Documento objDocumentoFisico = new ALCSA.Negocio.Documentos.Fisicos.Documento()
                    {
                        Nombre              = this.filesubir.PostedFile.FileName,
                        Descripcion         = string.Empty,
                        CodigoTipoDocumento = TipoDocumento.TIPO_DOCUMENTO_JUICIO,
                        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 = hiddidcobranza.Value
                        },
                        new ALCSA.Negocio.Documentos.Fisicos.Identificador()
                        {
                            CodigoTipoIdentificador = TipoIdentificador.TIPO_IDENTIFICADOR_JUICIO,
                            Valor = intIdJuicio.ToString()
                        }
                    });

                    intIdDocumento = objDocumentoFisico.ID;
                }

                /*if (str4 != "OK")
                 *  this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('" + str4.ToString() + "');</script>");
                 * else if (!string.IsNullOrEmpty(nomArchivo))
                 *  Transaccion.UpdateDocumentoJuicio(idjuicio, nomArchivo);*/

                this.Page.RegisterClientScriptBlock("Mensaje",
                                                    string.Format("<script>alert('Datos guardados correctamente');location.href='ActividadCobranza.aspx?Codigo={0}&idCobranza={1}&termino=N&id_doc={2}';</script>", intIdJuicio, hiddidcobranza.Value, intIdDocumento)
                                                    );
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.DocumentoPagare objDocumento = new ALCSA.Negocio.Cobranzas.DocumentoPagare();
            objDocumento.ID         = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDocuPagare);
            objDocumento.IdCobranza = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza);

            objDocumento.Nropagare   = txtNroPagare.Text;
            objDocumento.IdDomicilio = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDireccionPagare);

            objDocumento.RutRepresentante1 = txtRutAval1.Text.Replace(".", string.Empty).Trim();
            objDocumento.IdDomiRepre1      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDireccionAval1);

            objDocumento.RutRepresentante2 = txtRutAval2.Text.Replace(".", string.Empty).Trim();
            objDocumento.IdDomiRepre2      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDireccionAval1);

            objDocumento.Montodemanda         = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtMontoDemanda);
            objDocumento.Montotaldeuda        = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtMontoTotalDeuda);
            objDocumento.Fsuscripcion         = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaSuscripcion);
            objDocumento.Sumainisuscripcion   = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtSumaInicialSuscripcion);
            objDocumento.IdMoneda             = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdTipoMoneda);
            objDocumento.Nrocuotas            = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtNroCuotas);
            objDocumento.Tasainteres          = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtTasaInteres);
            objDocumento.Vcto1cuota           = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtVcto1cuota);
            objDocumento.Vctosiguientescuotas = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtVstoSgteCuotas);
            objDocumento.Monto1cuotas         = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtMonto1cuota);
            objDocumento.Montoultimacuota     = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtMontoUltCuota);
            objDocumento.Fmora              = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechamora);
            objDocumento.Fprescripcion      = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechaprescripcion);
            objDocumento.Fliquidacion       = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaLiquidacion);
            objDocumento.IdComunaExhorto    = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdComunaExhorto);
            objDocumento.Fautorizacionfirma = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaAutoriFirma);
            objDocumento.IdNotaria          = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdNotario);
            objDocumento.IdComunaNotaria    = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdLocalidadNotario);
            objDocumento.Observacion        = txtObservacion.Text.Trim();

            objDocumento.Guardar();

            int intIdDocumento = 0;

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

                // GUARDAR ARCHIVO EN BASE DE DATOS
                ALCSA.Negocio.Documentos.Fisicos.Documento objDocumentoFisico = new ALCSA.Negocio.Documentos.Fisicos.Documento()
                {
                    Nombre              = this.filesubir.PostedFile.FileName,
                    Descripcion         = string.Empty,
                    CodigoTipoDocumento = TipoDocumento.TIPO_DOCUMENTO_PAGARE,
                    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_PAGARE,
                        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_PAGARE, intIdDocumento), true);
            }
        }
示例#5
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.Mutuo objMutuo = new ALCSA.Negocio.Cobranzas.Mutuo();

            objMutuo.ID         = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdMutuo);
            objMutuo.IdCobranza = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza);

            objMutuo.IdBienRaiz  = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdDomicilioInmueble);
            objMutuo.IdMoneda    = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(moneda);
            objMutuo.Subproducto = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdSubProducto);

            objMutuo.Nrodocumento = txtNroDocum.Text;
            objMutuo.SerieLetCred = txtSerieLetraCred.Text;

            objMutuo.MontoCred1Esc      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtMontoCred1esc);
            objMutuo.MontoCred2Esc      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtMontoCred2esc);
            objMutuo.PlazoMutuoMes      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtPlazoMutuoMeses);
            objMutuo.N1DivImpago        = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtNumero1Divimpago);
            objMutuo.NUltDivImpago      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtNumeroUltDivImpago);
            objMutuo.MontoDivAdeudadoPs = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtMontoDivAdeudadoPESO);
            objMutuo.TotalAdeudado      = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtTotalAdeudado);

            objMutuo.TazaInt1Esc        = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtTasaInt1Esc);
            objMutuo.TazaInt2Esc        = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtTasaInt2Esc);
            objMutuo.MontoDivAdeudadoUf = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtMontoDivAdeudadoUF);
            objMutuo.SaldoTotalDeudaUf  = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtSaldoTotalDeudaUF);

            objMutuo.FechaPrescripcion = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaPrescripcion);
            objMutuo.Fecha1Venc        = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFecha1Vcto);
            objMutuo.FechaLiquidacion  = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaLiquidacion);
            objMutuo.FechaMora         = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaMora);

            objMutuo.Guardar();

            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("DocMutuo{0}{1}", objMutuo.ID, Path.GetExtension(this.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_MUTUO,
                    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 = objMutuo.IdCobranza.ToString()
                    },
                    new ALCSA.Negocio.Documentos.Fisicos.Identificador()
                    {
                        CodigoTipoIdentificador = TipoIdentificador.TIPO_IDENTIFICADOR_MUTUO,
                        Valor = objMutuo.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}", objMutuo.IdCobranza, ALCSA.Negocio.Cobranzas.Cobranza.TIPO_COBRANZA_MUTUO, intIdDocumento), true);
            }
        }
示例#6
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            DataTable table = ConsultasEspecificas.BuscarExhortoDupli(this.hiddidjuicio.Value.ToString(), this.tribunalexhorto.SelectedValue.ToString(), this.txtRolExhorto.Text);

            if (table != null && table.Rows.Count > 0)
            {
                this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Exhorto ya est\x00e1 registrado');</script>");
                this.tipoexhorto.Focus();
            }
            else
            {
                int intIdExhorto = Transaccion.InsertaExhorto(
                    this.hiddidjuicio.Value.ToString(),
                    this.tribunalexhorto.SelectedValue,
                    this.procurador.SelectedValue,
                    this.tipoexhorto.SelectedValue,
                    this.receptor.SelectedValue,
                    this.txtFechaingreso.Text,
                    this.txtRolExhorto.Text,
                    this.juris.SelectedValue.ToString(),
                    Convert.ToInt32(ddlComunas.SelectedValue)
                    );

                if (intIdExhorto > 0)
                {
                    int intIdDocumento = 0;

                    if (filesubir.HasFile)
                    {
                        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_1,
                            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_EXHORTO,
                                Valor = intIdExhorto.ToString()
                            },
                            new ALCSA.Negocio.Documentos.Fisicos.Identificador()
                            {
                                CodigoTipoIdentificador = TipoIdentificador.TIPO_IDENTIFICADOR_JUICIO,
                                Valor = hiddidjuicio.Value
                            }
                        });

                        intIdDocumento = objDocumentoFisico.ID;
                    }

                    this.Page.RegisterClientScriptBlock("Mensaje", string.Format("<script>location.href='BuscaCobranzaExhortos.aspx?mensaje=1&id_doc={0}';</script>", intIdDocumento));

                    /*
                     * string idexhorto = intIdExhorto.ToString();
                     * string nomArchivo = "";
                     * string path = base.Server.MapPath(@"~\DOCUMENTOS");
                     * nomArchivo = "DocExhorto" + idexhorto.ToString() + Path.GetExtension(this.filesubir.PostedFile.FileName);
                     * string str4 = UTIL.SubirArchivo(this.filesubir, path, nomArchivo);
                     * if (!(str4 == "OK"))
                     * {
                     *  this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('" + str4.ToString() + "');</script>");
                     * }
                     * else if (!string.IsNullOrEmpty(nomArchivo))
                     * {
                     *  Transaccion.UpdateDocumentoExhorto(idexhorto, nomArchivo);
                     *
                     * }
                     */
                }
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            ALCSA.Negocio.Cobranzas.CuotaColegio objDocumento = new ALCSA.Negocio.Cobranzas.CuotaColegio();
            objDocumento.ID         = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCuotaColegio);
            objDocumento.IdCobranza = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza);

            objDocumento.Representante1 = ALCSA.FWK.Web.Control.ExtraerValor(txtRutRepresentante1).Replace(".", string.Empty);
            objDocumento.Representante2 = ALCSA.FWK.Web.Control.ExtraerValor(txtRutRepresentante2).Replace(".", string.Empty);

            objDocumento.Nrodocumento         = ALCSA.FWK.Web.Control.ExtraerValor(txtnrodocumento);
            objDocumento.IdTipoDocu           = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdTipoDocumento);
            objDocumento.Codigo               = ALCSA.FWK.Web.Control.ExtraerValor(txtcodigo);
            objDocumento.IdBanco              = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdBanco);
            objDocumento.Serie                = ALCSA.FWK.Web.Control.ExtraerValor(txtserie);
            objDocumento.Nrocuota             = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtnrocuota);
            objDocumento.Fechamora            = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechamora);
            objDocumento.Fechaingresocobranza = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechaingresocobranza);
            objDocumento.Fechavencimiento     = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechavcto);
            objDocumento.Fprescripcion        = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtfechaprescripcion);
            objDocumento.Mesmora              = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdMes);
            objDocumento.Aniomora             = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtaniomora);
            objDocumento.Montocapital         = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtmontocapital);
            objDocumento.Abonos               = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtabonos);
            objDocumento.Montointeres         = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtmontointeres);
            objDocumento.Saldodeuda           = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(txtsaldodeuda);
            objDocumento.Observacion          = ALCSA.FWK.Web.Control.ExtraerValor(txtobservacion);

            objDocumento.Guardar();

            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("CuotaColegio{0}{1}", objDocumento.ID, Path.GetExtension(this.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_CUOTA_COLEGIO,
                    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_CUOTA_COLEGIO,
                        Valor = objDocumento.ID.ToString()
                    }
                });

                intIdDocumento = objDocumentoFisico.ID;
            }

            // GENERAR ARCHIVO

            /*
             *  string text2 = dataTable3.Rows[0][0].ToString();
             *  string path = base.Server.MapPath("~\\DOCUMENTOS");
             *  string text3 = "DocCuotaColegio" + text2.ToString();
             *  text3 += Path.GetExtension(this.filesubir.PostedFile.FileName);
             *  string text4 = UTIL.SubirArchivo(this.filesubir, path, text3);
             *  Transaccion.UpdateDocumentoCuotaColegio(text2, text3);
             */

            // 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_CUOTA_COLEGIO, intIdDocumento), true);
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            // ----------------------------------------------------------------------------------
            int intPrimerId = 0;

            ALCSA.Negocio.Cobranzas.DocumentoJuicio objDocumento = null;
            // ----------------------------------------------------------------------------------
            foreach (GridViewRow objFila in gvDocumentos.Rows)
            {
                objDocumento = CrearObjetoDocuJuicio();

                objDocumento.Nrodocumento    = ALCSA.FWK.Web.Control.ExtraerValor(objFila.FindControl("txtNroDocumento") as TextBox).Trim();
                objDocumento.Numcheque       = objDocumento.Nrodocumento;
                objDocumento.Monto           = ALCSA.FWK.Web.Control.ExtraerValorComoFloat(objFila.FindControl("txtMonto") as TextBox);
                objDocumento.IdTipoDocumento = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(objFila.FindControl("ddlTiposDocumentos") as DropDownList);
                objDocumento.Fvencimiento    = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(objFila.FindControl("txtFechaVencimiento") as TextBox);
                objDocumento.ID = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(objFila.FindControl("hdfIdDocumentoJuicio") as HiddenField);

                if (objDocumento.IdTipoDocumento > 0 && !string.IsNullOrEmpty(objDocumento.Nrodocumento))
                {
                    objDocumento.Guardar();
                    if (intPrimerId.Equals(0))
                    {
                        intPrimerId = objDocumento.ID;
                    }
                }
                else if (objDocumento.ID > 0)
                {
                    objDocumento.Eliminar();
                }
            }
            // ----------------------------------------------------------------------------------
            // NO SE INGRESARON DOCUMENTOS
            if (intPrimerId.Equals(0))
            {
                objDocumento = CrearObjetoDocuJuicio();
                objDocumento.Guardar();
                intPrimerId = objDocumento.ID;
            }
            // ----------------------------------------------------------------------------------
            int intIdDocumento = 0;

            if (filesubir.HasFile)
            {
                // string nomArchivo = string.Format("DocJuicio{0}{1}", intPrimerId, Path.GetExtension(this.filesubir.PostedFile.FileName));
                // string str8 = ALCLOCAL.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_JUICIO,
                    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_JUICIO,
                        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_JUICIO, intIdDocumento), true);
            }
            // ----------------------------------------------------------------------------------
        }