コード例 #1
0
ファイル: Booking.cs プロジェクト: mariusnorheim/app2000v
        // Button 'All' in the hall section
        // Display all hall reservations
        private void buttonDisplayHallAll_Click(object sender, EventArgs e)
        {
            // Fetch dataset
            DataSet hallreservationDS = DBGetData.GetHallBookingsAll(1);

            if (hallreservationDS != null)
            {
                // No tables fetched
                if (hallreservationDS.Tables.Count == 0)
                {
                    new StatusMessage("No datatable found, contact administrator.");
                    return;
                }
                // No rows fetched
                else if (hallreservationDS.Tables[0].Rows.Count == 0)
                {
                    new StatusMessage("No datarows found in table.");
                    return;
                }
                // Clear labelStatus for previous messages
                else
                {
                    new StatusMessage("");
                }

                // Set the dataset as source for datagridview and make sure its displayed
                dataGridViewHall.DataSource = hallreservationDS;
                dataGridViewHall.DataMember = "Get_HR_All";
                LoadDataGridViewHall();
            }
        }