private void btnAceptar_Click(object sender, EventArgs e)
        {
            CuentasxCobrarTMBE CuentasxCobrarTMBE = new CuentasxCobrarTMBE()
            {
                USUARIO          = General.General.GetCodigoUsuario,
                gPlazaID         = General.General.gPlazaID,
                gFechaOp         = General.General.gFechaOp,
                OPCION           = 2,
                ctaCobrarID      = txtctaCobrarID.Text,
                clienteID        = _IdSocio,
                tipCxcID         = cbotipCxcID.SelectedValue.ToString(),
                referenciaID     = _IdLote,
                cxcImpComis      = 0, //'String.IsNullOrEmpty(txtcxcImpComis.Text.Trim()) ? 0 : Convert.ToDecimal(txtcxcImpComis.Text),
                cxcImpComp       = String.IsNullOrEmpty(txtcxcImpComis.Text.Trim()) ? 0 : Convert.ToDecimal(txtcxcImpComis.Text),
                cxcNumCuotas     = 1,
                cxcPeriodicidad  = String.IsNullOrEmpty(txtcxcPeriodicidad.Text.Trim()) ? 0 : int.Parse(txtcxcPeriodicidad.Text),
                cxcFecEmision    = dtcxcFecEmision.Value,
                cxcFecInicio     = dtcxcFecEmision.Value,
                valorFormaPagoID = String.IsNullOrEmpty(cbovalorFormaPagoID.SelectedValue.ToString()) ? 0 : Convert.ToDecimal(cbovalorFormaPagoID.SelectedValue.ToString()),
                cxcImporteDesc   = String.IsNullOrEmpty(txtcxcImporteDesc.Text.Trim()) ? 0 : Convert.ToDecimal(txtcxcImporteDesc.Text),
                valorTipoDesemID = String.IsNullOrEmpty(cbovalorTipoDesemID.SelectedValue.ToString()) ? 0 : Convert.ToDecimal(cbovalorTipoDesemID.SelectedValue.ToString()),
                numOperacion     = txtnumOperacion.Text,
                cxcDiaPagoFijo   = 0, //String.IsNullOrEmpty(txtcxcDiaPagoFijo.Text.Trim()) ? 0 : int.Parse(txtcxcDiaPagoFijo.Text),
                cxcGlosa         = txtcxcGlosa.Text,
                Tipo             = rbtCxc.Checked ? "001" : "002",
            };

            DataSet dsCuentasxCobrarTM = new DataSet();

            dsCuentasxCobrarTM = CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);

            MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Dispose();
        }
        private void CargarDatos()
        {
            try
            {
                // Cargar CxC
                DataSet            ds = new DataSet();
                CuentasxCobrarTMBE CuentasxCobrarTMBE = new CuentasxCobrarTMBE()
                {
                    OPCION      = 1,
                    USUARIO     = General.General.GetUsuario,
                    IdLote      = _IdLote,
                    clienteID   = _IdSocio,
                    IdMoneda_tt = _Table_IdMoneda
                };

                ds = CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);
                dgvCuentasxCobrarTM.DataSource = ds.Tables[0];

                // Cargar CxP
                DataSet dsCxP = new DataSet();
                CuentasxCobrarTMBE.OPCION = 4;


                dsCxP = CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);
                dgvCuentasxPagarTM.DataSource = dsCxP.Tables[0];

                foreach (DataGridViewRow row in dgvCuentasxPagarTM.Rows)
                {
                    if (row.Cells["FlgBloqueo"].Value.ToString().Equals("1"))
                    {
                        row.Cells["CheckSel"].ReadOnly = true;
                        row.DefaultCellStyle.ForeColor = Color.Red;
                    }
                }

                //Gasto Notatial
                CuentasxCobrarTMBE.OPCION = 6;
                dgvGN.DataSource          = CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE).Tables[0];

                if (_Table_IdMoneda == "00036")  //Soles
                {
                    dgvCuentasxCobrarTM.Columns["TotalCalculado"].HeaderText   = "Total S/.";
                    dgvCuentasxPagarTM.Columns["TotalCalculadoCXP"].HeaderText = "Total S/.";
                    dgvGN.Columns["TotalCalculadoGN"].HeaderText = "Total S/.";
                }
                else
                {
                    dgvCuentasxCobrarTM.Columns["TotalCalculado"].HeaderText   = "Total US$";
                    dgvCuentasxPagarTM.Columns["TotalCalculadoCXP"].HeaderText = "Total US$";
                    dgvGN.Columns["TotalCalculadoGN"].HeaderText = "Total US$";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void LlenarTipoCuenta()
 {
     try
     {
         CuentasxCobrarTMBE CuentasxCobrarTMBE = new CuentasxCobrarTMBE()
         {
             USUARIO     = General.General.GetCodigoUsuario,
             IdMoneda_tt = _Table_IdMoneda,
             Tipo        = rbtCxc.Checked ? "001" : "002",
             OPCION      = 5,
         };
         General.General.LlenarCombobox(cbotipCxcID, "tipCxcNombre", "tipCxcID", CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE).Tables[0]);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 4
0
        public DataSet ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("CuentasMovimientos_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "gPlazaID", DbType.String, BE.gPlazaID);
                if (BE.gFechaOp != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "gFechaOp", DbType.DateTime, BE.gFechaOp);
                }
                db.AddInParameter(cmd, "ctaCobrarID", DbType.String, BE.ctaCobrarID);
                db.AddInParameter(cmd, "clienteID", DbType.String, BE.clienteID);
                db.AddInParameter(cmd, "tipCxcID", DbType.String, BE.tipCxcID);
                db.AddInParameter(cmd, "referenciaID", DbType.String, BE.referenciaID);
                db.AddInParameter(cmd, "cxcImpComis", DbType.Decimal, BE.cxcImpComis);
                db.AddInParameter(cmd, "cxcImpComp", DbType.Decimal, BE.cxcImpComp);
                db.AddInParameter(cmd, "cxcNumCuotas", DbType.Int32, BE.cxcNumCuotas);
                db.AddInParameter(cmd, "cxcPeriodicidad", DbType.Int32, BE.cxcPeriodicidad);
                if (BE.cxcFecEmision != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "cxcFecEmision", DbType.DateTime, BE.cxcFecEmision);
                }
                if (BE.cxcFecInicio != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "cxcFecInicio", DbType.DateTime, BE.cxcFecInicio);
                }
                if (BE.cxcFechaCrea != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "cxcFechaCrea", DbType.DateTime, BE.cxcFechaCrea);
                }
                if (BE.cxcFechaMod != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "cxcFechaMod", DbType.DateTime, BE.cxcFechaMod);
                }
                db.AddInParameter(cmd, "cxcUsuarioCrea", DbType.String, BE.cxcUsuarioCrea);
                db.AddInParameter(cmd, "cxcUsuarioMod", DbType.String, BE.cxcUsuarioMod);
                db.AddInParameter(cmd, "cxcEstado", DbType.Boolean, BE.cxcEstado);
                db.AddInParameter(cmd, "cxcImpSaldoComp", DbType.Decimal, BE.cxcImpSaldoComp);
                db.AddInParameter(cmd, "cxcImpSaldoComis", DbType.Decimal, BE.cxcImpSaldoComis);
                db.AddInParameter(cmd, "valorEstadoCxCID", DbType.Decimal, BE.valorEstadoCxCID);
                if (BE.cxcFechaCan != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "cxcFechaCan", DbType.DateTime, BE.cxcFechaCan);
                }
                db.AddInParameter(cmd, "valorFormaPagoID", DbType.Decimal, BE.valorFormaPagoID);
                db.AddInParameter(cmd, "cxcImporteDesc", DbType.Decimal, BE.cxcImporteDesc);
                db.AddInParameter(cmd, "gesCuentaID", DbType.String, BE.gesCuentaID);
                db.AddInParameter(cmd, "gesCobranzaID", DbType.String, BE.gesCobranzaID);
                db.AddInParameter(cmd, "valorTipoDesemID", DbType.Decimal, BE.valorTipoDesemID);
                db.AddInParameter(cmd, "numOperacion", DbType.String, BE.numOperacion);
                db.AddInParameter(cmd, "cxcDiaPagoFijo", DbType.Int32, BE.cxcDiaPagoFijo);
                db.AddInParameter(cmd, "cxcGlosa", DbType.String, BE.cxcGlosa);
                db.AddInParameter(cmd, "IdMoneda_tt", DbType.String, BE.IdMoneda_tt);
                db.AddInParameter(cmd, "IdLote", DbType.String, BE.IdLote);
                db.AddInParameter(cmd, "Tipo", DbType.String, BE.Tipo);
                db.AddInParameter(cmd, "valorMonedaID", DbType.Decimal, BE.valorMonedaID);
                db.AddInParameter(cmd, "Monto", DbType.Decimal, BE.Monto);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
        private void GrabarDatos()
        {
            try
            {
                ActualizarTotal();
                DataSet            ds = new DataSet();
                CuentasxCobrarTMBE CuentasxCobrarTMBE = new CuentasxCobrarTMBE()
                {
                    OPCION  = 7,
                    USUARIO = General.General.GetUsuario,
                    IdLote  = _IdLote
                };
                CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);

                // Cuentas por Cobrar
                foreach (DataGridViewRow row in dgvCuentasxCobrarTM.Rows)
                {
                    DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                    if (chk.Value.ToString() == "1")
                    {
                        CuentasxCobrarTMBE.OPCION        = 8;
                        CuentasxCobrarTMBE.ctaCobrarID   = row.Cells["ctaCobrarID"].Value.ToString();
                        CuentasxCobrarTMBE.Tipo          = "cxc";
                        CuentasxCobrarTMBE.valorMonedaID = Convert.ToDecimal(row.Cells["valorMonedaID"].Value);
                        CuentasxCobrarTMBE.Monto         = Convert.ToDecimal(row.Cells["ImporteLiquidarCXC"].Value);
                        CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);
                    }
                }

                // Cuentas por Pagar
                foreach (DataGridViewRow row in dgvCuentasxPagarTM.Rows)
                {
                    DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                    if (chk.Value.ToString() == "1")
                    {
                        CuentasxCobrarTMBE.OPCION        = 8;
                        CuentasxCobrarTMBE.ctaCobrarID   = row.Cells["ctaPagarID"].Value.ToString();
                        CuentasxCobrarTMBE.Tipo          = "cxp";
                        CuentasxCobrarTMBE.valorMonedaID = Convert.ToDecimal(row.Cells["valorMonedaIDCxp"].Value);
                        CuentasxCobrarTMBE.Monto         = Convert.ToDecimal(row.Cells["ImporteLiquidarCXP"].Value);
                        CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);
                    }
                }

                // Gastos Notariales
                foreach (DataGridViewRow row in dgvGN.Rows)
                {
                    DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                    if (chk.Value.ToString() == "1")
                    {
                        CuentasxCobrarTMBE.OPCION        = 8;
                        CuentasxCobrarTMBE.ctaCobrarID   = row.Cells["ctaCobrarIDGN"].Value.ToString();
                        CuentasxCobrarTMBE.Tipo          = "cxc";
                        CuentasxCobrarTMBE.valorMonedaID = Convert.ToDecimal(row.Cells["valorMonedaIDGN"].Value);
                        CuentasxCobrarTMBE.Monto         = Convert.ToDecimal(row.Cells["ImporteLiquidarGN"].Value);
                        CuentasxCobrarTMBL.ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE);
                    }
                }
                ActualizarTotal();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 6
0
 public DataSet ProcesarCuentasxCobrarTM(CuentasxCobrarTMBE BE)
 {
     return(CuentasxCobrarTMDA.ProcesarCuentasxCobrarTM(BE));
 }