Example #1
0
        private void buttonDisplayDue_Click(object sender, EventArgs e)
        {
            // Fetch dataset
            DataSet folioDS = DBGetData.GetFolioDGVDue();

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

                // Set the dataset as source for datagridview and make sure its displayed
                dataGridViewFolio.DataSource = folioDS;
                dataGridViewFolio.DataMember = "Get_Folio_Due";
                LoadDataGridViewFolio();
            }
        }