Пример #1
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_TiposPagoPuentes();

            if (!Resultado.HayError)
            {
                grdDatos.DataSource            = Resultado.Resultado;
                grdDatos.Columns[0].HeaderText = "No.";
                grdDatos.Columns[1].HeaderText = "Descripción";
                grdDatos.Columns[2].HeaderText = "Orden";
                grdDatos.Columns[3].HeaderText = "Activo";
                grdDatos.Columns[0].ReadOnly   = true;
                grdDatos.Columns[1].ReadOnly   = true;
                grdDatos.Columns[2].ReadOnly   = true;
                grdDatos.Columns[3].ReadOnly   = true;

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                clsGeneral.FormatoResaltadoGrid(ref grdDatos, "PTP_Activo", "N");
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de tipos de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_OrigenCreditosPuente();

            if (!Resultado.HayError)
            {
                grdDatos.DataSource            = Resultado.Resultado;
                grdDatos.Columns[0].HeaderText = "Crédito";
                grdDatos.Columns[1].HeaderText = "Origen";
                grdDatos.Columns[2].HeaderText = "Proyecto";
                grdDatos.Columns[3].HeaderText = "Dación o Adjudicación";
                grdDatos.Columns[4].HeaderText = "Fecha de liquidación";
                grdDatos.Columns[5].HeaderText = "Estado";
                grdDatos.Columns[6].HeaderText = "Id de proyecto";
                grdDatos.Columns[0].ReadOnly   = true;
                grdDatos.Columns[1].ReadOnly   = true;
                grdDatos.Columns[2].ReadOnly   = true;
                grdDatos.Columns[3].ReadOnly   = true;
                grdDatos.Columns[4].ReadOnly   = true;
                grdDatos.Columns[5].ReadOnly   = true;
                grdDatos.Columns[6].ReadOnly   = true;
                grdDatos.Columns[6].Visible    = false;

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                clsGeneral.FormatoResaltadoGrid(ref grdDatos, "OCP_Estado", "LIQUIDADO");
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de orígenes", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void CargarValoresIniciales()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Usuarios_C_Usuarios();
            cboUsuarios.DisplayMember = "Usr_Nombre";
            cboUsuarios.ValueMember   = "Usr_Id";
            cboUsuarios.DataSource    = Resultado.Resultado;

            Resultado = new ResultadoStored_DT();
            Resultado = clsBD.Sistema_C_ParametrosMantenimiento();

            for (int w = 0; w < Resultado.Resultado.Rows.Count; w++)
            {
                if (Resultado.Resultado.Rows[w]["Param_Llave"].ToString() == "SisMant")
                {
                    if (Resultado.Resultado.Rows[w]["Param_Valor"].ToString() == "0")
                    {
                        chkActivo.Checked = false;
                    }
                    else
                    {
                        chkActivo.Checked = true;
                    }
                }

                if (Resultado.Resultado.Rows[w]["Param_Llave"].ToString() == "UsuMant")
                {
                    cboUsuarios.SelectedValue = Convert.ToInt32(Resultado.Resultado.Rows[w]["Param_Valor"].ToString());
                }
            }

            lblActualizacion.Text = DateTime.Now.ToString("HH:mm:ss");
        }
Пример #4
0
        private void wkr01_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            clsGeneral.BitacoraMovimientosSistema Bitacora = new clsGeneral.BitacoraMovimientosSistema(Sistema.Global.Usr_Id, CatalogoStoreds.ReportesBuro_C_CreditosPuentes, vBit_DatosPrevios: clsGeneral.Zip("Parámetros: @FechaDoc = " + FechaDoc.ToString("ddMMyyyy") + "; @Periodo = " + FechaDoc.ToString("MMyyyy")));
            Resultado = clsBD.ReportesBuro_C_CreditosPuentes(FechaDoc.ToString("ddMMyyyy"), FechaDoc.ToString("MMyyyy"), Convert.ToInt32(FechaDoc.ToString("yyyyMM")));

            if (!Resultado.HayError)
            {
                string CadenaTXT = ProcesarDatos(Resultado.Resultado);
                clsGeneral.BuroHistoricoPuentes Buro    = new clsGeneral.BuroHistoricoPuentes(Sistema.Global.Usr_Id, Convert.ToInt32(FechaDoc.ToString("yyyyMM")), vBHP_Documento: clsGeneral.Zip(CadenaTXT));
                clsGeneral.BuroDocumentos       BuroDoc = new clsGeneral.BuroDocumentos(Sistema.Global.Usr_Id, FechaDoc.Year, FechaDoc.Month, "P", vBDG_Documento: clsGeneral.Zip(CadenaTXT, clsGeneral.Codificaciones.UTF8SinBOM));

                clsBD.Bitacoras_I_MovimientosSistema(Bitacora);
                clsBD.Buro_I_HistoricoPuentes(Buro);
                clsBD.Buro_M_Documentos(BuroDoc);

                ArchivoProceso = Path.Combine(DirectorioReporte, clsGeneral.GeneraNombreArchivoRnd("BuroPuentes_", "txt"));
                System.IO.TextWriter tw;
                System.Text.Encoding utf8SinBOM = new UTF8Encoding(false); //Genera UTF-8 sin BOM

                tw = new System.IO.StreamWriter(ArchivoProceso, false, utf8SinBOM);
                tw.Write(CadenaTXT);
                tw.Close();
            }
            else
            {
                ErrorProceso = Resultado.Error;
            }
        }
Пример #5
0
        private void CargarDatosIniciales()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            txtTopSel.Value     = 100;
            dtpFechaFin.MaxDate = clsGeneral.ObtieneFecha(DateTime.Now.AddDays(1).ToString("dd/MM/yyyy")).AddMilliseconds(-2);
            dtpFechaFin.Value   = dtpFechaFin.MaxDate;
            dtpFechaIni.MaxDate = clsGeneral.ObtieneFecha(DateTime.Now.ToString("dd/MM/yyyy"));
            dtpFechaIni.Value   = dtpFechaIni.MaxDate;

            Resultado = clsBD.Usuarios_C_Usuarios();

            if (!Resultado.HayError)
            {
                cboUsuarios.DisplayMember = "Usr_Nombre";
                cboUsuarios.ValueMember   = "Usr_Id";
                cboUsuarios.DataSource    = Resultado.Resultado;
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de usuarios", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            CargarGrid();
        }
Пример #6
0
        private void btnAutorizar_Click(object sender, EventArgs e)
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            DateTime FechaReporteAut = clsGeneral.ObtieneFecha(cboPeriodosCreados.Text);

            clsGeneral.BitacoraMovimientosSistema Bitacora = new clsGeneral.BitacoraMovimientosSistema(
                Sistema.Global.Usr_Id,
                CatalogoStoreds.Buro_U_AutorizarRecreacion,
                vBit_DatosPrevios: clsGeneral.Zip("Parámetros: @BDG_Anno = " + FechaReporteAut.Year.ToString() +
                                                  " BDG_Mes = " + FechaReporteAut.Month.ToString() +
                                                  " BDG_Tipo = I"));

            ResultadoStored_Str Resultado2 = new ResultadoStored_Str();

            clsGeneral.BuroDocumentos BuroDoc = new clsGeneral.BuroDocumentos(Sistema.Global.Usr_Id, FechaReporteAut.Year, FechaReporteAut.Month, "P");

            if (MessageBox.Show("¿Está seguro de autorizar el reproceso de el documento?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                clsBD.Bitacoras_I_MovimientosSistema(Bitacora);
                Resultado2 = clsBD.Buro_U_AutorizarRecreacion(BuroDoc);

                if (!Resultado.HayError)
                {
                    CargarPeriodosCreados();
                    MessageBox.Show("Se ha autorizado el reproceso del documento", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show(Resultado.Error, "Error al autorizar periodo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #7
0
        private void ValoresIniciales()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            txtIngAnno.Maximum = DateTime.Now.Year;
            txtIngMes.Maximum  = DateTime.Now.AddMonths(-1).Month;
            Resultado          = clsBD.Catalogos_C_ObtenerTIIEMaxima();

            if (!Resultado.HayError)
            {
                DateTime dtTM    = new DateTime((int)Resultado.Resultado.Rows[0]["Anno"], (int)Resultado.Resultado.Rows[0]["Mes"], 1);
                DateTime Control = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

                dtTM = dtTM.AddMonths(1);

                if (Control > dtTM)
                {
                    txtIngAnno.Value = (int)Resultado.Resultado.Rows[0]["Anno"];
                    txtIngMes.Value  = ((int)Resultado.Resultado.Rows[0]["Mes"]) + 1;
                    txtIngValor.Select();
                }
                else
                {
                    txtIngAnno.Value = (int)Resultado.Resultado.Rows[0]["Anno"];
                    txtIngMes.Value  = (int)Resultado.Resultado.Rows[0]["Mes"];
                    txtIngValor.Select();
                    MessageBox.Show("Se han registrado todos los valores TIIE para los periodos disponibles", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener TIIE máxima", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #8
0
        private void CargarModulosGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_Modulos();

            if (!Resultado.HayError)
            {
                grdDatos.DataSource            = Resultado.Resultado;
                grdDatos.Columns[0].HeaderText = "No.";
                grdDatos.Columns[1].HeaderText = "Nombre";
                grdDatos.Columns[2].HeaderText = "Descripción";
                grdDatos.Columns[3].HeaderText = "Formulario";
                grdDatos.Columns[4].HeaderText = "Múltiple";
                grdDatos.Columns[5].HeaderText = "Activo";
                grdDatos.Columns[0].ReadOnly   = true;
                grdDatos.Columns[1].ReadOnly   = true;
                grdDatos.Columns[2].ReadOnly   = true;
                grdDatos.Columns[3].ReadOnly   = true;
                grdDatos.Columns[4].ReadOnly   = true;
                grdDatos.Columns[5].ReadOnly   = true;

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                clsGeneral.FormatoResaltadoGrid(ref grdDatos, "Mod_Activo", "N");
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de módulos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #9
0
        private void CargarPermisos(int Usr_Id)
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Usuarios_C_Permisos(Usr_Id);

            if (!Resultado.HayError)
            {
                grdDatosP.DataSource            = Resultado.Resultado;
                grdDatosP.Columns[0].HeaderText = "No.";
                grdDatosP.Columns[1].HeaderText = "Nombre";
                grdDatosP.Columns[2].HeaderText = "Descripción";
                grdDatosP.Columns[3].HeaderText = "Autorizado";
                grdDatosP.Columns[0].ReadOnly   = true;
                grdDatosP.Columns[1].ReadOnly   = true;
                grdDatosP.Columns[2].ReadOnly   = true;
                grdDatosP.Columns[3].ReadOnly   = true;

                grdDatosP.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                clsGeneral.FormatoResaltadoGrid(ref grdDatosP, "Mod_Autorizado", "N");
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de permisos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #10
0
        private void wkr02_DoWork(object sender, DoWorkEventArgs e)
        {
            DataSet ds = new DataSet();

            clsGeneral.BitacoraMovimientosSistema Bitacora = new clsGeneral.BitacoraMovimientosSistema(Sistema.Global.Usr_Id, CatalogoStoreds.Puentes_M_CierreMensual, vBit_DatosPrevios: clsGeneral.Zip("Parámetros: Periodo = " + Fecha.Value.ToString("MMyyyy")));
            ResultadoGrid = new BD.ResultadoStored_DT();
            ResultadoGrid = clsBD.Puentes_C_ReporteContableMensual(Fecha_Ini, Fecha_Fin);

            if (!ResultadoGrid.HayError)
            {
                ds.Tables.Add(ResultadoGrid.Resultado);

                string dsXML = ds.GetXml();
                clsGeneral.PuentesCierreMensual Cierre = new clsGeneral.PuentesCierreMensual(Sistema.Global.Usr_Id, Fecha.Value.Year, Fecha.Value.Month, vPCM_Datos: clsGeneral.Zip(dsXML));

                clsBD.Bitacoras_I_MovimientosSistema(Bitacora);
                clsBD.Puentes_I_HistoricoCierreMensual(Sistema.Global.Usr_Id, Fecha.Value, clsGeneral.Zip(dsXML));
                clsBD.Puentes_M_CierreMensual(Cierre);
                clsBD.Buro_I_SaldosPuente(Fecha.Value, Convert.ToInt32(Fecha.Value.ToString("yyyyMM")));
            }
            else
            {
                ErrorProceso = ResultadoGrid.Error;
            }
        }
Пример #11
0
        private void wkr01_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoGrid = new BD.ResultadoStored_DT();
            ResultadoGrid = clsBD.Puentes_C_ReporteContableMensual(Fecha_Ini, Fecha_Fin);

            if (tipoProceso == TipoProceso.Extraccion)
            {
                Exportar();
            }
        }
Пример #12
0
        private void wkr03_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoGrid = new BD.ResultadoStored_DT();
            ResultadoGrid = clsBD.Puentes_C_HistoricoCierresMensuales(Fecha_Ini, Fecha_Fin, Periodo, Usr_Id, TopSel);

            if (tipoProceso == TipoProceso.Extraccion)
            {
                ExportarR();
            }
        }
Пример #13
0
        private void wkr04_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoGrid = new BD.ResultadoStored_DT();
            ResultadoGrid = clsBD.Puentes_C_CarteraFechaDeterminada(Fecha_Ini, Fecha_Fin);

            if (tipoProceso == TipoProceso.Extraccion)
            {
                ExportarP();
            }
        }
Пример #14
0
        private void wkr02_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoGrid = new BD.ResultadoStored_DT();
            ResultadoGrid = clsBD.Puentes_C_ReporteDePagos(NumeroPrestamo, FechaIni, FechaFin);

            if (tipoProceso == TipoProceso.Extraccion)
            {
                ExportarP();
            }
        }
Пример #15
0
        private void CargarSaldos(int NumeroPrestamo)
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Puentes_C_ObtenerSaldosParaLiquidar(NumeroPrestamo);
            txtQMontoTotal.Enabled        = false;
            txtQPagoCapital.Enabled       = false;
            txtQInteresCubierto.Enabled   = false;
            txtQInteresCapVenc.Enabled    = false;
            txtQComiAplicacion.Enabled    = false;
            txtQPagoIntMoratorios.Enabled = false;
            dtpFechaPago.Enabled          = false;
            txtComiAplicacion.Value       = 0;
            txtInteresCapVenc.Value       = 0;
            txtInteresCubierto.Value      = 0;
            txtMontoTotal.Value           = 0;
            txtPagoCapital.Value          = 0;
            txtPagoIntMoratorios.Value    = 0;
            clsGeneral.EnableTab(tabP01, false);
            tabPagos.SelectedIndex = 1;

            if (!Resultado.HayError)
            {
                if (Resultado.Resultado.Rows.Count > 0)
                {
                    int HayNegativos = 0;

                    dtpFechaPago.Value = (DateTime)Resultado.Resultado.Rows[0]["FechaMax"];
                    HayNegativos      += ValidaMontos(ref txtQPagoCapital, (decimal)Resultado.Resultado.Rows[0]["SCP_CAPITAL"]);
                    HayNegativos      += ValidaMontos(ref txtQInteresCubierto, (decimal)Resultado.Resultado.Rows[0]["SCP_TOTAL_INTERESES"]);
                    HayNegativos      += ValidaMontos(ref txtQInteresCapVenc, (decimal)Resultado.Resultado.Rows[0]["SCP_INT_ORD_S_CAPVENC"]);
                    HayNegativos      += ValidaMontos(ref txtQComiAplicacion, (decimal)Resultado.Resultado.Rows[0]["SCP_CUOTA_RENOV_COM_PROR"]);
                    HayNegativos      += ValidaMontos(ref txtQPagoIntMoratorios, (decimal)Resultado.Resultado.Rows[0]["SCP_INT_MORATORIOS"]);

                    if (HayNegativos == 0)
                    {
                        txtQMontoTotal.Value = txtQPagoCapital.Value + txtQInteresCubierto.Value + txtQInteresCapVenc.Value +
                                               txtQComiAplicacion.Value + txtQPagoIntMoratorios.Value;
                    }
                    else
                    {
                        btnCrear.Enabled = false;
                        MessageBox.Show("Existen saldos con montos incorrectos que impiden hacer un registro del tipo de pago seleccionado. Revise por favor", "Datos incorrectos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("No hay registros para el crédito", "Saldos del crédito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener saldos del crédito", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #16
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_Proyectos(true);

            if (!Resultado.HayError)
            {
                grdDatos.DataSource                   = Resultado.Resultado;
                grdDatos.Columns[0].HeaderText        = "No.";
                grdDatos.Columns[1].HeaderText        = "No. Promotor";
                grdDatos.Columns[2].HeaderText        = "Promotor";
                grdDatos.Columns[3].HeaderText        = "Nombre";
                grdDatos.Columns[4].HeaderText        = "Número de viviendas";
                grdDatos.Columns[5].HeaderText        = "Fecha de apertura";
                grdDatos.Columns[6].HeaderText        = "Fecha de vencimiento";
                grdDatos.Columns[7].HeaderText        = "Monto de crédito en pesos";
                grdDatos.Columns[8].HeaderText        = "Monto desembolsado en pesos";
                grdDatos.Columns[9].HeaderText        = "Tipo de amortización";
                grdDatos.Columns[10].HeaderText       = "Administración";
                grdDatos.Columns[11].HeaderText       = "Spread";
                grdDatos.Columns[12].HeaderText       = "Activo";
                grdDatos.Columns[0].ReadOnly          = true;
                grdDatos.Columns[1].ReadOnly          = true;
                grdDatos.Columns[2].ReadOnly          = true;
                grdDatos.Columns[3].ReadOnly          = true;
                grdDatos.Columns[4].ReadOnly          = true;
                grdDatos.Columns[5].ReadOnly          = true;
                grdDatos.Columns[6].ReadOnly          = true;
                grdDatos.Columns[7].ReadOnly          = true;
                grdDatos.Columns[8].ReadOnly          = true;
                grdDatos.Columns[9].ReadOnly          = true;
                grdDatos.Columns[10].ReadOnly         = true;
                grdDatos.Columns[11].ReadOnly         = true;
                grdDatos.Columns[12].ReadOnly         = true;
                grdDatos.Columns[1].Visible           = false;
                grdDatos.Columns[4].DefaultCellStyle  = Sistema.Global.CeldaNumerica_0Dec;
                grdDatos.Columns[5].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                grdDatos.Columns[6].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                grdDatos.Columns[7].DefaultCellStyle  = Sistema.Global.CeldaNumerica_2Dec;
                grdDatos.Columns[8].DefaultCellStyle  = Sistema.Global.CeldaNumerica_2Dec;
                grdDatos.Columns[11].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                clsGeneral.FormatoResaltadoGrid(ref grdDatos, "Proy_Activo", "N");
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de orígenes", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #17
0
        private void ProcesarFecuentes()
        {
            Frecuentes = clsBD.Sistema_C_Top10PaginasUsuario(Global.Usr_Id);

            if (!Frecuentes.HayError)
            {
                for (int w = 0; w < Frecuentes.Resultado.Rows.Count; w++)
                {
                    try
                    {
                        ToolStripItem[] itm = mnuMain.Items.Find("mnuFreq" + (w + 1).ToString(), true);

                        if (itm.Count() > 0)
                        {
                            if (itm[0].Name == "mnuFreq" + (w + 1).ToString())
                            {
                                itm[0].Text        = Frecuentes.Resultado.Rows[w]["Nombre"].ToString();
                                itm[0].ToolTipText = Frecuentes.Resultado.Rows[w]["Descripcion"].ToString();
                                itm[0].Visible     = true;
                            }
                        }
                    }
                    catch { }
                }

                try
                {
                    for (int w = Frecuentes.Resultado.Rows.Count; w < 10; w++)
                    {
                        ToolStripItem[] itm = mnuMain.Items.Find("mnuFreq" + (w + 1).ToString(), true);

                        if (itm.Count() > 0)
                        {
                            if (itm[0].Name == "mnuFreq" + (w + 1).ToString())
                            {
                                itm[0].Visible = false;
                            }
                        }
                    }
                }
                catch { }

                mnuModulosFreq.Visible = true;
            }
            else
            {
                mnuModulosFreq.Visible = false;
                MessageBox.Show("No se pudo obtener la lista para su usuario", "Módulos frecuentes", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #18
0
        private void ParametrosSistema()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT(new DataTable(), string.Empty, false);

            Resultado = clsBD.Negocio_C_DatosDelSistema();

            BaseConectada  baseC = clsBD.ObtenerBaseConectada();
            DatosStatusBar sb    = clsBD.Negocio_C_FechasDelSistema(Resultado);

            stBaseConectada.Text        = baseC.BaseDatos;
            stBaseConectada.ToolTipText = baseC.Detalle;
            stFechasSistema.Text        = sb.Titulo;
            stFechasSistema.ToolTipText = sb.Detalle;
        }
Пример #19
0
        private void CargarUsuariosCBO()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Usuarios_C_Usuarios();

            if (!Resultado.HayError)
            {
                cboUsuarios.DisplayMember = "Usr_Nombre";
                cboUsuarios.ValueMember   = "Usr_Id";
                cboUsuarios.DataSource    = Resultado.Resultado;
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de usuarios", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #20
0
        private void grdDatos_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                ResultadoStored_DT Resultado = new ResultadoStored_DT();
                DateTime           FechaPago = clsGeneral.ObtieneFecha(grdDatos[0, e.RowIndex].Value.ToString());
                int NumeroPrestamo           = (int)grdDatos[1, e.RowIndex].Value;

                RowIndexNum = e.RowIndex;
                Resultado   = clsBD.Puentes_C_HistoricoDePago(NumeroPrestamo, FechaPago);

                if (!Resultado.HayError)
                {
                    grdDetalle.DataSource = Resultado.Resultado;
                    grdDetalle.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;

                    try
                    {
                        grdDetalle.Columns[4].DefaultCellStyle  = Sistema.Global.CeldaFechaHora;
                        grdDetalle.Columns[5].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                        grdDetalle.Columns[6].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                        grdDetalle.Columns[8].DefaultCellStyle  = Sistema.Global.CeldaNumerica_2Dec;
                        grdDetalle.Columns[9].DefaultCellStyle  = Sistema.Global.CeldaNumerica_2Dec;
                        grdDetalle.Columns[10].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                        grdDetalle.Columns[11].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                        grdDetalle.Columns[12].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                        grdDetalle.Columns[14].DefaultCellStyle = Sistema.Global.CeldaFechaHora;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error al presentar datos de detalle", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(Resultado.Error, "Error al obtener detalle de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al procesar detalle de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #21
0
        private void grdDatos_SelectionChanged(object sender, EventArgs e)
        {
            if (grdDatos.SelectedRows.Count != 0)
            {
                DataGridViewRow dr = grdDatos.SelectedRows[0];
                PViv_Id = 0;

                int.TryParse(dr.Cells["Id"].Value.ToString(), out PViv_Id);

                gbDatos.Enabled = (PViv_Id > 0);

                if (PViv_Id > 0)
                {
                    ResultadoStored_DT Res = clsBD.Catalogos_C_ViviendasInformacionIndividual(PViv_Id);

                    if (!Res.HayError)
                    {
                        if (Res.Resultado.Rows.Count > 0)
                        {
                            txtReferenciaMod.Text       = Res.Resultado.Rows[0]["PViv_Referencia"].ToString();
                            txtCUVMod.Text              = Res.Resultado.Rows[0]["PViv_CUV"].ToString();
                            txtUbicacionMod.Text        = Res.Resultado.Rows[0]["PViv_Ubicacion"].ToString();
                            numMontoCredMod.Value       = Convert.ToDecimal(Res.Resultado.Rows[0]["PViv_MontoCredito"]);
                            numMontoMinPenMod.Value     = Convert.ToDecimal(Res.Resultado.Rows[0]["PViv_MontoMinPendiente"]);
                            numMontoPagoPenMod.Value    = Convert.ToDecimal(Res.Resultado.Rows[0]["PViv_MontoPagoPendiente"]);
                            numMontoSaldoPenMod.Value   = Convert.ToDecimal(Res.Resultado.Rows[0]["PViv_MontoSaldoPendiente"]);
                            numSaldoInsolutoMod.Value   = Convert.ToDecimal(Res.Resultado.Rows[0]["PViv_SaldoInsoluto"]);
                            dtpFechaMod.Value           = Convert.ToDateTime(Res.Resultado.Rows[0]["PViv_FechaUltimoPago"] != DBNull.Value ? Res.Resultado.Rows[0]["PViv_FechaUltimoPago"] : new DateTime(1900, 1, 1));
                            cboEstadosMod.SelectedValue = Res.Resultado.Rows[0]["PViv_Estatus"];
                        }
                        else
                        {
                            MessageBox.Show("No se encontraron valores para la vivienda seleccionada", "Datos incorrectos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                    }
                    else
                    {
                        MessageBox.Show(Res.Error, "Error al cargar datos de vivienda", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Пример #22
0
        private void grdPDatos_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                ResultadoStored_DT Resultado = new ResultadoStored_DT();
                Guid idArchivos;
                long Tamanno;

                grdPArchivos.DataSource = null;

                if (Guid.TryParse(grdPDatos[16, e.RowIndex].Value.ToString(), out idArchivos))
                {
                    Resultado = clsBD.Puentes_C_AdjuntosPorAjuste(idArchivos);

                    if (!Resultado.HayError)
                    {
                        Resultado.Resultado.Columns[2].ReadOnly = false;

                        for (int w = 0; w < Resultado.Resultado.Rows.Count; w++)
                        {
                            if (long.TryParse(Resultado.Resultado.Rows[w][2].ToString(), out Tamanno))
                            {
                                Resultado.Resultado.Rows[w][2] = clsGeneral.GetBytesReadable(Tamanno);
                            }
                        }

                        grdPArchivos.DataSource = Resultado.Resultado;
                    }
                    else
                    {
                        MessageBox.Show(Resultado.Error, "Error al obtener adjuntos de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al procesar adjuntos de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #23
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado           = clsBD.Bitacoras_C_MovimientosSistema(Fecha_Ini, Fecha_Fin, Procedimiento, Usr_Id, TopSel);
            grdDatos.DataSource = null;

            if (!Resultado.HayError)
            {
                if (Resultado.Resultado.Rows.Count > 0)
                {
                    if (Resultado.Resultado.Rows.Count <= 100)
                    {
                        grdDatos.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
                    }

                    grdDatos.DataSource            = Resultado.Resultado;
                    grdDatos.Columns[0].HeaderText = "No.";
                    grdDatos.Columns[1].HeaderText = "Usuario";
                    grdDatos.Columns[2].HeaderText = "Fecha";
                    grdDatos.Columns[3].HeaderText = "Procedimiento";
                    grdDatos.Columns[0].ReadOnly   = true;
                    grdDatos.Columns[1].ReadOnly   = true;
                    grdDatos.Columns[2].ReadOnly   = true;
                    grdDatos.Columns[3].ReadOnly   = true;

                    grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
                }
                else
                {
                    MessageBox.Show("No se encontraron resultados para su búsqueda", "Resultados", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de bitácora", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #24
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_TIIE();

            if (!Resultado.HayError)
            {
                grdDatos.DataSource            = Resultado.Resultado;
                grdDatos.Columns[0].HeaderText = "Año";
                grdDatos.Columns[1].HeaderText = "Mes";
                grdDatos.Columns[2].HeaderText = "Valor";
                grdDatos.Columns[0].ReadOnly   = true;
                grdDatos.Columns[1].ReadOnly   = true;
                grdDatos.Columns[2].ReadOnly   = true;

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de orígenes", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #25
0
        private void wkr01_DoWork(object sender, DoWorkEventArgs e)
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            clsGeneral.BitacoraMovimientosSistema Bitacora = new clsGeneral.BitacoraMovimientosSistema(Sistema.Global.Usr_Id, CatalogoStoreds.ReportesBuro_C_CreditosIndividuales, vBit_DatosPrevios: clsGeneral.Zip("Parámetros: @FECHA_DEL_REPORTE = " + FechaReporte));
            Resultado = clsBD.ReportesBuro_C_CreditosIndividuales(FechaReporte);

            if (!Resultado.HayError)
            {
                ArchivoProceso = Path.Combine(DirectorioReporte, clsGeneral.GeneraNombreArchivoRnd("BuroInd_", "csv"));
                ProcesarDatos(Resultado.Resultado, ArchivoProceso);

                clsGeneral.BuroHistoricoIndividuales Buro    = new clsGeneral.BuroHistoricoIndividuales(Sistema.Global.Usr_Id, vBHI_Documento: clsGeneral.Zip(System.IO.File.ReadAllText(ArchivoProceso, Encoding.Default), clsGeneral.Codificaciones.ANSI));
                clsGeneral.BuroDocumentos            BuroDoc = new clsGeneral.BuroDocumentos(Global.Usr_Id, FechaDoc.Year, FechaDoc.Month, "I", vBDG_Documento: clsGeneral.Zip(System.IO.File.ReadAllText(ArchivoProceso, Encoding.Default), clsGeneral.Codificaciones.ANSI));

                clsBD.Bitacoras_I_MovimientosSistema(Bitacora);
                clsBD.Buro_I_HistoricoIndividuales(Buro);
                clsBD.Buro_M_Documentos(BuroDoc);
            }
            else
            {
                ErrorProceso = Resultado.Error;
            }
        }
Пример #26
0
        private void CargarCombos()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Catalogos_C_Promotores();

            cboIngPromotor.ValueMember   = "Prom_Id";
            cboIngPromotor.DisplayMember = "Prom_Nombre";
            cboIngPromotor.DataSource    = Resultado.Resultado;

            Resultado = new ResultadoStored_DT();
            Resultado = clsBD.Catalogos_C_Promotores(true);
            cboModPromotor.ValueMember   = "Prom_Id";
            cboModPromotor.DisplayMember = "Prom_Nombre";
            cboModPromotor.DataSource    = Resultado.Resultado;

            cboIngAdministracion.ValueMember   = "Valor";
            cboIngAdministracion.DisplayMember = "Descripcion";
            cboIngAdministracion.DataSource    = clsGeneral.ddlAdminCred;

            cboModAdministracion.ValueMember   = "Valor";
            cboModAdministracion.DisplayMember = "Descripcion";
            cboModAdministracion.DataSource    = clsGeneral.ddlAdminCred;
        }
Пример #27
0
        private void grdDatos_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                ResultadoStored_DT Resultado = new ResultadoStored_DT();
                DateTime           FechaPago = clsGeneral.ObtieneFecha(grdDatos[0, e.RowIndex].Value.ToString());
                int NumeroPrestamo           = (int)grdDatos[1, e.RowIndex].Value;

                Resultado = clsBD.Puentes_C_HistoricoDePago(NumeroPrestamo, FechaPago);

                if (!Resultado.HayError)
                {
                    grdDetalle.DataSource = Resultado.Resultado;
                }
                else
                {
                    MessageBox.Show(Resultado.Error, "Error al obtener detalle de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al procesar detalle de pago", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #28
0
        private void ParametrosSistema()
        {
            ResultadoStored_DT Resultado  = new ResultadoStored_DT(new DataTable(), string.Empty, false);
            DataTable          Parametros = new DataTable();
            DataRow            dr;

            Parametros.Columns.Add("Concepto");
            Parametros.Columns.Add("Valor");
            Resultado = clsBD.Negocio_C_DatosDelSistema();

            BaseConectada  baseC = clsBD.ObtenerBaseConectada();
            DatosStatusBar sb    = clsBD.Negocio_C_FechasDelSistema(Resultado);

            for (int w = 0; w < Resultado.Resultado.Columns.Count; w++)
            {
                dr    = Parametros.NewRow();
                dr[0] = Resultado.Resultado.Columns[w].ColumnName;
                dr[1] = Resultado.Resultado.Rows[0][w].ToString();
                Parametros.Rows.Add(dr);
            }

            Parametros.AcceptChanges();
            grdInfo.DataSource = Parametros;
        }
Пример #29
0
        private void CargarGrid()
        {
            ResultadoStored_DT Resultado = new ResultadoStored_DT();

            Resultado = clsBD.Puentes_C_MovimientosPrestamo((int)cboNumeroPrestamo.SelectedValue, dtpFechaPago.Value.AddDays(-5), dtpFechaPago.MaxDate);

            if (!Resultado.HayError)
            {
                grdDatos.DataSource = Resultado.Resultado;

                for (int w = 0; w < grdDatos.Columns.Count; w++)
                {
                    grdDatos.Columns[w].ReadOnly = true;
                }

                grdDatos.AlternatingRowsDefaultCellStyle.BackColor = Sistema.Global.ColorAltGrid;

                try
                {
                    grdDatos.Columns[5].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                    grdDatos.Columns[6].DefaultCellStyle  = Sistema.Global.CeldaFecha;
                    grdDatos.Columns[7].DefaultCellStyle  = Sistema.Global.CeldaNumerica_0Dec;
                    grdDatos.Columns[9].DefaultCellStyle  = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[10].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[13].DefaultCellStyle = Sistema.Global.CeldaNumerica_6Dec;
                    grdDatos.Columns[14].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[15].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[16].DefaultCellStyle = Sistema.Global.CeldaNumerica_6Dec;
                    grdDatos.Columns[18].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[19].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[20].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[21].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[22].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[23].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[24].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[25].DefaultCellStyle = Sistema.Global.CeldaNumerica_6Dec;
                    grdDatos.Columns[26].DefaultCellStyle = Sistema.Global.CeldaNumerica_6Dec;
                    grdDatos.Columns[27].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[28].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[29].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[30].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[31].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[32].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[33].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[34].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[35].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[36].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[37].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[38].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[39].DefaultCellStyle = Sistema.Global.CeldaNumerica_2Dec;
                    grdDatos.Columns[40].DefaultCellStyle = Sistema.Global.CeldaNumerica_0Dec;

                    grdDatos.Columns[0].DefaultCellStyle = Sistema.Global.CeldaFecha;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error al presentar datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                grdDatos.ClearSelection();

                for (int w = 0; w < grdDatos.Rows.Count; w++)
                {
                    if (Convert.ToDateTime(grdDatos.Rows[w].Cells[0].Value).ToString("dd/MM/yyyy") == dtpFechaPago.Value.ToString("dd/MM/yyyy"))
                    {
                        grdDatos.Rows[w].Selected = true;
                        grdDatos.CurrentCell      = grdDatos.Rows[w].Cells[0];
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show(Resultado.Error, "Error al obtener datos de créditos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            txtQMontoTotal.Enabled        = true;
            txtQPagoCapital.Enabled       = true;
            txtQInteresCubierto.Enabled   = true;
            txtQInteresCapVenc.Enabled    = true;
            txtQComiAplicacion.Enabled    = true;
            txtQPagoIntMoratorios.Enabled = true;
            dtpFechaPago.Enabled          = true;
            clsGeneral.EnableTab(tabP01, true);

            txtMontoTotal.Value        = 0;
            txtPagoCapital.Value       = 0;
            txtInteresCubierto.Value   = 0;
            txtInteresCapVenc.Value    = 0;
            txtComiAplicacion.Value    = 0;
            txtPagoIntMoratorios.Value = 0;
            txtObservaciones.Text      = string.Empty;

            txtQMontoTotal.Value        = 0;
            txtQPagoCapital.Value       = 0;
            txtQInteresCubierto.Value   = 0;
            txtQInteresCapVenc.Value    = 0;
            txtQComiAplicacion.Value    = 0;
            txtQPagoIntMoratorios.Value = 0;
            txtQObservaciones.Text      = string.Empty;

            if (cboTipoPago.Text == "Normal")
            {
                clsGeneral.EnableTab(tabP02, false);
                tabPagos.SelectedIndex = 0;
                Valida();
            }
            else
            {
                clsGeneral.EnableTab(tabP02, true);
                tabPagos.SelectedIndex = 1;

                switch (cboTipoPago.Text.ToLowerInvariant())
                {
                case "dación":
                    CargarSaldos((int)cboNumeroPrestamo.SelectedValue);
                    break;

                case "adjudicación":
                    CargarSaldos((int)cboNumeroPrestamo.SelectedValue);
                    break;

                default:
                    break;
                }

                ValidaQ();
            }
        }