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

namespace RezerveBeliteHavaPeimaCS
{
    public partial class rptBelithafrm : Form
    {
        DataSet1 d1 = new DataSet1();
        public rptBelithafrm()
        {
            InitializeComponent();
        }

        private void rptBelithafrm_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'DataSet1.DataTable1' table. You can move, or remove it, as needed.
            this.DataTable1TableAdapter.Fill(this.DataSet1.DataTable1);
            SqlConnection con = new SqlConnection();
            con.ConnectionString = Properties.Settings.Default.RezerveBelitTotal_DataConnectionString.ToString();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;

            cmd.CommandText = @"SELECT     TOP 100 PERCENT RezerveTickets.RezerveID, RezerveTickets.RezerveDate, Custumers.NameSname, Custumers.PhoneNum, 
                      ServicesDef.ServiceDescript, RezerveTickets.QuanTity FROM         RezerveTickets INNER JOIN
                      Custumers ON RezerveTickets.RezerverID = Custumers.CustomerID INNER JOIN
                      ServicesDef ON RezerveTickets.ServiceID = ServicesDef.ServiceID ORDER BY RezerveTickets.RezerveID DESC";

            SqlDataAdapter da = new SqlDataAdapter(cmd);
            
            con.Open();
            da.Fill(d1, "DataTable1");
            con.Close();

            DataTable1BindingSource.DataSource = d1;
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent = 25;
            this.reportViewer1.RefreshReport();
        }
    }
}