Exemplo n.º 1
0
        override public void setMonthAndYears(ReportDialogBox view, Building apartment)
        {
            List <String> months      = new List <String>();
            List <String> years       = new List <String>();
            string        selectQuery = "SELECT DISTINCT MONTH(" + TABLE_OUTGOING_TRANSACTION.KEY_DATE + "), YEAR(" + TABLE_OUTGOING_TRANSACTION.KEY_DATE + ") FROM " +
                                        Util.VIEWS.EXPENSE_REPORT_VIEW + " WHERE " + TABLE_EXPENSES.KEY_APARTMENT_ID + " = '" + apartment.getID() + "'";

            connection.Open();

            using (SqlCommand command = new SqlCommand(selectQuery, connection))
            {
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        if (Convert.ToInt32(reader[0]) != DateTime.Now.Month || Convert.ToInt32(reader[1]) != DateTime.Now.Year)
                        {
                            int month = Convert.ToInt32(reader[0]);

                            months.Add(miscFunctions.ToMonthName(month));
                            years.Add(reader[1].ToString());
                        }
                    }
                }
            }

            connection.Close();
            view.setMonths(months);
            view.setYears(years);
        }
Exemplo n.º 2
0
        public override void generateReprt(ReportDialogBox view, Building apartment, int month, int year)
        {
            int incomeSum = 0, expenseSum = 0;

            view.exportPdf(generateIncomeReport(apartment, month, year, ref incomeSum), generateExpenseReport(apartment, month, year, ref expenseSum), incomeSum, expenseSum);
        }
Exemplo n.º 3
0
 virtual public void setMonthAndYears(ReportDialogBox view, Building apartment)
 {
 }
Exemplo n.º 4
0
 virtual public void generateReprt(ReportDialogBox view, Building apartment, int month, int year)
 {
 }