public void Insertar(ALCSA.Entidades.Cobranzas.DocumentoJuicio documento) { ALCSA.FWK.BD.Servicio objServicio = new ALCSA.FWK.BD.Servicio(); objServicio.Conexion = Conexion.ALCSA; objServicio.Comando = "dbo.SPALC_DOCUJUICIO_INSERTAR"; objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Actaprotesto", Valor = documento.Actaprotesto, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Ctacte", Valor = documento.Ctacte, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Direccionacta", Valor = documento.Direccionacta, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Faceptacion", Valor = documento.Faceptacion, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fautorizacionnotarial", Valor = documento.Fautorizacionnotarial, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fdeuda", Valor = documento.Fdeuda, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fgiroemision", Valor = documento.Fgiroemision, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fprescripcion", Valor = documento.Fprescripcion, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fproceso", Valor = documento.Fproceso, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@DAT_Fvencimiento", Valor = documento.Fvencimiento, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdBanco", Valor = documento.IdBanco, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdCobranza", Valor = documento.IdCobranza, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdComunaNotario", Valor = documento.IdComunaNotario, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdDomicilio", Valor = documento.IdDomicilio, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdDomicilioEndosante", Valor = documento.IdDomicilioEndosante, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdNotario", Valor = documento.IdNotario, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@CHR_Mch", Valor = documento.Mch, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@FLT_Monto", Valor = documento.Monto, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Nrodocumento", Valor = documento.Nrodocumento, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Numcheque", Valor = documento.Numcheque, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Numserie", Valor = documento.Numserie, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Observacion", Valor = documento.Observacion, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@CHR_Pagado", Valor = documento.Pagado, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Representante1", Valor = documento.Representante1, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Representante2", Valor = documento.Representante2, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_RutDeudorEndosante", Valor = documento.RutDeudorEndosante, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Tituloconstadeuda", Valor = documento.Tituloconstadeuda, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@VC_Urldocumento", Valor = documento.Urldocumento, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdTipoDocumento", Valor = documento.IdTipoDocumento, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada }); objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro() { Nombre = "@INT_IdDocuJuicioSalida", Valor = 0, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Salida }); objServicio.EjecutarSinRetorno(); documento.ID = Convert.ToInt32(objServicio.Parametros[objServicio.Parametros.Count - 1].Valor); }
protected void Page_Load(object sender, EventArgs e) { // ---------------------------------------------------------------------------------- if (this.Page.IsPostBack) { return; } // ---------------------------------------------------------------------------------- ALCSA.Negocio.ServiciosJson.ListadorConceptos objConcepto = new ALCSA.Negocio.ServiciosJson.ListadorConceptos(); ddlNotarios.DataSource = objConcepto.Listar("NOTARIOS"); ddlNotarios.DataBind(); ddlNotarios.Items.Insert(0, new ListItem("...", "0")); ddlLocalidadesNotarios.DataSource = objConcepto.Listar("COMUNAS_NOTARIO"); ddlLocalidadesNotarios.DataBind(); ddlLocalidadesNotarios.Items.Insert(0, new ListItem("...", "0")); ddlBancos.DataSource = objConcepto.Listar("BANCOS"); ddlBancos.DataBind(); ddlBancos.Items.Insert(0, new ListItem("...", "0")); // ---------------------------------------------------------------------------------- int intIdCobranza = ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "id_cob"); if (intIdCobranza < 1) { return; } hdfIdEsCobranzaNueva.Value = ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "es_nueva").ToString(); btnGuardar.Text = hdfIdEsCobranzaNueva.Value.Equals("1") ? "GUARDAR" : "GUARDAR Y GENERAR"; // ---------------------------------------------------------------------------------- ALCSA.Negocio.Cobranzas.Cobranza objCobranza = new ALCSA.Negocio.Cobranzas.Cobranza(intIdCobranza); ALCSA.FWK.Web.Control.AsignarValor(hdfIdCobranza, objCobranza.ID); // ---------------------------------------------------------------------------------- AsignarTitulo(objCobranza.IdMateria); // ---------------------------------------------------------------------------------- txtNumeroOperacion.Text = objCobranza.Nrooperacion; txtRutCliente.Text = ALCSA.FWK.IdentificacionTributaria.FormatearRut(objCobranza.RutCli); txtRutDeudor.Text = ALCSA.FWK.IdentificacionTributaria.FormatearRut(objCobranza.RutDeudor); txtNombreCliente.Text = objCobranza.NombreCliente; txtNombreDeudor.Text = objCobranza.NombreDeudor; // ---------------------------------------------------------------------------------- CambiarColorControlesSoloLectura(); // ---------------------------------------------------------------------------------- IList <ALCSA.Entidades.Cobranzas.DocumentoJuicio> arrDocumentos = new ALCSA.Negocio.Cobranzas.DocumentoJuicio().Listar(intIdCobranza); // ---------------------------------------------------------------------------------- if (arrDocumentos.Count > 0) { ALCSA.Entidades.Cobranzas.DocumentoJuicio objDocumento = arrDocumentos[0]; ALCSA.FWK.Web.Control.AsignarValor(hdfIdDomicilioDeudor, objDocumento.IdDomicilio); txtRutRepresentanteUno.Text = ALCSA.FWK.IdentificacionTributaria.FormatearRut(objDocumento.Representante1); txtRutRepresentanteDos.Text = ALCSA.FWK.IdentificacionTributaria.FormatearRut(objDocumento.Representante2); txtRutEndosante.Text = ALCSA.FWK.IdentificacionTributaria.FormatearRut(objDocumento.RutDeudorEndosante); ALCSA.FWK.Web.Control.AsignarValor(hdfIdDomicilioEndosante, objDocumento.IdDomicilioEndosante); ALCSA.FWK.Web.Control.AsignarValor(txtFechaAceptacion, objDocumento.Faceptacion); ALCSA.FWK.Web.Control.SeleccionarValor(ddlNotarios, objDocumento.IdNotario); ALCSA.FWK.Web.Control.SeleccionarValor(ddlLocalidadesNotarios, objDocumento.IdComunaNotario); ALCSA.FWK.Web.Control.AsignarValor(txtFechaAutorizacionNotarial, objDocumento.Fautorizacionnotarial); txtTituloConstaDeuda.Text = objDocumento.Tituloconstadeuda; ALCSA.FWK.Web.Control.AsignarValor(txtFechaDeuda, objDocumento.Fdeuda); ALCSA.FWK.Web.Control.SeleccionarValor(ddlBancos, objDocumento.IdBanco); txtCtacte.Text = objDocumento.Ctacte; txtserie.Text = objDocumento.Numserie; ALCSA.FWK.Web.Control.AsignarValor(txtFechaGiroEmision, objDocumento.Fgiroemision); ALCSA.FWK.Web.Control.AsignarValor(txtfechaprescripcion, objDocumento.Fprescripcion); txtActaProtesto.Text = objDocumento.Actaprotesto; txtDireccionActa.Text = objDocumento.Direccionacta; txtObservacion.Text = objDocumento.Observacion; txtNombreRepresentanteUno.Text = objDocumento.NombreRepresentanteUno; txtNombreRepresentanteDos.Text = objDocumento.NombreRepresentanteDos; txtNombreEndosante.Text = objDocumento.NombreEndosante; txtDomicilioEndosante.Text = objDocumento.DireccionEndosante; txtDomicilioDeudor.Text = objDocumento.DireccionDeudor; IList <ALCSA.Entidades.Documentos.Fisicos.Documento> arrDocumentosFisicos = new ALCSA.Negocio.Documentos.Fisicos.Documento().Listar( objDocumento.IdCobranza.ToString(), ALCSA.Negocio.Documentos.Fisicos.TipoIdentificador.TIPO_IDENTIFICADOR_COBRANZA); if (arrDocumentosFisicos != null && arrDocumentosFisicos.Count > 0) { gvDocumentosFisicos.DataSource = arrDocumentosFisicos; gvDocumentosFisicos.DataBind(); } } // ---------------------------------------------------------------------------------- while (arrDocumentos.Count < 10) { arrDocumentos.Add(new ALCSA.Entidades.Cobranzas.DocumentoJuicio() { ID = 0, Monto = 0, Nrodocumento = string.Empty, IdTipoDocumento = 0 }); } gvDocumentos.DataSource = arrDocumentos; gvDocumentos.DataBind(); foreach (GridViewRow objFila in gvDocumentos.Rows) { TextBox txtFecha = objFila.FindControl("txtFechaVencimiento") as TextBox; txtFecha.Text = txtFecha.Text.Replace("-", "/"); if (ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFecha).Year < 1950) { txtFecha.Text = string.Empty; } } // ---------------------------------------------------------------------------------- txtNumeroOperacion.Focus(); // ---------------------------------------------------------------------------------- }