Beispiel #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            Transaccion.InsertaAbono(this.hiddidcobranza.Value.ToString(), this.txtFecha.Text, this.txtMontoAbono.Text, this.ConceptoAbono.SelectedValue.ToString(), this.tipomoneda.SelectedValue, this.banco.SelectedValue, this.txtFechaPago.Text, this.txtNroCheque.Text, this.txtObservacion.Text, this.txtGirador.Text, this.txtBoletaHonorarios.Text, this.txtSerie.Text, this.docuno.SelectedValue, this.docdos.SelectedValue, this.Session["Usuario"].ToString(), this.TipoComprobante.SelectedValue, "", "", txtnomgirador.Text);
            Transaccion.UpdateGastos(this.hiddidcobranza.Value.ToString());
            string str = "Abonos.aspx?Codigo=" + this.hiddidcobranza.Value.ToString();

            this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Datos guardados correctamente');location.href='" + str.ToString() + "';</script>");
        }
Beispiel #2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (!ValidarCampos())
            {
                return;
            }

            string  strIndicadorAbono = string.Empty;
            int     intIdAbono        = 0;
            decimal decMontoAbono     = ALCSA.FWK.Web.Control.ExtraerValorComoDecimal(txtMontoAbono);
            decimal decTotalParcial   = ALCSA.FWK.Web.Control.ExtraerValorComoDecimal(txtTotalParcial);
            decimal decSaldoAbono     = Decimal.Zero;

            if (decTotalParcial > Decimal.Zero && decMontoAbono > Decimal.Zero)
            {
                strIndicadorAbono = "C";
                decSaldoAbono     = decTotalParcial - decMontoAbono;
            }

            DateTime datFechaMinima     = new DateTime(1900, 1, 1);
            DateTime datFechaUltimoPago = BuscarFechaUltimoCheque();

            DataTable objAbono = Transaccion.InsertaAbono(
                this.hiddidcobranza.Value,
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFecha, datFechaMinima).ToString("yyyyMMdd"),
                this.txtMontoAbono.Text,
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ConceptoAbono).ToString(),
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ddlFormaPago).ToString(),
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(banco).ToString(),
                datFechaUltimoPago.ToString("yyyyMMdd"),
                string.Empty,
                this.txtObservacion.Text,
                txtGirador.Enabled ? this.txtGirador.Text.Trim() : string.Empty,
                this.txtBoletaHonorarios.Text,
                string.Empty,
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ddlNumeroCheques).ToString(),
                "1",
                this.Session["Usuario"].ToString(),
                this.TipoComprobante.SelectedValue,
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ddlNumeroCheques) > 1 ? "S" : string.Empty,
                Consulta.Codigo_cuota_colegio(),
                txtGirador.Enabled ? txtnomgirador.Text.Trim() : string.Empty
                );

            if (objAbono != null && objAbono.Rows.Count > 0)
            {
                intIdAbono = ALCSA.FWK.Texto.ConvertirTextoEnEntero(objAbono.Rows[0][0].ToString());
            }

            if (strIndicadorAbono == "C")
            {
                Transaccion.UpdateAbonoParcialEstado(hiddidcobranza.Value.ToString(), intIdAbono.ToString());
            }

            if (decSaldoAbono > Decimal.Zero)
            {
                Transaccion.InsertaAbonoParcial(
                    hiddidcobranza.Value,
                    "E",
                    decSaldoAbono,
                    Session["Usuario"].ToString()
                    );
            }

            DataTable objProductoJuicio = Consulta.ProductoJuicio(this.hiddidcobranza.Value.ToString());
            string    str7 = "";
            string    str8 = "";

            if (objProductoJuicio != null && objProductoJuicio.Rows.Count > 0)
            {
                str7 = objProductoJuicio.Rows[0]["id_producto"].ToString();
                str8 = objProductoJuicio.Rows[0]["tipocobranza"].ToString();
            }

            if (str8 == "P")
            {
                this.marcarletrapagada();
            }

            if (str8 == "J")
            {
                switch (str7)
                {
                case "1":
                    this.marcarletrapagadamutuo();
                    break;

                case "2":
                    this.marcarletrapagadadocupagare();
                    break;

                case "3":
                    this.marcarletrapagadadocujuicio();
                    break;
                }
            }

            Transaccion.UpdateGastos(hiddidcobranza.Value);
            try
            {
                this.GuardarDesglose(
                    intIdAbono.ToString(),
                    hiddidcobranza.Value,
                    txtGastos.Text
                    );
            }
            catch (Exception) { }

            GuardarCheques(intIdAbono);

            ClientScript.RegisterClientScriptBlock(
                typeof(Page),
                "alerta",
                string.Format("<script>alert('Datos guardados correctamente');location.href='pagoAbono.aspx?Codigo={0}';</script>", this.hiddidcobranza.Value));
        }