コード例 #1
0
ファイル: Booking.cs プロジェクト: jacov/nor-port
        private void RefreshBookingFinancialTransactions()
        {
            BookingSearchService bookingFinancialTransactions = new BookingSearchService();
            BindingSource        bindingSource = new BindingSource();

            try {
                bindingSource.DataSource =
                    bookingFinancialTransactions.BookingFinancialTransactions(
                        _bookingContract.Booking.BookingId
                        );

                dataGridViewBookingFinancialTransactions.AutoGenerateColumns = true;
                dataGridViewBookingFinancialTransactions.DataSource          = bindingSource;
                dataGridViewBookingFinancialTransactions.AutoResizeColumns();
                // select last (totals) row
                dataGridViewBookingFinancialTransactions.Rows[0].Selected = false;
                dataGridViewBookingFinancialTransactions.Rows[dataGridViewBookingFinancialTransactions.Rows.Count - 1].Selected = true;

                dataGridViewBookingFinancialTransactions.Refresh();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                bookingFinancialTransactions.Close();
            }
        }
コード例 #2
0
ファイル: Booking.cs プロジェクト: jacov/nor-port
        private void RefreshBookingFinancialPayments()
        {
            BookingSearchService bookingFinancialPayments = new BookingSearchService();
            BindingSource        bindingSource            = new BindingSource();

            try {
                bindingSource.DataSource = bookingFinancialPayments.BookingFinancialPayments(_bookingContract.Booking.BookingId);
                dataGridViewBookingFinancialPayments.AutoGenerateColumns = true;
                dataGridViewBookingFinancialPayments.DataSource          = bindingSource;
                dataGridViewBookingFinancialPayments.AutoResizeColumns();
                dataGridViewBookingFinancialPayments.Refresh();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                bookingFinancialPayments.Close();
            }
        }
コード例 #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            BookingSearchService bookingsOpen  = new BookingSearchService();
            BindingSource        bindingSource = new BindingSource();

            try {
                bindingSource.DataSource             = bookingsOpen.BookingsOpen();
                gridBookingsOpen.AutoGenerateColumns = true;
                gridBookingsOpen.DataSource          = bindingSource;
                gridBookingsOpen.AutoResizeColumns();
                gridBookingsOpen.Refresh();
            } catch (Exception ex) {
                Singleton.Instance.Error(ex);
                MessageBox.Show(ex.Message);
            } finally {
                bookingsOpen.Close();
            }
        }
コード例 #4
0
        public void ShowAsEdit(System.Guid bookingPassengerId)
        {
            var service = new BookingSearchService();

            _isNew = false;
            try {
                _contract = service.BookingPassengerWithExtra(bookingPassengerId);
                passengerTypeRefCombo.Text  = _contract.PassengerTypeRcd != null ? _contract.PassengerTypeRcd : String.Empty;
                textBoxPassengerName.Text   = _contract.PassengerName;
                defaultStateRefCombo.Text   = _contract.DefaultStateRcd;
                userPicker.SelectedValue    = _contract.UserId;
                dateTimePickerDateTime.Text = _contract.DateTime.ToString();

                Show();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            } finally {
                service.Close();
            }
        }
コード例 #5
0
ファイル: ChartController.cs プロジェクト: jacov/nor-port
        public ActionResult BookingStatisticsIndex()
        {
            Logging.ActionLog(Request, "BookingStatisticsIndex ( ASP MVC WCF )");
            DateTime fromDateTime  = DateTime.UtcNow.AddDays(-20);
            DateTime untilDateTime = DateTime.UtcNow.AddDays(+20);

            List <BookingStatisticsContract> statistics =
                new BookingSearchService().BookingStatistics(
                    Guid.Empty,
                    Guid.Empty,
                    fromDateTime,
                    untilDateTime
                    );

            // create a collection of data
            var statisticsCounts = new List <BookingStatistics>();

            foreach (BookingStatisticsContract contract in statistics)
            {
                statisticsCounts.Add(
                    new BookingStatistics()
                {
                    Day        = contract.Date.ToString("yyyyMMdd"),
                    Passengers = contract.PassengersBookedCount,
                    Adults     = contract.AdultBookedCount,
                    Childs     = contract.ChildBookedCount,
                    Infants    = contract.InfantBookedCount
                }
                    );
            }

            // modify data type to make it of array type
            var xDataMonths     = statisticsCounts.Select(i => i.Day).ToArray();
            var yDataPassengers = statisticsCounts.Select(i => new object[] { i.Passengers }).ToArray();
            var yDataAdults     = statisticsCounts.Select(i => new object[] { i.Adults }).ToArray();
            var yDataChildren   = statisticsCounts.Select(i => new object[] { i.Childs }).ToArray();
            var yDataInfants    = statisticsCounts.Select(i => new object[] { i.Infants }).ToArray();

            // instantiate an object of the High charts type
            var chart = new Highcharts("chart")

                        // define the type of chart
                        .InitChart(new Chart {
                DefaultSeriesType = ChartTypes.Line
            })

                        // overall Title of the chart
                        .SetTitle(new Title {
                Text = "nor-port"
            })

                        // small label below the main Title
                        .SetSubtitle(new Subtitle {
                Text = "Bookings from " + fromDateTime.ToShortDateString() + " until " + untilDateTime.ToShortDateString()
            })

                        // load the X values
                        .SetXAxis(new XAxis {
                Categories = xDataMonths
            })

                        // set the Y title
                        .SetYAxis(new YAxis {
                Title = new YAxisTitle {
                    Text = "Bookings"
                }
            })
                        .SetYAxis(new YAxis {
                Title = new YAxisTitle {
                    Text = "Adults"
                }
            })
                        .SetYAxis(new YAxis {
                Title = new YAxisTitle {
                    Text = "Children"
                }
            })
                        .SetYAxis(new YAxis {
                Title = new YAxisTitle {
                    Text = "Infants"
                }
            })
                        .SetTooltip(
                new Tooltip {
                Enabled   = true,
                Formatter = @"function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; }"
            })
                        .SetPlotOptions(new PlotOptions {
                Line = new PlotOptionsLine {
                    DataLabels = new PlotOptionsLineDataLabels {
                        Enabled = true
                    },
                    EnableMouseTracking = false
                }
            })

                        // load the Y values
                        .SetSeries(new[]
                                   { new Series {
                                         Name = "Bookings", Data = new Data(yDataPassengers)
                                     },
                                     new Series {
                                         Name = "Adults", Data = new Data(yDataAdults)
                                     },
                                     new Series {
                                         Name = "Children", Data = new Data(yDataChildren)
                                     },
                                     new Series {
                                         Name = "Infants", Data = new Data(yDataInfants)
                                     } });

            return(View(chart));
        }