示例#1
0
 private void btnXem_Click(object sender, EventArgs e)
 {
     if (rdbNgay.Checked)
     {
         rdbThang.Enabled  = false;
         rdbTuNgay.Enabled = false;
         var         list   = db.HOADONs.Where(m => m.ThoiGian == dtpNgay.Value).ToList();
         rptDSHoaDon report = new rptDSHoaDon();
         report.DataSource = list;
         report.ShowPreviewDialog();
     }
     if (rdbThang.Checked)
     {
         rdbNgay.Enabled   = false;
         rdbTuNgay.Enabled = false;
         var         list   = db.HOADONs.Where(m => m.ThoiGian == dtpThang.Value).ToList();
         rptDSHoaDon report = new rptDSHoaDon();
         report.DataSource = list;
         report.ShowPreviewDialog();
     }
     else
     {
         rdbNgay.Enabled  = false;
         rdbThang.Enabled = false;
         var Tungay  = Convert.ToDateTime(dtpTuNgay.Value);
         var DenNgay = Convert.ToDateTime(dtpDenNgay.Value);
     }
 }
示例#2
0
        private void btnThongKe_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var         list   = db.HOADONs.ToList();
            rptDSHoaDon report = new rptDSHoaDon();

            report.DataSource = list;
            report.ShowPreviewDialog();
        }