public void CargarDetalleMetodoPago()
        {
            clsMetodoPago metodo   = new clsMetodoPago();
            DataSet       detalles = metodo.leerDetalleMetodoPago(ClaveMetodoPago);

            if (detalles != null && detalles.Tables[0].Rows.Count > 0)
            {
                DataTable tabla = detalles.Tables[0];
                if (tabla.Rows.Count > 1)
                {
                    cmbDetalle.Visible       = true;
                    cmbDetalle.DataSource    = tabla;
                    cmbDetalle.ValueMember   = "met1_identi";
                    cmbDetalle.DisplayMember = "met1_descripc";
                    tipoDetalle   = TipoDetalle.Multiple;
                    NombreDetalle = tabla.Rows[0][0].ToString();
                }
                else if (tabla.Rows.Count > 0)
                {
                    txtDetalle.Visible    = true;
                    lblTituloDetalle.Text = tabla.Rows[0][2].ToString();
                    tipoDetalle           = TipoDetalle.Sencillo;
                    IdDetalle             = tabla.Rows[0][1].ToString();
                    NombreDetalle         = tabla.Rows[0][0].ToString();
                }
                else
                {
                    IdDetalle     = "0";
                    NombreDetalle = "0";
                    Referencia    = "0";
                }
            }
        }
Пример #2
0
 public Creditos_entre_fechas_rubro(DateTime fecha1, DateTime fecha2, TipoDetalle rubro)
 {
     InitializeComponent();
     this.fecha1   = fecha1;
     this.fecha2   = fecha2;
     this.rubro    = rubro.Descripcion;
     this.id_rubro = rubro.IdTipoDetalle;
 }
        // POST: odata/TipoDetalles
        public async Task <IHttpActionResult> Post(TipoDetalle tipoDetalle)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TipoDetalle.Add(tipoDetalle);
            await db.SaveChangesAsync();

            return(Created(tipoDetalle));
        }
        // DELETE: odata/TipoDetalles(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] int key)
        {
            TipoDetalle tipoDetalle = await db.TipoDetalle.FindAsync(key);

            if (tipoDetalle == null)
            {
                return(NotFound());
            }

            db.TipoDetalle.Remove(tipoDetalle);
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #5
0
 private void filtro_Click(object sender, EventArgs e)
 {
     try
     {
         //Obtener el rubro
         this.creditosDataset.EnforceConstraints = false;
         TipoDetalle det = (TipoDetalle)cboRubros.SelectedItem;
         if (!det.Descripcion.Equals("NINGUNO"))
         {
             cREDITOS_POR_BUS_RUBROTableAdapter.Fill(creditosDataset.CREDITOS_POR_BUS_RUBRO, data.Id_Vehiculo, det.IdTipoDetalle, dtFecha1.Value, dtFecha2.Value);
             dgDatos.DataSource = cREDITOSPORBUSRUBROBindingSource;
         }
         else
         {
             cREDITOS_POR_BUSTableAdapter.Fill(this.creditosDataset.CREDITOS_POR_BUS, data.Id_Vehiculo, dtFecha1.Value, dtFecha2.Value);
             dgDatos.DataSource = cREDITOSPORBUSBindingSource;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error Durante la conexion");
     }
 }
        // PUT: odata/TipoDetalles(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <TipoDetalle> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            TipoDetalle tipoDetalle = await db.TipoDetalle.FindAsync(key);

            if (tipoDetalle == null)
            {
                return(NotFound());
            }

            patch.Put(tipoDetalle);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TipoDetalleExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(tipoDetalle));
        }