Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 public void UpdateData(ParsedSeatingChart chart, IEnumerable<SeatingReservation> seats)
 {
     grid.DataSource = CreateDataSource(chart, seats);
 }
Esempio n. 6
0
        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();
                    }
                }));
            });
        }
Esempio n. 7
0
 public void UpdateData(ParsedSeatingChart chart, IEnumerable <SeatingReservation> seats)
 {
     grid.DataSource = CreateDataSource(chart, seats);
 }