Example #1
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        int intTaxFormID = 0;

        if (int.TryParse(TaxFormID.SelectedValue, out intTaxFormID))
        {
            DBFilter TaxEmpFilter = new DBFilter();
            TaxEmpFilter.add(new Match("EmpID", CurID));
            TaxEmpFilter.add(new Match("TaxFormID", intTaxFormID));
            ArrayList TaxEmpList = ETaxEmp.db.select(dbConn, TaxEmpFilter);

            //string hLevelIDListString = ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_PAY_SLIP_HIERARCHY_DISPLAY_SEQUENCE);
            //string[] hlevelIDList = hLevelIDListString.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);

            //DBFilter payBatchFilter = new DBFilter();
            //DBFilter empPayrollFilter = new DBFilter();
            //empPayrollFilter.add(new Match("ep.PayPeriodID", PayPeriodID.SelectedValue));
            //payBatchFilter.add(new IN("PayBatchID", "SELECT DISTINCT ep.PayBatchID FROM " + EEmpPayroll.db.dbclass.tableName + " ep", empPayrollFilter));
            //if (ESystemParameter.getParameter(dbConn, ESystemParameter.PARAM_CODE_ESS_PAYSLIP_AUTO_RELEASE).Equals("N", StringComparison.CurrentCultureIgnoreCase))
            //    payBatchFilter.add(new Match("PayBatchIsESSPaySlipRelease", true));


            HROne.Reports.Taxation.TaxationFormProcess rpt = new HROne.Reports.Taxation.TaxationFormProcess(dbConn, TaxEmpList, intTaxFormID, "B", string.Empty, HROne.Reports.Taxation.TaxationFormProcess.ReportLanguage.English);
            string reportFileName = WebUtils.GetLocalizedReportFile(Server.MapPath("~/Report_Taxation_IR56B.rpt"));
            WebUtils.ReportExport(Response, rpt, reportFileName, "PDF", "IR56B", false);
        }
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        HROne.DataAccess.PageErrors errors = HROne.DataAccess.PageErrors.getErrors(null, Page.Master);
        errors.clear();

        ArrayList list = new ArrayList();

        foreach (RepeaterItem i in Repeater.Items)
        {
            CheckBox cb = (CheckBox)i.FindControl("ItemSelect");
            if (cb.Checked)
            {
                ETaxEmp o = (ETaxEmp)ETaxEmp.db.createObject();
                WebFormUtils.GetKeys(db, o, cb);
                list.Add(o);
            }
        }

        DateTime processDateTime = AppUtils.ServerDateTime();


        if (list.Count > 0)
        {
            ESystemParameter.setParameter(dbConn, TAXATION_NAME_OF_SIGNATURE, txtNameOfSignature.Text);

            HROne.Reports.Taxation.TaxationFormProcess.ReportLanguage lang = HROne.Reports.Taxation.TaxationFormProcess.ReportLanguage.English;
            if (ReportLanguage.SelectedValue.Equals("big5"))
            {
                lang = HROne.Reports.Taxation.TaxationFormProcess.ReportLanguage.TraditionalChinese;
            }
            HROne.Reports.Taxation.TaxationFormProcess rpt = new HROne.Reports.Taxation.TaxationFormProcess(dbConn, list, CurrentTaxFormID, CurTaxFormType, txtNameOfSignature.Text, lang);

            string reportFileName = WebUtils.GetLocalizedReportFile(Server.MapPath("~/Report_Taxation_IR56" + CurTaxFormType + ".rpt"));

            WebUtils.ReportExport(dbConn, user, errors, lblReportHeader.Text + " ( " + TaxFormID.SelectedItem.Text + " IR56" + CurTaxFormType + " )", Response, rpt, reportFileName, string.Empty, "IR56" + CurTaxFormType, false);


            //string strTaxEmpIDList = string.Empty;
            //foreach (ETaxEmp o in list)
            //{
            //    if (strTaxEmpIDList == string.Empty)
            //        strTaxEmpIDList = ((ETaxEmp)o).TaxEmpID.ToString();
            //    else
            //        strTaxEmpIDList += "_" + ((ETaxEmp)o).TaxEmpID.ToString();

            //}
            //Server.Transfer("Report_Taxation_Report_View.aspx?"
            //    + "TaxFormID=" + CurrentTaxFormID
            //    + "&TaxFormType=" + CurTaxFormType
            //    + "&TaxEmpID=" + strTaxEmpIDList);
        }
    }