Example #1
0
 private void viewMetroButton_Click(object sender, EventArgs e)
 {
     transactions = new List <Transaction>();
     try
     {
         transactions = transactionDataAccess.GetAllTransaction(fromDateTimePicker.Value, toDateTimePicker.Value);
         if (transactions == null)
         {
             MessageBox.Show("No transaction", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             LoadListView(transactions);
             if (profit < 0)
             {
                 profitLabel.Text = String.Format("Expense is {0}k BDT more than income", -profit);
             }
             else
             {
                 profitLabel.Text = String.Format("Income is {0}k BDT more than expense", profit);
             }
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("Error occured during loading database", "Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }