protected void btnPrint_Click(object sender, EventArgs e) { HROne.DataAccess.PageErrors errors = HROne.DataAccess.PageErrors.getErrors(null, Page.Master); errors.clear(); HROne.Reports.Taxation.TaxationPaymentMappingProcess rpt = new HROne.Reports.Taxation.TaxationPaymentMappingProcess(dbConn); string reportFileName = WebUtils.GetLocalizedReportFile(Server.MapPath("~/Report_Taxation_PaymentMapping.rpt")); WebUtils.ReportExport(dbConn, user, errors, lblReportHeader.Text, Response, rpt, reportFileName, "PDF", "Taxation_PaymentMapping", true); }
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); } }
public override void validate(PageErrors errors, DBField field, Hashtable valueList) { object v = valueList[field.name]; if (v != null) { string s = v.ToString().Trim(); int vv = 0; if (Int32.TryParse(s, out vv)) { if (vv > max || vv < min) { errors.addError(field.name, "validate.intrange"); } } } }
public void writeError(HtmlTextWriter output, StringBuilder b, Control ctrl, PageErrors errors) { foreach (Control c in ctrl.Controls) { if (c.GetType() == typeof(PageError)) { PageError pe = (PageError)c; if (pe.Name != null) { if (errors.hasError(pe.Name)) { ResourceManager rm = DBUtils.getResourceManager(); Error er = errors.getError(pe.Name); b.Append("\n - " + er.getPrompt(errors.db, rm)); } } } writeError(output, b, c, errors); } }
protected void btnGenerate_Click(object sender, EventArgs e) { HROne.DataAccess.PageErrors errors = HROne.DataAccess.PageErrors.getErrors(null, Page.Master); errors.clear(); DateTime currentDate, referenceDate; if (DateTime.TryParse(CurrentDate.Value, out currentDate) && DateTime.TryParse(PreviousDate.Value, out referenceDate)) { // Start 0000185, KuangWei, 2015-05-05 ArrayList empList = WebUtils.SelectedRepeaterItemToBaseObjectList(db, Repeater, "ItemSelect"); HROne.Reports.Employee.HeadCountProcess rpt = new HROne.Reports.Employee.HeadCountProcess(dbConn, currentDate, referenceDate, Gender.SelectedValue, empList); // End 0000185, KuangWei, 2015-05-05 string reportFileName = WebUtils.GetLocalizedReportFile(Server.MapPath("~/Report_Employee_HeadCount.rpt")); WebUtils.ReportExport(dbConn, user, errors, lblReportHeader.Text, Response, rpt, reportFileName, ((Button)sender).CommandArgument, "HeadCount", true); //HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "Report_Employee_HeadCount_View.aspx?CurrentDate=" + currentDate.Ticks + "&ReferenceDate=" + referenceDate.Ticks); } //else // loadState(); }
protected void btnGenerate_Click(object sender, EventArgs e) { HROne.DataAccess.PageErrors errors = HROne.DataAccess.PageErrors.getErrors(null, Page.Master); errors.clear(); DateTime asOfDate; if (!DateTime.TryParse(AsOfDate.Value, out asOfDate)) { asOfDate = DateTime.Today; } HROne.Reports.Employee.EmployeeGenderProcess rpt = null; // Start 0000185, KuangWei, 2015-05-05 ArrayList empList = WebUtils.SelectedRepeaterItemToBaseObjectList(db, Repeater, "ItemSelect"); if (GroupBy.SelectedValue.Equals("Company", StringComparison.CurrentCultureIgnoreCase)) { rpt = new HROne.Reports.Employee.EmployeeGenderProcess(dbConn, asOfDate, HROne.Reports.Employee.EmployeeGenderProcess.ReportGroupBy.Company, 0, empList); } else if (GroupBy.SelectedValue.Equals("HLevel", StringComparison.CurrentCultureIgnoreCase)) { rpt = new HROne.Reports.Employee.EmployeeGenderProcess(dbConn, asOfDate, HROne.Reports.Employee.EmployeeGenderProcess.ReportGroupBy.Hierarchy, int.Parse(HLevelID.SelectedValue), empList); } else if (GroupBy.SelectedValue.Equals("PayGroup", StringComparison.CurrentCultureIgnoreCase)) { rpt = new HROne.Reports.Employee.EmployeeGenderProcess(dbConn, asOfDate, HROne.Reports.Employee.EmployeeGenderProcess.ReportGroupBy.PayrollGroup, 0, empList); } //string reportFileName = WebUtils.GetLocalizedReportFile(Server.MapPath("~/Report_Employee_HeadCount.rpt")); // End 0000185, KuangWei, 2015-05-05 WebUtils.ReportExport(dbConn, user, errors, lblReportHeader.Text, Response, rpt, string.Empty, ((Button)sender).CommandArgument, "EmployeeGenderReport", true); //HROne.Common.WebUtility.RedirectURLwithEncryptedQueryString(Response, Session, "Report_Employee_HeadCount_View.aspx?CurrentDate=" + currentDate.Ticks + "&ReferenceDate=" + referenceDate.Ticks); //else // loadState(); }
protected void btnPostToESS_Click(object sender, EventArgs e) { HROne.DataAccess.PageErrors errors = HROne.DataAccess.PageErrors.getErrors(null, Page.Master); errors.clear(); foreach (RepeaterItem i in Repeater.Items) { CheckBox cb = (CheckBox)i.FindControl("ItemSelect"); ETaxEmp o = (ETaxEmp)ETaxEmp.db.createObject(); WebFormUtils.GetKeys(db, o, cb); if (cb.Checked) { o.TaxEmpIsReleasePrintoutToESS = true; } else { o.TaxEmpIsReleasePrintoutToESS = false; } ETaxEmp.db.update(dbConn, o); } errors.addError("Taxation Report is released to ESS."); }
public override void validate(PageErrors errors, DBField field, Hashtable values) { validate(errors, field.name, values[field.name]); }
public abstract void validate(PageErrors errors, DBField field, Hashtable value);