public static SeatingChartInfo Show(IWin32Window parent, ParsedSeatingChart chart, IEnumerable<SeatingReservation> seats) { SeatInfo[] data = CreateDataSource(chart, seats); if (!data.Any()) { XtraMessageBox.Show("This seating chart has no issues!", "Shomrei Torah Billing", MessageBoxButtons.OK, MessageBoxIcon.Information); return null; } else { var form = new SeatingChartInfo(data); form.Show(parent); return form; } }
private static SeatInfo[] CreateDataSource(ParsedSeatingChart chart, IEnumerable<SeatingReservation> seats) { //CS means Chart Seat; RS means Reserved Seat. var data = new[] { //Extra seats chart.AllSeats.Where(cs => seats.All(rs => !cs.Matches(rs.Person))) .Select(cs => new SeatInfo(cs, message: "No matching reservation")), //Seats with wrong widths chart.AllSeats.Where(cs => !cs.CheckWidth()) .Select(cs => new SeatInfo(cs, message: "Width is wrong")), }.SelectMany(s => s).ToArray(); return data; }
private static SeatInfo[] CreateDataSource(ParsedSeatingChart chart, IEnumerable <SeatingReservation> seats) { //CS means Chart Seat; RS means Reserved Seat. var data = new[] { //Extra seats chart.AllSeats.Where(cs => seats.All(rs => !cs.Matches(rs.Person))) .Select(cs => new SeatInfo(cs, message: "No matching reservation")), //Seats with wrong widths chart.AllSeats.Where(cs => !cs.CheckWidth()) .Select(cs => new SeatInfo(cs, message: "Width is wrong")), }.SelectMany(s => s).ToArray(); return(data); }
public static SeatingChartInfo Show(IWin32Window parent, ParsedSeatingChart chart, IEnumerable <SeatingReservation> seats) { SeatInfo[] data = CreateDataSource(chart, seats); if (!data.Any()) { XtraMessageBox.Show("This seating chart has no issues!", "Shomrei Torah Billing", MessageBoxButtons.OK, MessageBoxIcon.Information); return(null); } else { var form = new SeatingChartInfo(data); form.Show(parent); return(form); } }
public void UpdateData(ParsedSeatingChart chart, IEnumerable<SeatingReservation> seats) { grid.DataSource = CreateDataSource(chart, seats); }
void BeginLoadChart(string name, Func<ParsedSeatingChart> loader) { lastChartName = name; lastChartLoader = loader; colChartStatus.Visible = colChartStatus.OptionsColumn.ShowInCustomizationForm = true; LoadingCaption = "Reading " + name + "..."; colChartStatus.ColumnEdit = gridLoadingEdit; ThreadPool.QueueUserWorkItem(delegate { try { chart = loader(); } catch (Exception ex) { BeginInvoke(new Action(delegate { LoadingCaption = null; colChartStatus.ColumnEdit = null; if (!Debugger.IsAttached) Program.Current.HandleException(ex); })); if (Debugger.IsAttached) Debugger.Break(); } BeginInvoke(new Action(delegate { try { if (seatGroups == null) seatGroups = new Dictionary<Person, int>(); else seatGroups.Clear(); refreshChart.Enabled = true; showChartInfo.Enabled = true; } finally { LoadingCaption = null; colChartStatus.ColumnEdit = null; gridView.RefreshData(); } })); }); }
public void UpdateData(ParsedSeatingChart chart, IEnumerable <SeatingReservation> seats) { grid.DataSource = CreateDataSource(chart, seats); }