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 frmRptListFilm : Form
    {
        public frmRptListFilm()
        {
            InitializeComponent();
        }

        private void frmRptListFilm_Load(object sender, EventArgs e)
        {
            Lsc_VideoClubDataContext db = new Lsc_VideoClubDataContext();
            var Query1 = from Row in db.tblMovies
                         where (Convert.ToBoolean(Row.AmanatBit.ToString()) == Convert.ToBoolean("false"))
                         select Row;
            tblMovieBindingSource.DataSource = Query1;
            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)
        {
            if (rdbListFilmMojod.Checked)
            {
                Lsc_VideoClubDataContext db = new Lsc_VideoClubDataContext();
                var Query1 = from Row in db.tblMovies
                             where (Convert.ToBoolean(Row.AmanatBit.ToString()) == Convert.ToBoolean("false"))
                             select Row;
                tblMovieBindingSource.DataSource = Query1;
            }
            else
                if (rdbListFilmTahvil.Checked)
                {
                    Lsc_VideoClubDataContext db = new Lsc_VideoClubDataContext();
                    var Query2 = from Row in db.tblMovies
                                 where (Convert.ToBoolean(Row.AmanatBit.ToString()) == Convert.ToBoolean("true"))
                                 select Row;
                    tblMovieBindingSource.DataSource = Query2;
                }

            this.reportViewer1.RefreshReport();
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent = 75;
        }
    }
}
