private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvLineasAutorizadas.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de Eliminar ...:" + dgvLineasAutorizadas.CurrentRow.Cells["IdSocio_Dsc"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dialogResult == DialogResult.Yes)
                    {
                        SocioLineaBE SocioLineaBE = new SocioLineaBE()
                        {
                            OPCION  = 3,
                            USUARIO = General.General.GetUsuario,
                            IdLinea = dgvLineasAutorizadas.CurrentRow.Cells["IdLinea"].Value.ToString(),
                        };

                        SocioLineaBL.ProcesarSocioLinea(SocioLineaBE);
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void CargarDatos()
        {
            try
            {
                DataSet      ds            = new DataSet();
                SocioLineaBE oSocioLineaBE = new SocioLineaBE()
                {
                    OPCION  = 1,
                    USUARIO = General.General.GetCodigoUsuario,
                    IdLinea = IdLinea
                };

                ds = SocioLineaBL.ProcesarSocioLinea(oSocioLineaBE);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    cboIdMoneda_tt.SelectedValue = ds.Tables[0].Rows[0]["IdMoneda_tt"].ToString() == "" ? "00036" : ds.Tables[0].Rows[0]["IdMoneda_tt"].ToString();
                    txtnLinea.Text      = Convert.ToDecimal(ds.Tables[0].Rows[0]["nImporte"]).ToString("N2");
                    txtnNuevaLinea.Text = Convert.ToDecimal(ds.Tables[0].Rows[0]["nImporte"]).ToString("N2");
                    if (Convert.ToDecimal(ds.Tables[0].Rows[0]["nImporte"]) > 0)
                    {
                        cboIdMoneda_tt.Enabled = false;
                    }
                    cboIdMoneda_tt_SelectedIndexChanged(new object(), new EventArgs());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet      ds           = new DataSet();
                SocioLineaBE SocioLineaBE = new SocioLineaBE()
                {
                    OPCION        = 1,
                    USUARIO       = General.General.GetUsuario,
                    IdSocio_Dsc   = TextBoxX1.Text.Trim(),
                    dtRegistro    = dtInicio.Value,
                    dtVencimiento = dtFin.Value
                };

                ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE);
                dgvLineasAutorizadas.DataSource = ds.Tables[0];
                lblRegistros.Text = ds.Tables[0].Rows.Count.ToString() + " registro(s)";
                dt = ds.Tables[0];

                foreach (DataGridViewRow row in dgvLineasAutorizadas.Rows)
                {
                    if (Convert.ToInt32(row.Cells["nPorUsoLin"].Value) < 75)  // No Vencido
                    {
                    }
                    else // VEncido
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorAnulado);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        private void frmConSaldoSocio2_Load(object sender, EventArgs e)
        {
            try
            {
                DataSet      ds           = new DataSet();
                SocioLineaBE SocioLineaBE = new SocioLineaBE()
                {
                    OPCION      = 8,
                    IdSocio     = txtCodigo.Text.Trim(),
                    IdSocio_Dsc = txtSocio.Text.Trim(),
                    USUARIO     = General.General.GetUsuario,
                };
                ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE);
                dgvSaldoSocio.DataSource = ds.Tables[0];

                DataSet      ds2           = new DataSet();
                SocioLineaBE SocioLineaBE2 = new SocioLineaBE()
                {
                    OPCION      = 9,
                    IdSocio     = txtCodigo.Text.Trim(),
                    IdSocio_Dsc = txtSocio.Text.Trim(),
                    USUARIO     = General.General.GetUsuario,
                };
                ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE2);
                dgvPagadora.DataSource = ds.Tables[0];

                lblEjecutivo.Text = "Ejecutivo: " + _Ejecutivo;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 5
0
        private void CargarLineas()
        {
            try
            {
                SocioLineaBE SocioLineaBE = new SocioLineaBE()
                {
                    OPCION  = 4,
                    USUARIO = General.General.GetUsuario,
                    IdSocio = _IdSocio
                };

                DataSet ds = new SocioLineaBL().ProcesarSocioLinea(SocioLineaBE);
                cboIdLinea.DataSource    = ds.Tables[0];
                cboIdLinea.DisplayMember = "Descripcion";
                cboIdLinea.ValueMember   = "IdLinea";

                if (ds.Tables[0].Rows.Count > 0)
                {
                    CargarDatos();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 6
0
        private void CargarDatos()
        {
            try
            {
                txtPagadora.Text = this.oPagadora;
                DataSet      ds           = new DataSet();
                SocioLineaBE SocioLineaBE = new SocioLineaBE()
                {
                    OPCION     = 10,
                    IdSocio    = this.oIdSocio,
                    IdPagadora = this.oIdPagadora,
                    USUARIO    = General.General.GetUsuario,
                    FlgOrigen  = _FlgOrigen
                };
                ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE);
                dgvSaldoSocio3.DataSource = ds.Tables[0];

                decimal ACDolSol   = 0;
                decimal ACTotalSol = 0;
                foreach (DataGridViewRow row in dgvSaldoSocio3.Rows)
                {
                    if (row.Cells["DiasAtraso"].Value.Equals("")) // No Vencido
                    {
                    }
                    else // VEncido
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorAnulado);
                    }

                    ACDolSol   = ACDolSol + Convert.ToDecimal(row.Cells["TotalD"].Value) * Convert.ToDecimal(row.Cells["nTipoCambio"].Value);
                    ACTotalSol = ACTotalSol + Convert.ToDecimal(row.Cells["TotalS"].Value);
                }
                decimal TotalUtilizado = 0;
                object  sumTotSol;
                object  sumTotDol;
                sumTotSol           = ds.Tables[0].Compute("Sum(TotalS)", "");
                sumTotDol           = ds.Tables[0].Compute("Sum(TotalD)", "");
                txtSumSol.Text      = string.Format(CultureInfo.CreateSpecificCulture("es-PE"), "{0:C}", sumTotSol);
                txtSumDol.Text      = string.Format(CultureInfo.CreateSpecificCulture("en-US"), "{0:C}", sumTotDol);
                txtTotalDolSol.Text = string.Format(CultureInfo.CreateSpecificCulture("es-PE"), "{0:C}", ACDolSol);

                TotalUtilizado          = (ACTotalSol + ACDolSol);
                txtTotalUtilizado.Text  = string.Format(CultureInfo.CreateSpecificCulture("es-PE"), "{0:C}", TotalUtilizado);
                txtLineaDisponible.Text = string.Format(CultureInfo.CreateSpecificCulture("es-PE"), "{0:C}", _LineaSaldo);
                Grid_Formatting();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 7
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet      ds           = new DataSet();
         SocioLineaBE SocioLineaBE = new SocioLineaBE()
         {
             OPCION      = 7,
             IdSocio     = txtCodigo.Text.Trim(),
             IdSocio_Dsc = txtSocio.Text.Trim(),
             USUARIO     = General.General.GetUsuario,
         };
         ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE);
         dgvSaldoSocio.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 8
0
 private void ChkVerPagadoras_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         DataSet      ds            = new DataSet();
         SocioLineaBE SocioLineaBE2 = new SocioLineaBE()
         {
             OPCION          = 9,
             IdSocio         = txtCodigo.Text.Trim(),
             IdSocio_Dsc     = txtSocio.Text.Trim(),
             USUARIO         = General.General.GetUsuario,
             FlgVerPagadoras = ChkVerPagadoras.Checked ? 1 : 0
         };
         ds = SocioLineaBL.ProcesarSocioLinea(SocioLineaBE2);
         dgvPagadora.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private bool ObtenerLinea(string RucSocio, string Moneda)
        {
            bool bResult = false;

            try
            {
                Moneda = Moneda.Equals("PEN") ? "00036" : Moneda;
                Moneda = Moneda.Equals("USD") ? "00037" : Moneda;

                SocioLineaBE IEnitty = new SocioLineaBE()
                {
                    OPCION      = 12,
                    RUCSocio    = RucSocio,
                    IdMoneda_tt = Moneda
                };
                DataSet ds = new DataSet();
                ds = new SocioLineaBL().ProcesarSocioLinea(IEnitty);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtIdSocio.Text            = ds.Tables[0].Rows[0]["IdSocio"].ToString();
                    txtIdSocio_Dsc.Text        = ds.Tables[0].Rows[0]["IdSocio_Dsc"].ToString();
                    IdLinea                    = ds.Tables[0].Rows[0]["IdLinea"].ToString();
                    txtIdLinea_Dsc.Text        = ds.Tables[0].Rows[0]["IdLinea_Dsc"].ToString();
                    txtIdMoneda_tt_Dsc.Text    = ds.Tables[0].Rows[0]["IdMoneda_tt_Dsc"].ToString();
                    IdMoneda_tt                = ds.Tables[0].Rows[0]["IdMoneda_tt"].ToString();
                    txtIdTipoLinea_tt_Dsc.Text = ds.Tables[0].Rows[0]["IdTipoLinea_tt_Dsc"].ToString();
                    IdFormaDesembolso          = Convert.ToDecimal(ds.Tables[0].Rows[0]["IdFormaDesembolso"].ToString());
                    CargarGiradorOriginal();
                    bResult = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(bResult);
        }
Esempio n. 10
0
        public DataSet ProcesarSocioLinea(SocioLineaBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("SocioLinea_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdLinea", DbType.String, BE.IdLinea);
                db.AddInParameter(cmd, "IdSocio", DbType.String, BE.IdSocio);
                db.AddInParameter(cmd, "RUCSocio", DbType.String, BE.RUCSocio);
                db.AddInParameter(cmd, "IdSocio_Dsc", DbType.String, BE.IdSocio_Dsc);
                db.AddInParameter(cmd, "IdTipoLinea_tt", DbType.String, BE.IdTipoLinea_tt);
                if (BE.dtRegistro != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "dtRegistro", DbType.DateTime, BE.dtRegistro);
                }
                if (BE.dtVencimiento != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "dtVencimiento", DbType.DateTime, BE.dtVencimiento);
                }
                db.AddInParameter(cmd, "IdMoneda_tt", DbType.String, BE.IdMoneda_tt);
                db.AddInParameter(cmd, "nImporte", DbType.Decimal, BE.nImporte);
                db.AddInParameter(cmd, "nUtilizado", DbType.Decimal, BE.nUtilizado);
                db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora);
                db.AddInParameter(cmd, "IdPagadora_Dsc", DbType.String, BE.IdPagadora_Dsc);
                db.AddInParameter(cmd, "FlgVerPagadoras", DbType.Int32, BE.FlgVerPagadoras);
                db.AddInParameter(cmd, "FlgOrigen", DbType.Int32, BE.FlgOrigen);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
Esempio n. 11
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(dtFechaVencimiento.Text))
                {
                    MessageBox.Show("Ingresar una fecha de vencimiento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtnLinea.Focus();
                    return;
                }

                if (string.IsNullOrEmpty(txtnLinea.Text.Trim()))
                {
                    MessageBox.Show("Debe Ingresar una Línea de Crédito", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtnLinea.Focus();
                    return;
                }

                if (cboIdMoneda_tt.SelectedIndex == -1)
                {
                    MessageBox.Show("Debe Seleccionar una Moneda", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cboIdMoneda_tt.Focus();
                    return;
                }

                if (decimal.Parse(txtnLineaImporte.Text.Trim()) == 0)
                {
                    MessageBox.Show("El Importe debe ser mayor a 0", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtnLineaImporte.Focus();
                    return;
                }

                if (TipoOperacion.ToString().Equals("R"))
                {
                    if (decimal.Parse(txtnNuevaLinea.Text.Trim()) < 0)
                    {
                        MessageBox.Show("La nuva Línea no puede ser menor a 0", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        txtnLineaImporte.Focus();
                        return;
                    }
                }

                SocioLineaBE oSocioLineaBE = new SocioLineaBE()
                {
                    OPCION        = 6,
                    USUARIO       = General.General.GetCodigoUsuario,
                    IdLinea       = IdLinea,
                    IdMoneda_tt   = cboIdMoneda_tt.SelectedValue.ToString(),
                    nImporte      = decimal.Parse(txtnNuevaLinea.Text),
                    dtVencimiento = dtFechaVencimiento.Value
                };

                SocioLineaBL.ProcesarSocioLinea(oSocioLineaBE);
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 12
0
 public DataSet ProcesarSocioLinea(SocioLineaBE BE)
 {
     return(SocioLineaDA.ProcesarSocioLinea(BE));
 }