コード例 #1
0
        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);
            }
        }
コード例 #2
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);
     }
 }