/// <summary> /// Allows to do visible or invisible a matriz buttom /// </summary> /// <param name="num">text of the button</param> /// <returns> true if is free otherwise false</returns> private bool disponibilidadAsientos(int num) { TiquetesBOL x = new TiquetesBOL(); int cap = Convert.ToInt32(tdUni.CurrentRow.Cells[4].Value.ToString()); bool encontrado = true; List <int> z = x.camposDisponibles(dateTimePicker1.Value.ToString("dd/MM/yyyy"), tabla.CurrentRow.Cells[4].Value.ToString()); //txtMonto.Text = Convert.ToString(z[1]); if (num <= cap) { if (z.Count == 0) { encontrado = true; } for (int i = 0; i <= z.Count - 1; i++) { if (z[i] == num) { encontrado = false; } //encontrado = true; } } else { encontrado = false; } return(encontrado); }
/// <summary> /// Allows to charge the available seats for a specific date /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DateTimePicker1_ValueChanged(object sender, EventArgs e) { TiquetesBOL x = new TiquetesBOL(); string fec = dateTimePicker1.Value.ToString("dd/MM/yyyy"); if (tabla.CurrentRow.Cells[3].Value.ToString().ToLower().Equals(dateTimePicker1.Value.ToString("dddd", new CultureInfo("es-ES")))) { List <int> z = x.camposDisponibles(fec, tabla.CurrentRow.Cells[4].Value.ToString()); quitarAsiento(); } else { MessageBox.Show("Seleccione un dia d que corresponda al del horario"); } // x.camposDisponibles(fec); //string ds = "27/04/1999"; // MessageBox.Show(dateTimePicker1.Value.ToString("dddd", new CultureInfo("es-ES"))); // DateTime userDate = DateTime.ParseExact(ds, "dd/MM/yyyy", null); //MessageBox.Show(userDate.ToString("dddd",new CultureInfo("es-ES"))); }