Beispiel #1
0
        private void btnEliminar_Click_1(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvTarifario.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de Eliminar ...:" + dgvTarifario.CurrentRow.Cells["/* Agregar el campo a mostrar en el mensaje de confirmación */"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

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

                        TarifarioBL.ProcesarTarifario(TarifarioBE);
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
        public DataSet ProcesarTarifario(TarifarioBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Tarifario_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdTarifario", DbType.String, BE.IdTarifario);
                db.AddInParameter(cmd, "tipCxcID", DbType.String, BE.tipCxcID);
                db.AddInParameter(cmd, "IdTipoCalculo_tt", DbType.String, BE.IdTipoCalculo_tt);
                db.AddInParameter(cmd, "IdCalculo_tt", DbType.String, BE.IdCalculo_tt);
                db.AddInParameter(cmd, "PorMonto", DbType.Decimal, BE.PorMonto);
                db.AddInParameter(cmd, "PorConcepto_tt", DbType.String, BE.PorConcepto_tt);
                db.AddInParameter(cmd, "Monto", DbType.Decimal, BE.Monto);
                db.AddInParameter(cmd, "IdFrecuencia_tt", DbType.String, BE.IdFrecuencia_tt);
                db.AddInParameter(cmd, "bTransferencia", DbType.Boolean, BE.bTransferencia);
                db.AddInParameter(cmd, "tipCxcNombre", DbType.String, BE.tipCxcNombre);
                db.AddInParameter(cmd, "IdSocio", DbType.String, BE.IdSocio);
                db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora);
                db.AddInParameter(cmd, "IdReferencia", DbType.String, BE.IdReferencia);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
        private void CargarDatos()
        {
            try
            {
                DataSet     dsTarifario = new DataSet();
                TarifarioBE TarifarioBE = new TarifarioBE()
                {
                    OPCION      = 1,
                    USUARIO     = General.General.GetCodigoUsuario,
                    IdTarifario = Codigo,   //txtIdTarifario.Text,
                };
                dsTarifario = TarifarioBL.ProcesarTarifario(TarifarioBE);
                if (dsTarifario.Tables[0].Rows.Count > 0)
                {
                    cboConcepto.SelectedValue         = dsTarifario.Tables[0].Rows[0]["IdReferencia"].ToString();
                    cboIdTipoCalculo_tt.SelectedValue = dsTarifario.Tables[0].Rows[0]["IdTipoCalculo_tt"].ToString();
                    if (String.Equals(dsTarifario.Tables[0].Rows[0]["IdCalculo_tt"].ToString(), "00096")) //Por Porcentaje
                    {
                        rbPorcentaje.Checked         = true;
                        gpMonto.Enabled              = false;
                        txtPorMonto.Text             = Convert.ToDecimal(dsTarifario.Tables[0].Rows[0]["PorMonto"]).ToString("N3");
                        cboPorConcepto.SelectedValue = dsTarifario.Tables[0].Rows[0]["PorConcepto_tt"].ToString();
                    }
                    else if (String.Equals(dsTarifario.Tables[0].Rows[0]["IdCalculo_tt"].ToString(), "00097")) //Por Monto
                    {
                        rbMonto.Checked      = true;
                        gpPorcentaje.Enabled = false;
                        txtMonto.Text        = Convert.ToDecimal(dsTarifario.Tables[0].Rows[0]["Monto"]).ToString("N3");
                    }

                    txttipCxcID.Text            = dsTarifario.Tables[0].Rows[0]["tipCxcID"].ToString();
                    cboFrecuencia.SelectedValue = dsTarifario.Tables[0].Rows[0]["IdFrecuencia_tt"].ToString();
                    chkTransferencia.CheckValue = dsTarifario.Tables[0].Rows[0]["bTransferencia"];
                    txtIdSocio.Text             = dsTarifario.Tables[0].Rows[0]["IdSocio"].ToString();
                    txtRazonSocialSocio.Text    = dsTarifario.Tables[0].Rows[0]["IdSocio_Dsc"].ToString();
                    txtIdPagadora.Text          = dsTarifario.Tables[0].Rows[0]["IdPagadora"].ToString();
                    txtDescripcion.Text         = dsTarifario.Tables[0].Rows[0]["IdPagadora_Dsc"].ToString();
                }
                else
                {
                    MessageBox.Show("Este .... no Existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void cboConcepto_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataSet     dsTarifario = new DataSet();
                TarifarioBE TarifarioBE = new TarifarioBE()
                {
                    OPCION      = 1,
                    USUARIO     = General.General.GetCodigoUsuario,
                    IdTarifario = cboConcepto.SelectedValue.ToString(),
                };

                dsTarifario = TarifarioBL.ProcesarTarifario(TarifarioBE);

                if (dsTarifario.Tables[0].Rows.Count > 0)
                {
                    btnBuscarPagadora.Enabled         = false;
                    cboIdTipoCalculo_tt.SelectedValue = dsTarifario.Tables[0].Rows[0]["IdTipoCalculo_tt"].ToString();
                    if (cboIdTipoCalculo_tt.SelectedValue.ToString().Equals("00128")) // Pagadora
                    {
                        btnBuscarPagadora.Enabled = true;
                    }

                    if (String.Equals(dsTarifario.Tables[0].Rows[0]["IdCalculo_tt"].ToString(), "00096")) //Por Porcentaje
                    {
                        rbPorcentaje.Checked         = true;
                        gpMonto.Enabled              = false;
                        txtPorMonto.Text             = Convert.ToDecimal(dsTarifario.Tables[0].Rows[0]["PorMonto"]).ToString("N3");
                        cboPorConcepto.SelectedValue = dsTarifario.Tables[0].Rows[0]["PorConcepto_tt"].ToString();
                    }
                    else if (String.Equals(dsTarifario.Tables[0].Rows[0]["IdCalculo_tt"].ToString(), "00097")) //Por Monto
                    {
                        rbMonto.Checked      = true;
                        gpPorcentaje.Enabled = false;
                        txtMonto.Text        = Convert.ToDecimal(dsTarifario.Tables[0].Rows[0]["Monto"]).ToString("N3");
                    }
                    txttipCxcID.Text            = dsTarifario.Tables[0].Rows[0]["tipCxcID"].ToString();
                    cboFrecuencia.SelectedValue = dsTarifario.Tables[0].Rows[0]["IdFrecuencia_tt"].ToString();
                    chkTransferencia.CheckValue = dsTarifario.Tables[0].Rows[0]["bTransferencia"];
                    cboMoneda.SelectedValue     = dsTarifario.Tables[0].Rows[0]["valorMonedaID"].ToString().Equals("1") ? "00036" : "00037"; // Soles:Dolares
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #5
0
 private void btnBuscar_Click_1(object sender, EventArgs e)
 {
     try
     {
         DataSet     ds          = new DataSet();
         TarifarioBE TarifarioBE = new TarifarioBE()
         {
             OPCION       = 4,
             USUARIO      = General.General.GetUsuario,
             tipCxcNombre = TextBoxX1.Text.ToString().Trim(),
         };
         ds = TarifarioBL.ProcesarTarifario(TarifarioBE);
         dgvTarifario.DataSource = ds.Tables[0];
         lblRegistros.Text       = ds.Tables[0].Rows.Count.ToString() + " registro(s)";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        /* LLenar Combobox */

        private void LlenarCombos()
        {
            try
            {
                //cboConcepto
                TarifarioBE TarifarioBE = new TarifarioBE()
                {
                    OPCION  = 5,
                    USUARIO = General.General.GetUsuario
                };
                General.General.LlenarCombobox(cboConcepto, "tipCxcNombre", "tipCxcID", TarifarioBL.ProcesarTarifario(TarifarioBE).Tables[0]);

                // Combos de Tabla Base
                String      Table_Id    = "00102"; // Porcentaje Conceptos
                TableBaseBE TableBaseBE = new TableBaseBE()
                {
                    OPCION          = 1,
                    USUARIO         = General.General.GetCodigoUsuario,
                    Table_Parent_Id = Table_Id
                };
                General.General.LlenarCombobox(cboPorConcepto, "Table_Name", "Table_Id", TableBaseBL.ProcesarTableBase(TableBaseBE).Tables[0]);

                TableBaseBE.Table_Parent_Id = "00098"; // Frecuencia
                General.General.LlenarCombobox(cboFrecuencia, "Table_Name", "Table_Id", TableBaseBL.ProcesarTableBase(TableBaseBE).Tables[0]);

                TableBaseBE.Table_Parent_Id = "00035"; // Moneda
                General.General.LlenarCombobox(cboMoneda, "Table_Name", "Table_Id", TableBaseBL.ProcesarTableBase(TableBaseBE).Tables[0]);

                TableBaseBE.Table_Parent_Id = "00126"; // Tipo de Calculo
                General.General.LlenarCombobox(cboIdTipoCalculo_tt, "Table_Name", "Table_Id", TableBaseBL.ProcesarTableBase(TableBaseBE).Tables[0]);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void cboConcepto_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataSet     dsCxC       = new DataSet();
                TarifarioBE TarifarioBE = new TarifarioBE()
                {
                    OPCION   = 6,
                    USUARIO  = General.General.GetCodigoUsuario,
                    tipCxcID = cboConcepto.SelectedValue.ToString(),
                };

                dsCxC = TarifarioBL.ProcesarTarifario(TarifarioBE);

                if (dsCxC.Tables[0].Rows.Count > 0)
                {
                    cboMoneda.SelectedValue = dsCxC.Tables[0].Rows[0]["valorMonedaID"].ToString().Equals("1") ? "00036" : "00037";  // Soles:Dolares
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public DataSet ProcesarTarifario(TarifarioBE BE)
 {
     return(TarifarioDA.ProcesarTarifario(BE));
 }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (cboConcepto.SelectedIndex < 1)
                {
                    MessageBox.Show("Se debe Ingresar un Concepto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cboConcepto.Focus();
                    return;
                }

                if (cboIdTipoCalculo_tt.SelectedIndex < 1)
                {
                    MessageBox.Show("Se debe seleccionar un tipo de calculo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cboIdTipoCalculo_tt.Focus();
                    return;
                }

                if (cboFrecuencia.SelectedIndex < 1)
                {
                    MessageBox.Show("Se debe seleccionar una Frecuencia", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    cboFrecuencia.Focus();
                    return;
                }

                if (rbMonto.Checked == true)
                {
                    if (Convert.ToDouble(txtMonto.Text) < 0)
                    {
                        MessageBox.Show("Debe ingresar un monto mayor a CERO", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        txtMonto.Focus();
                    }
                }

                if (rbPorcentaje.Checked == true)
                {
                    if (Convert.ToDouble(txtPorMonto.Text) < 0)
                    {
                        MessageBox.Show("Debe ingresar un porcentaje mayor a CERO", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        txtPorMonto.Focus();
                    }
                    if (cboPorConcepto.SelectedIndex < 1)
                    {
                        MessageBox.Show("Debe seleccionar Ingresar un Concepto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        cboPorConcepto.Focus();
                        return;
                    }
                }

                TarifarioBE TarifarioBE = new TarifarioBE()
                {
                    USUARIO          = General.General.GetCodigoUsuario,
                    OPCION           = 2,
                    IdTarifario      = this.Codigo,
                    tipCxcID         = cboConcepto.SelectedValue.ToString(),
                    IdTipoCalculo_tt = cboIdTipoCalculo_tt.SelectedValue.ToString(),
                    IdCalculo_tt     = ((rbPorcentaje.Checked) == true ? "00096" : "00097"),
                    PorMonto         = String.IsNullOrEmpty(txtPorMonto.Text.Trim()) ? 0 : Convert.ToDecimal(txtPorMonto.Text),
                    PorConcepto_tt   = cboPorConcepto.SelectedValue.ToString(),
                    Monto            = String.IsNullOrEmpty(txtMonto.Text.Trim()) ? 0 : Convert.ToDecimal(txtMonto.Text),
                    IdFrecuencia_tt  = cboFrecuencia.SelectedValue.ToString(),
                    bTransferencia   = chkTransferencia.Checked ? true : false,
                };

                DataSet dsTarifario = new DataSet();
                dsTarifario = TarifarioBL.ProcesarTarifario(TarifarioBE);
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }