private void LoadYA()
        {
            DataTable dtData = null;

            switch (strFormType)
            {
            case "C":
            case "R":
                EFilingDAL dal = new EFilingDAL();
                dtData = dal.GetYA();
                break;

            case "B":
            case "BE":
            case "M":
                EFilingDALB dalB = new EFilingDALB();
                dtData = dalB.GetYA();
                break;

            case "P":
                EFilingDALB dalP = new EFilingDALB();
                dtData = dalP.GetYA();
                break;

            //PANYW CP204
            case "CP204":
                EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                dtData = dalCP204.GetYA();
                break;

            //PANYW CP204 END
            //NGOHCS CP204A
            case "CP204A":
                EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                dtData = dalCP204A.GetYA();
                break;

            //NGOHCS CP204A END
            default:
                EFilingDAL dalC = new EFilingDAL();
                dtData = dalC.GetYA();
                break;
            }
            toolStripCboYA.Items.Clear();
            foreach (DataRow drData in dtData.Rows)
            {
                toolStripCboYA.Items.Add(drData[0].ToString());
            }
        }
Exemple #2
0
        private void LoadData()
        {
            DataTable dtData = new DataTable();

            cboAuditor.Items.Clear();
            cboTaxAgent.Items.Clear();

            switch (cboForm.Text)
            {
            case "C":
                EFilingDAL dal = new EFilingDAL();
                dtData = dal.GetAuditor();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboAuditor.Items.Add(drData[0].ToString());
                }
                dtData = dal.GetTaxAgent();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboTaxAgent.Items.Add(drData[0].ToString());
                }
                dtData = dal.GetYA();
                break;

            case "R":
                EFilingDAL dalR = new EFilingDAL();
                dtData = dalR.GetAuditor();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboAuditor.Items.Add(drData[0].ToString());
                }
                dtData = dalR.GetYA();
                break;

            case "B":
            case "BE":
            case "M":
                EFilingDALB dalB = new EFilingDALB();
                dtData = dalB.GetTaxAgent();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboTaxAgent.Items.Add(drData[0].ToString());
                }
                dtData = dalB.GetYA();
                break;

            case "P":
                EFilingDALB dalP = new EFilingDALB();
                dtData = dalP.GetTaxAgent();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboTaxAgent.Items.Add(drData[0].ToString());
                }
                dtData = dalP.GetYA();
                break;

            //PANYW CP204
            case "CP204":
                EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                dtData = dalCP204.GetTaxAgent();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboTaxAgent.Items.Add(drData[0].ToString());
                }
                dtData = dalCP204.GetYA();
                break;

            //PANYW CP204 END
            default:
                EFilingDAL dalC = new EFilingDAL();
                dtData = dalC.GetAuditor();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboAuditor.Items.Add(drData[0].ToString());
                }
                dtData = dalC.GetTaxAgent();
                foreach (DataRow drData in dtData.Rows)
                {
                    cboTaxAgent.Items.Add(drData[0].ToString());
                }
                dtData = dalC.GetYA();
                break;
            }
            if (cboTaxAgent.Items.Count > 0)
            {
                cboTaxAgent.SelectedIndex = 0;
            }
            cboYA.Items.Clear();
            foreach (DataRow drData in dtData.Rows)
            {
                cboYA.Items.Add(drData[0].ToString());
                toolStripCboYA.Items.Add(drData[0].ToString());
            }
            //azham change ========================= 16-mar-2016
            if (cboForm.Text == "C")
            {
                toolStripCboYA.Text = "2017";
                cboYA.Text          = "2017";
            }
            else if (cboForm.Text == "R")
            {
                toolStripCboYA.Text = "2017";
                cboYA.Text          = "2017";
            }
            else
            {
                toolStripCboYA.Text = "2016";
                cboYA.Text          = "2016";
            }
            //   toolStripCboYA.Text = string.Format(Date.Now, "yyyy");
            //  cboYA.Text = string.Format(Date.Now, "yyyy");
            //azham change ========================= 16-mar-2016


            if (cboAuditor.Items.Count > 0)
            {
                cboAuditor.SelectedIndex = 0;
            }
        }