private void btnDisplay_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();

                String strMonth = cmbMonth.Text;


                DataTable dt3 = myYM.ListMonths();


                //dt = myRep.GetAmalgamation(cmbYear.Text, month);
                dt = myRep.GetAmalgamation(cmbYear.Text, Convert.ToInt32(cmbMonth.SelectedValue.ToString()));

                if (dt.Rows.Count > 0)
                {
                    DataSet ds = new DataSet();
                    ds.Tables.Add(dt);
                    ds.WriteXml("AmalgamaionRep.xml");

                    AmalgamationReport myReport = new AmalgamationReport();
                    myReport.SetDataSource(ds);
                    ReportViewer myViewer = new ReportViewer();

                    myReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                    myReport.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString());
                    myReport.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                    if (myProMWages.IsAllDivisionsProcessUnsuccessful(Convert.ToInt32(cmbYear.SelectedValue.ToString()), Convert.ToInt32(cmbMonth.SelectedValue.ToString())))
                    {
                        myReport.SetParameterValue("ProcessedStatus", "");
                    }
                    else
                    {
                        myReport.SetParameterValue("ProcessedStatus", "NOT FINALIZED");
                    }
                    myViewer.crystalReportViewer1.ReportSource = myReport;
                    myViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data Preview..!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occurred..!" + ex.Message);
            }
        }
        private void btnOldDisplay_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();

                String strMonth = cmbMonth.Text;

                for (Int32 month = 1; month <= 12; month++)
                {
                    if (strMonth == myYM.ListMonths().Rows[month - 1][1].ToString())
                    {
                        //dt = myRep.GetAmalgamation(cmbYear.Text, month);
                        dt = myRep.GetAmalgamationOld(cmbYear.Text, month);

                        if (dt.Rows.Count > 0)
                        {
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            ds.WriteXml("AmalgamaionRep.xml");

                            AmalgamationReport myReport = new AmalgamationReport();
                            myReport.SetDataSource(ds);
                            ReportViewer myViewer = new ReportViewer();

                            myReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                            myReport.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString());
                            myReport.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                            myReport.SetParameterValue("ProcessedStatus", "OLD REPORT");
                            myViewer.crystalReportViewer1.ReportSource = myReport;
                            myViewer.Show();
                        }
                        else
                        {
                            MessageBox.Show("No Data Preview..!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occurred..!" + ex.Message);
            }
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();

                String strMonth = cmbMonth.Text;


                DataTable dt3 = myYM.ListMonths();


                //dt = myRep.GetAmalgamation(cmbYear.Text, month);
                dt = myRep.GetAmalgamationDashBoard(cmbYear.Text, Convert.ToInt32(cmbMonth.SelectedValue.ToString()));

                if (dt.Rows.Count > 0)
                {
                    DataSet ds = new DataSet();
                    ds.Tables.Add(dt);
                    ds.WriteXml("AmalgamaionRep.xml");

                    AmalgamationReport myReport = new AmalgamationReport();
                    myReport.SetDataSource(ds);
                    ReportViewer myViewer = new ReportViewer();

                    myReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                    myReport.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString());
                    myReport.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text);
                    myViewer.crystalReportViewer1.ReportSource = myReport;
                    myViewer.Show();
                }
                else
                {
                    MessageBox.Show("No Data Preview..!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occurred..!" + ex.Message);
            }
        }