private void loadAvailableDays() { List <DAYS> getDays = DaysDao.getDays(); if (getDays != null) { int cont = 0; foreach (DAYS dia in getDays) { DateTime configuredDate = (DateTime)dia.completeDay; //ddlDay.Items.Insert(cont, new ListItem("Day " + dia.Day.ToString() + " " + CreateDateSuffix(configuredDate) + " of " + configuredDate.ToString("MMMM", new CultureInfo("en-US")), dia.Day.ToString())); ddlDay.Items.Insert(cont, new ListItem("Day " + dia.Day.ToString() + " " + CreateDateSuffix(configuredDate) + " of " + configuredDate.ToString("MMMM", new CultureInfo("en-US")), dia.idDay.ToString())); cont++; } ddlDay.Items.Insert(cont, new ListItem("Add new day...", "0")); ddlDay.SelectedIndex = 0; } }
private void LoadDays() { List <DAYS> dias = DaysDao.getDays(); for (int i = 1; i <= 30; i++) { //if (dias != null && dias.Count > 0) //{ // if ((from t in dias where ((int)t.Day) == i select t).FirstOrDefault() == null) // { ddlDayNew.Items.Add(i.ToString()); // } //} //else //{ // ddlDayNew.Items.Add(i.ToString()); //} } }