using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VideoCloop
{
    public partial class frmRptDaramad : Form
    {
        public frmRptDaramad()
        {
            InitializeComponent();
        }

        private void frmRptDaramad_Load(object sender, EventArgs e)
        {
            Lsc_VideoClubDataContext db = new Lsc_VideoClubDataContext();
            var Query = from Row in db.xtblTahvils
                        select Row;
            xtblTahvilBindingSource.DataSource = Query;
            this.reportViewer1.RefreshReport();
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent = 75;
        }

        private void btnShow_Click(object sender, EventArgs e)
        {
            Lsc_VideoClubDataContext db=new Lsc_VideoClubDataContext();
            var Query = from Row in db.xtblTahvils
                        select Row;
            var Query2 = from Row2 in Query
                         where (Convert.ToDecimal(Row2.DateTahvil.Replace("/", "")) >= Convert.ToDecimal(Txt_BeginDate.Text.Replace("/", ""))) && (Convert.ToDecimal(Row2.DateTahvil.Replace("/", "")) <= Convert.ToDecimal(Txt_EndDate.Text.Replace("/", "")))
                         select Row2; 
            xtblTahvilBindingSource.DataSource = Query2;
            this.reportViewer1.RefreshReport();
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent =75;
        }
    }
}
