private void InThongKeCR_Load(object sender, EventArgs e)
        {
            if (data != null)
            {
                if (nhapkhau)
                {
                    ThongKeNhap rpt = new ThongKeNhap();
                    rpt.SetDataSource(data);


                    rpt.SetParameterValue("NhanVienTruc", user.Field <string>("HOTEN"));
                    rpt.SetParameterValue("NgayBatDau", begin);
                    rpt.SetParameterValue("NgayKetThuc", end);
                    rpt.SetParameterValue("TongTien", 0);

                    crystalReportViewer1.ReportSource = rpt;
                    crystalReportViewer1.Refresh();
                }
                else
                {
                    ThongKeXuat rpt = new ThongKeXuat();
                    rpt.SetDataSource(data);


                    rpt.SetParameterValue("NhanVienTruc", user.Field <string>("HOTEN"));
                    rpt.SetParameterValue("NgayBatDau", begin);
                    rpt.SetParameterValue("NgayKetThuc", end);
                    rpt.SetParameterValue("TongTien", 0);

                    crystalReportViewer1.ReportSource = rpt;
                    crystalReportViewer1.Refresh();
                }
            }
        }
Ejemplo n.º 2
0
        public List <ThongKeNhap> getThongKeNhap(DateTime d1, DateTime d2)
        {
            List <ThongKeNhap> ls    = new List <ThongKeNhap>();
            string             query = String.Format("EXEC dbo.PB_ThongKeNhap @frist = '{0}',@second = '{1}'", d1.ToString("yyyy-MM-dd"), d2.ToString("yyyy-MM-dd"));
            // string query = "EXEC dbo.PB_getThongKeTiem @first = '2020-01-21',@sencond = '2020-04-21'";
            DataTable data = DataProvider.Instance.ExcuteQuery(query);

            foreach (DataRow item in data.Rows)
            {
                ThongKeNhap tk = new ThongKeNhap(item);

                ls.Add(tk);
            }
            return(ls);
        }