Exemple #1
0
 public static void ImportIncomeAndExpense(string INN)
 {
     for (int year = 2008; year <= 2020; year++)
     {
         IncomeAndExpenseDataProvider incomeAndExpenseDataProvider = new IncomeAndExpenseDataProvider();
         List <IncomeAndExpense>      listToImport = incomeAndExpenseDataProvider.LoadIncomeAndExpense(new IncomeAndExpenseTimePeriod(year));
         if (listToImport.Count != 0)
         {
             IncomeAndExpenseSQLiteDataProvider.Import(listToImport, year, INN);
         }
     }
 }
Exemple #2
0
        private void IncomeAndExpenseReportForm_Load(object sender, EventArgs e)
        {
            IncomeAndExpenseSQLiteDataProvider incomeAndExpenseDataProvider = new IncomeAndExpenseSQLiteDataProvider();
            List <IncomeAndExpense>            incomeAndExpense             = incomeAndExpenseDataProvider.Load(timePeriod, INN);

            incomeAndExpense.Sort(delegate(IncomeAndExpense ps1, IncomeAndExpense ps2) { return(DateTime.Compare(DateTime.Parse(ps1.Date), DateTime.Parse(ps2.Date))); });
            foreach (var i in incomeAndExpense)
            {
                i.Income  = Convert.ToDouble(i.Income).ToString("F2");
                i.Expense = Convert.ToDouble(i.Expense).ToString("F2");
            }
            IncomeAndExpenseBindingSource.DataSource = incomeAndExpense;

            string semesterName = "";

            switch (semesterToLoad)
            {
            case SemesterToLoad.FirstSemester:
            {
                semesterName += "I полугодие";
            } break;

            case SemesterToLoad.SecondSemester:
            {
                semesterName += "II полугодие";
            } break;

            case SemesterToLoad.BothSemesters:
            case SemesterToLoad.Period:
            {
                semesterName += "весь " + timePeriod.Year + " год";
            } break;
            }
            ReportParameter rp0    = new ReportParameter("rp0", semesterName);
            ReportParameter isDemo = new ReportParameter("isDemo", Constants.isDemoVersion.ToString());

            reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp0, isDemo });
            this.reportViewer1.RefreshReport();
        }
Exemple #3
0
 public IncomeAndExpenseLogic(DataGridView incomeAndExpenseGridView)
 {
     incomeAndExpenseDataProvider  = new IncomeAndExpenseSQLiteDataProvider();
     this.incomeAndExpenseGridView = incomeAndExpenseGridView;
 }