Exemplo n.º 1
0
        private bool validaUsuarioActivacionMenu()
        {
            TableBaseBL oTableBaseBL = new TableBaseBL();
            TableBaseBE oTableBaseBE = new TableBaseBE();
            string      indActivador = string.Empty;
            //DataSet ds = null;
            List <TableBaseBE> lstTableBase = new List <TableBaseBE>();

            oTableBaseBE.Table_Parent_Id = AppSettings.listaUsuariosMenuDinamico;
            oTableBaseBE.OPCION          = 1;
            lstTableBase = oTableBaseBL.ProcesarTableBase(oTableBaseBE);

            if (lstTableBase.Count > 0)
            {
                foreach (TableBaseBE tableBase in lstTableBase)
                {
                    if (tableBase.Table_Value == General.GetCodigoUsuario.Trim())
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        private void ValidarPermisos(ref bool bPermitir)
        {
            bPermitir = false;
            try
            {
                TableBaseBE oEntity = new TableBaseBE()
                {
                    OPCION   = 1,
                    USUARIO  = General.General.GetUsuario,
                    Table_Id = System.Configuration.ConfigurationManager.AppSettings["UsuariosGC"].ToString()
                };
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    string[] ArrayUsuarios = ds.Tables[0].Rows[0]["Table_Value"].ToString().Split('/');

                    foreach (string item in ArrayUsuarios)
                    {
                        if (item.Trim().Equals(General.General.GetUsuario.Trim()))
                        {
                            bPermitir = true;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void validaActivacionMenu()
        {
            if (validaUsuarioActivacionMenu())
            {
                TableBaseBL oTableBaseBL = new TableBaseBL();
                TableBaseBE oTableBaseBE = new TableBaseBE();
                string      indActivador = string.Empty;
                //DataSet ds = null;
                List <TableBaseBE> lstTableBaseBE = new List <TableBaseBE>();

                oTableBaseBE.Table_Id = AppSettings.activadorMenuDinamico;
                oTableBaseBE.OPCION   = 1;
                lstTableBaseBE        = oTableBaseBL.ProcesarTableBase(oTableBaseBE);
                indActivador          = lstTableBaseBE[0].Table_Value; //ds.Tables[0].Rows[0]["Table_Value"].ToString();

                if (indActivador == "1")
                {
                    //mnuDinamico.Visible = false;
                    mnuDinamico.Items.Clear();
                    mnuDinamico.Visible = true;
                    loadMenu();
                }
                else
                {
                    mnuDinamico.Visible = true;
                }
            }
            else
            {
                mnuDinamico.Visible = true;
            }
        }
Exemplo n.º 4
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                General.msgHelper.Wait("Procesando, espere un momento ...");
                string      Flg_RptMonedaLinea = "1";
                TableBaseBE oEntity            = new TableBaseBE();
                oEntity.OPCION   = 1;
                oEntity.Table_Id = ConfigurationManager.AppSettings["TT_RptCCDMonedaLinea"].ToString();
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntity);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        Flg_RptMonedaLinea = ds.Tables[0].Rows[0]["Table_Value"].ToString();
                    }
                }

                DataSet dsGestionAvance        = new DataSet();
                DataSet dsGestionAvanceResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_CreditosVigentesxProducto", con);
                    cmd1.CommandTimeout = 0;
                    cmd1.CommandType    = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@gFechaOp", General.General.gFechaOp);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsGestionAvance, "dsCreditosVigentes");
                    con.Close();
                }

                Crystal.crRpt_CreditosVigentesxProductoX ocrLoteLiquidacion       = new Crystal.crRpt_CreditosVigentesxProductoX();
                Reportes.frmVisorLoteLiquidacion         ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsGestionAvance);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("Flg_RptMonedaLinea", Flg_RptMonedaLinea);
                ocrLoteLiquidacion.SetParameterValue("gFechaOp", General.General.gFechaOp);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
                General.msgHelper.Wait();
            }
            catch (Exception ex)
            {
                General.msgHelper.Wait();
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
        private void LlenarCombos()
        {
            try
            {
                DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3);
                General.General.LlenarCombobox(cboEjecutivo, "nombreCompleto", "gestorID", dsGestor.Tables[0], true);

                String      Table_Id    = "00030"; //Estado de Lineas
                TableBaseBE TableBaseBE = new TableBaseBE()
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };

                DataTable dt = new DataTable();
                dt = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];

                DataRow dr;
                dr = dt.NewRow();
                dr["Table_Name"] = "Activa";
                dr["Table_Id"]   = "00031";
                dt.Rows.InsertAt(dr, 0);
                DataRow dr1;
                dr1 = dt.NewRow();
                dr1["Table_Name"] = "Inactiva";
                dr1["Table_Id"]   = "00451";
                dt.Rows.InsertAt(dr1, 1);
                DataRow dr2;
                dr2 = dt.NewRow();
                dr2["Table_Name"] = "Anulada";
                dr2["Table_Id"]   = "00034";
                dt.Rows.InsertAt(dr2, 6);

                //cboIdEstadoLinea_tt.Items.Add({Table_Name = "xx", }

                General.General.LlenarCombobox(cboIdEstadoLinea_tt, "Table_Name", "Table_Id", dt);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 6
0
 private void CargarTipoSolicitud()
 {
     try
     {
         BindingSource bs          = new BindingSource();
         String        Table_Id    = "00287"; // Tipo Solicitud
         TableBaseBE   TableBaseBE = new TableBaseBE()
         {
             OPCION          = 1,
             USUARIO         = General.General.GetCodigoUsuario,
             Table_Parent_Id = Table_Id
         };
         DataSet ds = new TableBaseBL().ProcesarTableBase(TableBaseBE);
         dgvTipoSolicitud.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 7
0
        private void LlenarCombos()
        {
            try
            {
                String      Table_Id    = "00130"; //Estado de Cobranza Filtro Confirmación
                TableBaseBE TableBaseBE = new TableBaseBE()
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };

                DataTable dt = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];
                General.General.LlenarCombobox(cboIdEstado_tt, "Table_Name", "Table_Value", dt);
                cboIdEstado_tt.SelectedValue = "A"; //Pendiente de Confirmación
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void LlenarCombos()
        {
            try
            {
                String      Table_Id    = "01014"; //Tipo Origen
                TableBaseBE TableBaseBE = new TableBaseBE()
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };

                DataTable dt = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];
                cboIdOrigenBitacora_tt.DataSource    = dt;
                cboIdOrigenBitacora_tt.DisplayMember = "Table_Name";
                cboIdOrigenBitacora_tt.ValueMember   = "Table_Id";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 9
0
        private void LlenarCombos()
        {
            try
            {
                String Table_Id = "00030";

                TableBaseBE TableBaseBE = new TableBaseBE
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };

                DataTable dt = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];
                DataTable dt1;
                //dt.Select("Table_Value = 'B'").Clone(dt1);

                General.General.LlenarCombobox(cboIdEstadoLinea_tt, "Table_Name", "Table_Id", dt);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void frmMntCobranzaSocioDato_Load(object sender, EventArgs e)
        {
            try
            {
                dgvDepositos.ReadOnly       = false;
                nTotal.ReadOnly             = false;
                jImporte.ReadOnly           = true;
                jSaldo.ReadOnly             = true;
                ctasBancariaID.ReadOnly     = true;
                ctasBanNumCta.ReadOnly      = true;
                IdTipoAbono_tt_Dsc.ReadOnly = true;
                IdOperacion_tt_Dsc.ReadOnly = true;


                cboTipoDeposito.SelectedIndex = 0;
                LlenarCombos();
                if (Operacion.Equals("N"))
                {
                    /* Evaluar - Llenar datos por defecto si es necesario....*/
                    dtRegistro.Value = General.General.gFechaOp;
                    //txtdtRegistro.Text = General.General.gFechaOp.ToString().Substring(0, 10);
                }
                else if (Operacion.Equals("M"))
                {
                    txtIdCobranza.Text           = Codigo;
                    cboIdMoneda_tt.Enabled       = false;
                    txtIdSocio.Enabled           = false;
                    txtDescripcion.ReadOnly      = true;
                    dtRegistro.Enabled           = false;
                    txtDatosAdicionales.ReadOnly = true;
                    btnBuscarSocio.Enabled       = false;
                    LlenarCombos();
                    CargarDatos();
                }
                else if (Operacion.Equals("C"))
                {
                    txtIdCobranza.Text           = Codigo;
                    cboIdMoneda_tt.Enabled       = false;
                    txtIdSocio.Enabled           = false;
                    txtDescripcion.ReadOnly      = true;
                    dtRegistro.Enabled           = false;
                    txtDatosAdicionales.ReadOnly = true;
                    btnBuscarSocio.Enabled       = false;
                    btnDepositosXAplicar.Enabled = false;
                    btnAgregarDet.Visible        = false;
                    btnQuitarDet.Visible         = false;
                    btnAceptar.Visible           = false;
                    btnDepositosXAplicar.Visible = false;
                    btnQuitarDepositos.Visible   = false;
                    dgvDocumentos.ReadOnly       = true;
                    LlenarCombos();
                    CargarDatos();
                }

                TableBaseBE oEntity = new TableBaseBE();
                oEntity.OPCION   = 1;
                oEntity.USUARIO  = General.General.GetUsuario;
                oEntity.Table_Id = "01175"; //Porcentaje Validacion Cobranzas
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntity);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    PrjLimiteVal = decimal.Parse(ds.Tables[0].Rows[0]["Table_Value"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                // Obtener la variable general de validación
                TableBaseBE oEntityTable = new TableBaseBE();
                oEntityTable.OPCION   = 1;
                oEntityTable.USUARIO  = General.General.GetUsuario;
                oEntityTable.Table_Id = "01175"; //Porcentaje Validacion Cobranzas
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntityTable);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    PrjLimiteVal = decimal.Parse(ds.Tables[0].Rows[0]["Table_Value"].ToString());
                }

                TotalizarDepositos();
                TotalizarImporteDoc();
                Decimal Total          = string.IsNullOrEmpty(lblSaltoXAplicar.Text) ? 0 : Convert.ToDecimal(lblSaltoXAplicar.Text);
                Decimal AcImporteTotal = string.IsNullOrEmpty(txtTotalImp.Text) ? 0 : Convert.ToDecimal(txtTotalImp.Text);

                //if (AcImporteTotal != Total)
                //{
                //    MessageBox.Show("La distribución del depósito debe ser igual que el importe del depósito", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                //Validacion, el monto a cancelar no debe ser menor igual del 90%
                Decimal AcnvImporte   = 0;
                Decimal AcMontoCobrar = 0;
                Decimal nMontoCobrar  = 0;
                Decimal nDifCobrada   = 0;

                bool IsError = false;
                foreach (DataGridViewRow row in dgvDocumentos.Rows)
                {
                    AcnvImporte   = AcnvImporte + (Decimal)row.Cells["nvImporte"].Value;
                    AcMontoCobrar = AcMontoCobrar + (Decimal)row.Cells["nvMontoCobrar"].Value;

                    nMontoCobrar = (Decimal)row.Cells["nvMontoCobrar"].Value;
                    nDifCobrada  = (Decimal)row.Cells["DifCobrada"].Value;
                    nDifCobrada  = Math.Abs(nDifCobrada);

                    //if (PrjLimiteVal > 0)
                    //{
                    //if (((AcnvImporte / AcMontoCobrar) * 100) < PrjLimiteVal)
                    //{
                    //    IsError = true;
                    //    break;
                    //}

                    // Modif 20190708
                    if (((nDifCobrada / nMontoCobrar) * 100) > PrjLimiteVal)
                    {
                        IsError = true;
                        break;
                    }
                    //}
                }

                if (IsError)
                {
                    MessageBox.Show("El importe a cancelar excede el " + PrjLimiteVal.ToString() + "% de lo permitido, por favor verifique.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    //MessageBox.Show("El importe a cancelar es mayor al 10% de lo permitido, por favor verifique.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }


                if (dtRegistro.Value == DateTime.MinValue)
                {
                    MessageBox.Show("Se debe ingresar una fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                //Comentado por Rq. 20181012 para los previos se puede crear cobranzas con fecha futura pero al confirmar validar que la fecha sea igual al del día
                //if (dtRegistro.Value > DateTime.Now)
                //{
                //    MessageBox.Show("La fecha de cancelación no puede ser mayor a la fecha actual", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                CobranzaBE CobranzaBE = new CobranzaBE()
                {
                    USUARIO           = General.General.GetCodigoUsuario,
                    OPCION            = 2,
                    IdCobranza        = txtIdCobranza.Text,
                    dtValuta          = dtRegistro.Value,
                    dtRegistro        = General.General.gFechaOp,                                                                //dtRegistro.Value,
                    IdTipoCobranza_tt = "00056",                                                                                 //Cobranza por Socio
                    IdMoneda_tt       = cboIdMoneda_tt.SelectedValue.ToString(),
                    nTotal            = String.IsNullOrEmpty(txtTotalImp.Text.Trim()) ? 0 : Convert.ToDecimal(txtTotalImp.Text), //lblSaltoXAplicar
                    DatosAdicionales  = txtDatosAdicionales.Text,
                };

                DataSet dsCobranza = new DataSet();
                dsCobranza = CobranzaBL.ProcesarCobranza(CobranzaBE);

                if (dsCobranza.Tables[0].Rows.Count > 0)
                {
                    this.txtIdCobranza.Text = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                    CobranzaDetalleBE oCobranzaDetBE = new CobranzaDetalleBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                        sdFechaOp  = General.General.gFechaOp
                    };
                    CobranzaDetalleBL.ProcesarCobranzaDetalle(oCobranzaDetBE);

                    /* Documentos */
                    foreach (var item in LstCobranzaDetalle)
                    {
                        item.USUARIO    = General.General.GetCodigoUsuario;
                        item.OPCION     = 2;
                        item.IdSocio    = txtIdSocio.Text;
                        item.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        item.nvImporte  = item.nvImporte;
                        item.sdFechaOp  = General.General.gFechaOp;
                        item.IdLote     = item.IdLote;
                        item.cItem      = item.cItem;
                        CobranzaDetalleBL.ProcesarCobranzaDetalle(item);
                    }

                    /* Depositos */
                    CobranzaPagoBE CobranzaPagoBE = new CobranzaPagoBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                    };
                    new CobranzaPagoBL().ProcesarCobranzaPago(CobranzaPagoBE);

                    foreach (CobranzaPagoBE oEntity in LstCobranzaPago)
                    {
                        oEntity.USUARIO    = General.General.GetCodigoUsuario;
                        oEntity.OPCION     = 2;
                        oEntity.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        new CobranzaPagoBL().ProcesarCobranzaPago(oEntity);
                    }
                }

                this.btnImprimir.PerformClick();
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void LlenarCombos()
        {
            try
            {
                String      Table_Id    = "00134"; //Tipo Documento
                TableBaseBE TableBaseBE = new TableBaseBE()
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };
                General.General.LlenarCombobox(cboIdTipoDocumento_tt, "Table_Name", "Table_Id", new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0]);

                TableBaseBE.Table_Parent_Id = "00138"; //Tipo Persona
                General.General.LlenarCombobox(cboIdTipoPersona_tt, "Table_Name", "Table_Id", new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0]);

                UsuarioGestorBE oEntity = new UsuarioGestorBE()
                {
                    OPCION  = 8,
                    USUARIO = General.General.GetCodigoUsuario
                };

                if (Operacion.Equals("M"))
                {
                    oEntity.OPCION = 5;
                }

                DataTable dt = new DataTable();
                dt = new UsuarioGestorBL().ProcesarUsuarioGestor(oEntity).Tables[0];

                DataRow dr;
                dr = dt.NewRow();
                dr["usuarioID"] = "--Seleccionar--";
                dr["usuarioID"] = "--Seleccionar--";
                dt.Rows.InsertAt(dr, 0);

                cboUsuarioID.DataSource    = dt;
                cboUsuarioID.DisplayMember = "usuarioID";
                cboUsuarioID.ValueMember   = "usuarioID";

                TableBaseBE.OPCION          = 8;
                TableBaseBE.Table_Parent_Id = "129"; //Tipo Riesgo
                DataTable dtTipoRiesgo = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];
                cbocGlobal_TipoRiesgo.DataSource    = dtTipoRiesgo;
                cbocGlobal_TipoRiesgo.DisplayMember = "varDescripcion";
                cbocGlobal_TipoRiesgo.ValueMember   = "varCodigo";
                cbocGlobal_TipoRiesgo.SelectedValue = 0;

                TableBaseBE.OPCION          = 8;
                TableBaseBE.Table_Parent_Id = "21"; //Tipo Empresa
                DataTable dtTipoEmpresa = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0];
                cbocGlobal_TipoEmpresa.DataSource    = dtTipoEmpresa;
                cbocGlobal_TipoEmpresa.DisplayMember = "varDescripcion";
                cbocGlobal_TipoEmpresa.ValueMember   = "varCodigo";
                cbocGlobal_TipoEmpresa.SelectedValue = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }