public void byDay()
        {
            lsvGeneralReport.Items.Clear();
            //in
            ReceiptDao r       = new ReceiptDao();
            var        incomes = r.GetReceiptList();
            IDictionary <DateTime, double> list = new Dictionary <DateTime, double>();

            list.Add(incomes[0].PrintDate.Date, incomes[0].Total + incomes[0].AdditionalFee);
            for (int i = 1; i < incomes.Count; i++)
            {
                if (!list.ContainsKey(incomes[i].PrintDate.Date))
                {
                    list.Add(incomes[i].PrintDate.Date, incomes[i].Total + incomes[i].AdditionalFee);
                }
                else
                {
                    list[incomes[i].PrintDate.Date] += incomes[i].Total + incomes[i].AdditionalFee;
                }
            }

            //out
            PaymentDao p        = new PaymentDao();
            var        outcomes = p.GetPaymentList();
            IDictionary <DateTime, double> list1 = new Dictionary <DateTime, double>();

            list1.Add(outcomes[0].PayDate.Date, outcomes[0].TotalFee);
            for (int i = 1; i < outcomes.Count; i++)
            {
                if (!list1.ContainsKey(outcomes[i].PayDate.Date))
                {
                    list1.Add(outcomes[i].PayDate.Date, outcomes[i].TotalFee);
                }
                else
                {
                    list1[outcomes[i].PayDate.Date] += outcomes[i].TotalFee;
                }
            }


            foreach (KeyValuePair <DateTime, double> kvp in list)
            {
                string[]     row  = { kvp.Key.ToString(), kvp.Value.ToString(), "", (kvp.Value - 0).ToString() };
                ListViewItem item = new ListViewItem(row);
                lsvGeneralReport.Items.Add(item);
                foreach (KeyValuePair <DateTime, double> kvp1 in list1)
                {
                    if (kvp1.Key.Date == kvp.Key.Date)
                    {
                        string[] rows = { kvp.Key.ToString(), kvp.Value.ToString(), kvp1.Value.ToString(), (kvp.Value - kvp1.Value).ToString() };
                        item = new ListViewItem(rows);
                        lsvGeneralReport.Items.RemoveAt(lsvGeneralReport.Items.Count - 1);
                        lsvGeneralReport.Items.Add(item);
                    }
                }
            }
        }
        private void PaymentReportForm_Load(object sender, EventArgs e)
        {
            dtmStartDate.Format       = DateTimePickerFormat.Custom;
            dtmStartDate.CustomFormat = "yyyy-MMMM-dd";
            dtmEndDate.Format         = DateTimePickerFormat.Custom;
            dtmEndDate.CustomFormat   = "yyyy-MMMM-dd";

            paymentList = paymentDao.GetPaymentList();
            foreach (Payment payment in paymentList)
            {
                string[]     row  = { payment.PaymentID.ToString(), payment.PayDate.ToString(), payment.EmployeeID.ToString(), payment.Detail.ToString(), payment.TotalFee.ToString() };
                ListViewItem item = new ListViewItem(row);
                lsvGeneralReport.Items.Add(item);
            }
        }