private void GetData2008()
        {
            EFilingDALP dalP = new EFilingDALP(strTaxPayer, strYA, "");

            if (strFormType == "P")
            {
                dsData = dalP.GetFormDataP("P2008Page7");
            }
            dalP.CloseConn();
            if (dsData.Tables["P6_TAXP_PARTNERS"].Rows.Count > 0)
            {
                dgEFMAK.DataSource = dsData.Tables["P6_TAXP_PARTNERS"];
            }
            else
            {
                this.Text = "No Maklumat Ahli Kongsi record found";
            }
        }
Exemplo n.º 2
0
        private void PopulateTaxPayer()
        {
            dgTaxPayer.DataSource = null;

            switch (cboForm.Text)
            {
            case "C":
            case "R":
                EFilingDAL dal = new EFilingDAL();
                //dgTaxPayer.DataSource = dal.GetTaxPayer(cboYA.Text);
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dal.GetTaxPayer(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dal.GetTaxPayerName(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dal.GetTaxPayerAll(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                break;

            case "B":
            case "BE":
                EFilingDALB dalB = new EFilingDALB();
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalB.GetTaxPayerB(toolStripTxtText.Text.ToString());   //dalB.GetTaxPayerB(cboYA.Text);
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalB.GetTaxPayerBName(toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalB.GetTaxPayerBAll(toolStripTxtText.Text.ToString());
                }
                break;

            case "M":
                EFilingDALB dalM = new EFilingDALB();
                //dgTaxPayer.DataSource = dalM.GetTaxPayerM(cboYA.Text);
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalM.GetTaxPayerM(toolStripTxtText.Text.ToString());   //dalB.GetTaxPayerB(cboYA.Text);
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalM.GetTaxPayerMName(toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalM.GetTaxPayerMAll(toolStripTxtText.Text.ToString());
                }
                break;

            case "P":
                EFilingDALP dalP = new EFilingDALP();
                //dgTaxPayer.DataSource = dalP.GetTaxPayer();
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalP.GetTaxPayer(toolStripTxtText.Text.ToString());   //dalB.GetTaxPayerB(cboYA.Text);
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalP.GetTaxPayerName(toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalP.GetTaxPayerAll(toolStripTxtText.Text.ToString());
                }
                break;

            //PANYW CP204
            case "CP204":
                EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalCP204.GetCP204TaxPayer(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalCP204.GetCP204TaxPayerName(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalCP204.GetCP204TaxPayerAll(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                break;

            //PANYW CP204
            case "CP204A":
                EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalCP204A.GetCP204ATaxPayer(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalCP204A.GetCP204ATaxPayerName(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalCP204A.GetCP204ATaxPayerAll(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                break;

            default:
                EFilingDAL dalC = new EFilingDAL();
                //dgTaxPayer.DataSource = dalC.GetTaxPayer(cboYA.Text);
                if (toolStripCboBy.Text == "Reference No" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalC.GetTaxPayer(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "Name" && toolStripTxtText.Text != "")
                {
                    dgTaxPayer.DataSource = dalC.GetTaxPayerName(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                if (toolStripCboBy.Text == "-All Record-")
                {
                    dgTaxPayer.DataSource = dalC.GetTaxPayerAll(cboYA.Text, toolStripTxtText.Text.ToString());
                }
                break;
            }
        }
        //private void tsbtnFill_Click(object sender, EventArgs e)
        //{
        //    SHDocVw.ShellWindows swTemp = new SHDocVw.ShellWindows();
        //    Boolean boolTargetFound = false;
        //    Boolean boolTargetReady = false;
        //    EFilingDALP dalP = new EFilingDALP();

        //    try
        //    {
        //        foreach (SHDocVw.InternetExplorer ieTemp in swTemp)
        //        {
        //            string strDocName = dalP.GetDocName(ieTemp.LocationURL.ToString().ToLower(), strYA);
        //            if (strDocName.Length > 0)
        //            {
        //                boolTargetFound = true;
        //                if (ieTemp.ReadyState.Equals(SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE))
        //                {
        //                    boolTargetReady = true;
        //                    if (typeof(mshtml.HTMLDocumentClass).IsAssignableFrom(ieTemp.Document.GetType()))
        //                    {
        //                        mshtml.HTMLDocument htmlDoc = ieTemp.Document as mshtml.HTMLDocument;
        //                        ProcessDocument(htmlDoc);
        //                    }
        //                }
        //            }
        //        }
        //        if (boolTargetFound == false)
        //            MessageBox.Show("No relevant document is found for E-Filling!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //        else if (boolTargetFound == true && boolTargetReady == false)
        //            MessageBox.Show("Document is not ready, please try again!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        //    }
        //    catch (Exception ex)
        //    { MessageBox.Show(ex.ToString()); }
        //}

        //private void toolStripButton1_Click(object sender, EventArgs e)
        //{
        //    GetData();
        //}

        //private void dgEFMAK_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        //{
        //    tsbtnFill_Click(sender, e);
        //}

        private void tsbtnFill_Click(object sender, EventArgs e)
        {
            SHDocVw.ShellWindows swTemp = new SHDocVw.ShellWindows();
            Boolean     boolTargetFound = false;
            Boolean     boolTargetReady = false;
            EFilingDALP dalP            = new EFilingDALP();

            string[] strData = new string[17];

            try
            {
                if (dgEFMAK.SelectedRows.Count > 0)
                {
                    if (!String.IsNullOrEmpty(dgEFMAK.SelectedRows[0].Cells[5].Value.ToString()))
                    {
                        strData[0] = DateTime.Parse(dgEFMAK.SelectedRows[0].Cells[5].Value.ToString()).ToString("dd/MM/yyyy");//tarik masuk
                    }
                    else
                    {
                        strData[0] = "";
                    }
                    if (!String.IsNullOrEmpty(dgEFMAK.SelectedRows[0].Cells[6].Value.ToString()))
                    {
                        strData[1] = DateTime.Parse(dgEFMAK.SelectedRows[0].Cells[6].Value.ToString()).ToString("dd/MM/yyyy");//tarik keluar
                    }
                    else
                    {
                        strData[1] = "";
                    }
                    strData[2]  = dgEFMAK.SelectedRows[0].Cells[0].Value.ToString();  //PREFIX
                    strData[3]  = dgEFMAK.SelectedRows[0].Cells[1].Value.ToString();  //REF
                    strData[4]  = dgEFMAK.SelectedRows[0].Cells[2].Value.ToString();  //NAME
                    strData[5]  = dgEFMAK.SelectedRows[0].Cells[3].Value.ToString();  //IC
                    strData[6]  = dgEFMAK.SelectedRows[0].Cells[4].Value.ToString();  //COUNTRY
                    strData[7]  = dgEFMAK.SelectedRows[0].Cells[7].Value.ToString();  //share
                    strData[8]  = dgEFMAK.SelectedRows[0].Cells[8].Value.ToString();  //b1
                    strData[9]  = dgEFMAK.SelectedRows[0].Cells[9].Value.ToString();  //b2
                    strData[10] = dgEFMAK.SelectedRows[0].Cells[10].Value.ToString(); //b3
                    strData[11] = dgEFMAK.SelectedRows[0].Cells[11].Value.ToString(); //ADJUTED INCOME
                    strData[12] = dgEFMAK.SelectedRows[0].Cells[12].Value.ToString(); //BALANCING CHARGE
                    strData[13] = dgEFMAK.SelectedRows[0].Cells[13].Value.ToString(); //BALANCING ALLOWANCE
                    strData[14] = dgEFMAK.SelectedRows[0].Cells[14].Value.ToString(); //schedule 4
                    strData[15] = dgEFMAK.SelectedRows[0].Cells[15].Value.ToString(); //export allowance
                    strData[16] = dsData.Tables["P6_TAXP_PREPARTNER"].Rows[0].ItemArray[0].ToString();
                }
                else
                {
                    MessageBox.Show("No record found for E-Filling!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                foreach (SHDocVw.InternetExplorer ieTemp in swTemp)
                {
                    string strDocName = dalP.GetDocName(ieTemp.LocationURL.ToString().ToLower(), strYA);
                    if (strDocName.Length > 0)
                    {
                        boolTargetFound = true;
                        if (ieTemp.ReadyState.Equals(SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE))
                        {
                            boolTargetReady = true;
                            if (typeof(mshtml.HTMLDocumentClass).IsAssignableFrom(ieTemp.Document.GetType()))
                            {
                                mshtml.HTMLDocument htmlDoc             = ieTemp.Document as mshtml.HTMLDocument;
                                EFilingProcessMaklumatAhliKongsi dalMAK = new EFilingProcessMaklumatAhliKongsi(strData, this.strYA);
                                dalMAK.ProcessDocument(htmlDoc);
                            }
                        }
                    }
                }
                if (boolTargetFound == false)
                {
                    MessageBox.Show("No relevant document is found for E-Filling!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else if (boolTargetFound == true && boolTargetReady == false)
                {
                    MessageBox.Show("Document is not ready, please try again!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 4
0
        public void PopulateDG()
        {
            dgEFURL.DataSource = null;
            switch (strFormType)
            {
            case "C":
            case "R":
                EFilingDAL dal = new EFilingDAL();
                //PANYW CP204  **Due to CP204
                String[] strArrayCR = new string[2];
                strArrayCR[0]      = "C";
                strArrayCR[1]      = "R";
                dgEFURL.DataSource = dal.LoadAllURL(strArrayCR, toolStripCboYA.Text);
                //PANYW CP204 END
                break;

            case "B":
                EFilingDALB dalB = new EFilingDALB();
                dgEFURL.DataSource = dalB.LoadAllURL("B", toolStripCboYA.Text);
                break;

            case "BE":
                EFilingDALB dalBE = new EFilingDALB();
                dgEFURL.DataSource = dalBE.LoadAllURL("BE", toolStripCboYA.Text);
                break;

            case "M":
                EFilingDALB dalM = new EFilingDALB();
                dgEFURL.DataSource = dalM.LoadAllURL("M", toolStripCboYA.Text);
                break;

            case "P":
                EFilingDALP dalP = new EFilingDALP();
                dgEFURL.DataSource = dalP.LoadAllURL(toolStripCboYA.Text);
                break;

            //PANYW CP204
            case "CP204":
                String[] strArrayCP204 = new string[1];
                strArrayCP204[0] = "CP204";
                EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                dgEFURL.DataSource = dalCP204.LoadAllURL(strArrayCP204, toolStripCboYA.Text);
                break;

            //PANYW CP204
            //NGOHCS CP204A
            case "CP204A":
                String[] strArrayCP204A = new string[1];
                strArrayCP204A[0] = "CP204A";
                EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                dgEFURL.DataSource = dalCP204A.LoadAllURL(strArrayCP204A, toolStripCboYA.Text);
                break;

            //NGOHCS CP204A
            default:
                EFilingDAL dalC = new EFilingDAL();
                dgEFURL.DataSource = dalC.LoadAllURL(toolStripCboYA.Text);
                break;
            }
            dgEFURL.Refresh();
        }
Exemplo n.º 5
0
        private void tsbtnDeleteAll_Click(object sender, EventArgs e)
        {
            DialogResult dialogResponse;

            dialogResponse = MessageBox.Show("Delete all record?", "TAXcom E-Filing", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialogResponse == DialogResult.Yes)
            {
                string[] strData = new string[2];
                switch (strFormType)
                {
                case "BE":
                case "B":
                case "M":
                    EFilingDALB dalB = new EFilingDALB();
                    strData[0] = toolStripCboYA.Text;
                    strData[1] = strFormType;
                    if (dalB.Execute(strData, "DELALL") > 0)
                    {
                        MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    else
                    {
                        MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "C":
                case "R":
                    EFilingDAL dal = new EFilingDAL();
                    strData[0] = toolStripCboYA.Text;
                    strData[1] = strFormType;
                    if (dal.Execute(strData, "DELALL") > 0)
                    {
                        MessageBox.Show("URL for Form C deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    if (dal.Execute(strData, "DELALLR") > 0)
                    {
                        MessageBox.Show("URL for Form R deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    else
                    {
                        MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "P":
                    EFilingDALP dalP = new EFilingDALP();
                    strData[0] = toolStripCboYA.Text;
                    strData[1] = strFormType;
                    if (dalP.Execute(strData, "DELALL") > 0)
                    {
                        MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    else
                    {
                        MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "CP204":
                    EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                    strData[0] = toolStripCboYA.Text;
                    strData[1] = strFormType;
                    if (dalCP204.Execute(strData, "DELALL") > 0)
                    {
                        MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    else
                    {
                        MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "CP204A":
                    EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                    strData[0] = toolStripCboYA.Text;
                    strData[1] = strFormType;
                    if (dalCP204A.Execute(strData, "DELALL") > 0)
                    {
                        MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        PopulateDG();
                    }
                    else
                    {
                        MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;
                }
            }
        }
Exemplo n.º 6
0
        private void tsbtnDelete_Click(object sender, EventArgs e)
        {
            if (dgEFURL.SelectedRows.Count > 0)
            {
                DialogResult dialogResponse;
                dialogResponse = MessageBox.Show("Delete selected record?", "TAXcom E-Filing", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResponse == DialogResult.Yes)
                {
                    string[] strData = new string[1];
                    switch (strFormType)
                    {
                    case "C":
                    case "R":
                        EFilingDAL dal = new EFilingDAL();
                        strData[0] = dgEFURL.SelectedRows[0].Cells[2].Value.ToString();
                        if (dal.Execute(strData, "DEL") > 0)
                        {
                            MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            PopulateDG();
                        }
                        else
                        {
                            MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        break;

                    case "B":
                    case "BE":
                    case "M":
                        EFilingDALB dalB = new EFilingDALB();
                        strData[0] = dgEFURL.SelectedRows[0].Cells[2].Value.ToString();
                        if (dalB.Execute(strData, "DEL") > 0)
                        {
                            MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            PopulateDG();
                        }
                        else
                        {
                            MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        break;

                    case "P":
                        EFilingDALP dalP = new EFilingDALP();
                        strData[0] = dgEFURL.SelectedRows[0].Cells[2].Value.ToString();
                        if (dalP.Execute(strData, "DEL") > 0)
                        {
                            MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            PopulateDG();
                        }
                        else
                        {
                            MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        break;

                    //PANYW CP204
                    case "CP204":
                        EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                        strData[0] = dgEFURL.SelectedRows[0].Cells[2].Value.ToString();
                        if (dalCP204.Execute(strData, "DEL") > 0)
                        {
                            MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            PopulateDG();
                        }
                        else
                        {
                            MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        break;

                    //PANYW CP204 END
                    //NGOHCS CP204A
                    case "CP204A":
                        EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                        strData[0] = dgEFURL.SelectedRows[0].Cells[2].Value.ToString();
                        if (dalCP204A.Execute(strData, "DEL") > 0)
                        {
                            MessageBox.Show("URL deleted!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            PopulateDG();
                        }
                        else
                        {
                            MessageBox.Show("Deletes of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        break;
                        //NGOHCS CP204A END
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select a record to delete!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 7
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtURL.Text.Trim().Length > 0 && cboYA.Text.Trim().Length > 0 && cboForm.Text.Length > 0)
            {
                switch (cboForm.Text)
                {
                case "C":
                case "R":
                    EFilingDAL dal = new EFilingDAL();
                    if (dal.VerifyYA(cboYA.Text) == true)
                    {
                        int intStatus;
                        if (boolEditMode)
                        {
                            string[] strData = new string[2];
                            strData[0] = txtURL.Text.Trim().ToLower();
                            strData[1] = strIndex;
                            intStatus  = dal.Execute(strData, "UPD");
                        }
                        else
                        {
                            if (dal.VerifyURL(txtURL.Text.Trim(), cboYA.Text, cboForm.Text) == false)
                            {
                                int      intCount     = int.Parse(dal.GetRecCount(cboYA.Text, cboForm.Text)) + 1;
                                string   strPageIndex = cboForm.Text + cboYA.Text + "Page" + intCount.ToString();
                                string[] strData      = new string[4];
                                strData[0] = txtURL.Text.Trim().ToLower();
                                strData[1] = cboYA.Text;
                                strData[2] = strPageIndex;
                                strData[3] = cboForm.Text;
                                intStatus  = dal.Execute(strData, "ADD");
                            }
                            else
                            {
                                MessageBox.Show("URL existed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }

                        if (intStatus > 0)
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("URL updated!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("URL added!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            frmParent.PopulateDG();
                            this.Close();
                        }
                        else
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("Updates of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                            else
                            {
                                MessageBox.Show("Adding of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Year of Assessment!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                //PANYW CP204
                case "CP204":
                    EFilingDALCP204 dalCP204 = new EFilingDALCP204();
                    if (dalCP204.VerifyYA(cboYA.Text) == true)
                    {
                        int intStatus;
                        if (boolEditMode)
                        {
                            string[] strData = new string[2];
                            strData[0] = txtURL.Text.Trim().ToLower();
                            strData[1] = strIndex;
                            intStatus  = dalCP204.Execute(strData, "UPD");
                        }
                        else
                        {
                            if (dalCP204.VerifyURL(txtURL.Text.Trim(), cboYA.Text, cboForm.Text) == false)
                            {
                                int      intCount     = int.Parse(dalCP204.GetRecCount(cboYA.Text, cboForm.Text)) + 1;
                                string   strPageIndex = cboForm.Text + cboYA.Text + "Page" + intCount.ToString();
                                string[] strData      = new string[4];
                                strData[0] = txtURL.Text.Trim().ToLower();
                                strData[1] = cboYA.Text;
                                strData[2] = strPageIndex;
                                strData[3] = cboForm.Text;
                                intStatus  = dalCP204.Execute(strData, "ADD");
                            }
                            else
                            {
                                MessageBox.Show("URL existed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }

                        if (intStatus > 0)
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("URL updated!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("URL added!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            frmParent.PopulateDG();
                            this.Close();
                        }
                        else
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("Updates of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                            else
                            {
                                MessageBox.Show("Adding of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Year of Assessment!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                //PANYW CP204 END
                case "CP204A":
                    EFilingDALCP204A dalCP204A = new EFilingDALCP204A();
                    if (dalCP204A.VerifyYA(cboYA.Text) == true)
                    {
                        int intStatus;
                        if (boolEditMode)
                        {
                            string[] strData = new string[2];
                            strData[0] = txtURL.Text.Trim().ToLower();
                            strData[1] = strIndex;
                            intStatus  = dalCP204A.Execute(strData, "UPD");
                        }
                        else
                        {
                            if (dalCP204A.VerifyURL(txtURL.Text.Trim(), cboYA.Text, cboForm.Text) == false)
                            {
                                int      intCount     = int.Parse(dalCP204A.GetRecCount(cboYA.Text, cboForm.Text)) + 1;
                                string   strPageIndex = cboForm.Text + cboYA.Text + "Page" + intCount.ToString();
                                string[] strData      = new string[4];
                                strData[0] = txtURL.Text.Trim().ToLower();
                                strData[1] = cboYA.Text;
                                strData[2] = strPageIndex;
                                strData[3] = cboForm.Text;
                                intStatus  = dalCP204A.Execute(strData, "ADD");
                            }
                            else
                            {
                                MessageBox.Show("URL existed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }

                        if (intStatus > 0)
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("URL updated!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("URL added!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            frmParent.PopulateDG();
                            this.Close();
                        }
                        else
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("Updates of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                            else
                            {
                                MessageBox.Show("Adding of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Year of Assessment!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "B":
                case "BE":
                case "M":
                    EFilingDALB dalB = new EFilingDALB();
                    if (dalB.VerifyYA(cboYA.Text) == true)
                    {
                        int intStatus;
                        if (boolEditMode)
                        {
                            string[] strData = new string[2];
                            strData[0] = txtURL.Text.Trim().ToLower();
                            strData[1] = strIndex;
                            intStatus  = dalB.Execute(strData, "UPD");
                        }
                        else
                        {
                            if (dalB.VerifyURL(txtURL.Text.Trim(), cboYA.Text, cboForm.Text) == false)
                            {
                                int      intCount     = int.Parse(dalB.GetRecCount(cboYA.Text, cboForm.Text)) + 1;
                                string   strPageIndex = cboForm.Text + cboYA.Text + "Page" + intCount.ToString();
                                string[] strData      = new string[4];
                                strData[0] = txtURL.Text.Trim().ToLower();
                                strData[1] = cboYA.Text;
                                strData[2] = strPageIndex;
                                strData[3] = cboForm.Text;
                                intStatus  = dalB.Execute(strData, "ADD");
                            }
                            else
                            {
                                MessageBox.Show("URL existed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }

                        if (intStatus > 0)
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("URL updated!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("URL added!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            frmParent.PopulateDG();
                            this.Close();
                        }
                        else
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("Updates of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                            else
                            {
                                MessageBox.Show("Adding of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Year of Assessment!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;

                case "P":
                    EFilingDALP dalP  = new EFilingDALP();
                    EFilingDALB dalB2 = new EFilingDALB();
                    if (dalB2.VerifyYA(cboYA.Text) == true)
                    {
                        int intStatus;
                        if (boolEditMode)
                        {
                            string[] strData = new string[2];
                            strData[0] = txtURL.Text.Trim().ToLower();
                            strData[1] = strIndex;
                            intStatus  = dalP.Execute(strData, "UPD");
                        }
                        else
                        {
                            if (dalP.VerifyURL(txtURL.Text.Trim(), cboYA.Text, cboForm.Text) == false)
                            {
                                int      intCount     = int.Parse(dalP.GetRecCount(cboYA.Text, cboForm.Text)) + 1;
                                string   strPageIndex = cboForm.Text + cboYA.Text + "Page" + intCount.ToString();
                                string[] strData      = new string[4];
                                strData[0] = txtURL.Text.Trim().ToLower();
                                strData[1] = cboYA.Text;
                                strData[2] = strPageIndex;
                                strData[3] = cboForm.Text;
                                intStatus  = dalP.Execute(strData, "ADD");
                            }
                            else
                            {
                                MessageBox.Show("URL existed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }

                        if (intStatus > 0)
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("URL updated!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("URL added!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            frmParent.PopulateDG();
                            this.Close();
                        }
                        else
                        {
                            if (boolEditMode)
                            {
                                MessageBox.Show("Updates of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                            else
                            {
                                MessageBox.Show("Adding of URL failed!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Year of Assessment!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    break;
                }
            }
            else
            {
                MessageBox.Show("Please complete all the fields!", "TAXcom E-Filing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }