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;
using CrystalDecisions.CrystalReports.Engine;
using System.Data.SqlClient;
using FarsiMsgBox;

namespace ajans
{
    public partial class form_rpt_driver : Form
    {
        public form_rpt_driver()
        {
            InitializeComponent();
        }

        private void btnprint_Click(object sender, EventArgs e)
        {
            driver Driver = new driver();
            DataTable dt = Driver.SelectDriverReport(txtdvrid.Text);
            ReportDocument rd = new ReportDocument();
            rd.Load("rptDriver.rpt");
            rd.SetDataSource(dt);
            crvdriver.ReportSource = rd;
            crvdriver.Show();
        }

        private void txtdvrid_KeyPress(object sender, KeyPressEventArgs e)
        {
            int i = e.KeyChar;
            if (i < 8 || 8 < i && i < 48 || i > 57)
            {
                e.Handled = true;
                System.Console.Beep();
            }

            else
                e.Handled = false;
        }
    }
}
