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 HesabdariSubSys
{
    public partial class frmReportSalary : Form
    {
        public frmReportSalary()
        {
            InitializeComponent();
        }

        private void frmReportSalary_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dtsHes.tblSalary' table. You can move, or remove it, as needed.
            this.tblSalaryTableAdapter.Fill(this.dtsHes.tblSalary);
            this.tblSalaryBindingSource.DataSource = this.dtsHes.tblSalary;
            this.reportViewer1.RefreshReport();
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent = 25;
        }

        private void Btn_ShowEmpCode_Click(object sender, EventArgs e)
        {
            this.tblSalaryTableAdapter.FillByEmpCode(this.dtsHes.tblSalary, Cmb_EmployeCode.SelectedValue.ToString());
            this.tblSalaryBindingSource.DataSource = this.dtsHes.tblSalary;
            this.reportViewer1.RefreshReport();
        }

        private void btn_Refresh_Click(object sender, EventArgs e)
        {
            this.tblSalaryTableAdapter.Fill(this.dtsHes.tblSalary);
            this.tblSalaryBindingSource.DataSource = this.dtsHes.tblSalary;
            this.reportViewer1.RefreshReport();
        }

        private void Btn_ShowDate_Click(object sender, EventArgs e)
        {
            this.tblSalaryTableAdapter.FillByPayDate(this.dtsHes.tblSalary , Msk_Txt_SDate.Text , Msk_Txt_EndDate.Text );
            this.tblSalaryBindingSource.DataSource = this.dtsHes.tblSalary;
            this.reportViewer1.RefreshReport();
        }


    }
}
