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

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

        private void Btn_ShowCodeFactor_Click(object sender, EventArgs e)
        {
            this.tblMerchBuyBookTableAdapter.FillByCodeFactor(this.dtsHes.tblMerchBuyBook, Cmb_CodeFactor.SelectedValue.ToString());
            this.tblMerchBuyBookBindingSource.DataSource = this.dtsHes.tblMerchBuyBook;
            this.reportViewer1.RefreshReport();
        }

        private void Btn_ShowSerial_Click(object sender, EventArgs e)
        {
            this.tblMerchBuyBookTableAdapter.FillBySerialChech(this.dtsHes.tblMerchBuyBook, Cmb_SerialCheck.SelectedValue.ToString());
            this.tblMerchBuyBookBindingSource.DataSource = this.dtsHes.tblMerchBuyBook;
            this.reportViewer1.RefreshReport();
        }

        private void Btn_ShowDebtor_Click(object sender, EventArgs e)
        {
            this.tblMerchBuyBookTableAdapter.FillByDebtor(this.dtsHes.tblMerchBuyBook, Decimal.Parse(Txt_StartDebtor.Text.Trim()), Decimal.Parse(Txt_EndDebtor.Text.Trim()));
            this.tblMerchBuyBookBindingSource.DataSource = this.dtsHes.tblMerchBuyBook;
            this.reportViewer1.RefreshReport();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.tblMerchBuyBookTableAdapter.Fill(this.dtsHes.tblMerchBuyBook);
            this.tblMerchBuyBookBindingSource.DataSource = this.dtsHes.tblMerchBuyBook;
            this.reportViewer1.RefreshReport();
        }
    }
}
