List <Feast> DeleteExistingFeast(List <Feast> lst) { List <Feast> lstAll = ClientEnvironment.CountryService.FeastService.GetFeastsFiltered(Country.ID, null, null); CountryFeastList lstFeast = new CountryFeastList(Country.ID); lstFeast.CopyList(lstAll); for (int i = lst.Count - 1; i >= 0; i--) { if (lstFeast.IsExistsFeast(lst[i].FeastDate.ToString().Remove(10))) { lst.RemoveAt(i); } } return(lst); }
public override void Bind() { base.Bind(); if (m_weekDays.Count == 0) { m_weekDays[(int)DayOfWeek.Monday] = GetLocalized(DayOfWeek.Monday.ToString()); m_weekDays[(int)DayOfWeek.Tuesday] = GetLocalized(DayOfWeek.Tuesday.ToString()); m_weekDays[(int)DayOfWeek.Wednesday] = GetLocalized(DayOfWeek.Wednesday.ToString()); m_weekDays[(int)DayOfWeek.Thursday] = GetLocalized(DayOfWeek.Thursday.ToString()); m_weekDays[(int)DayOfWeek.Friday] = GetLocalized(DayOfWeek.Friday.ToString()); m_weekDays[(int)DayOfWeek.Saturday] = GetLocalized(DayOfWeek.Saturday.ToString()); m_weekDays[(int)DayOfWeek.Sunday] = GetLocalized(DayOfWeek.Sunday.ToString()); } if (Country == null) { return; } _bindingFeasts = new CountryFeastList(Country.ID); _bindingFeasts.Clear(); gridControl1.DataSource = _bindingFeasts; }