protected void btnImport_Click(object sender, System.Web.UI.ImageClickEventArgs e) { SalaryReportModel searchModel = new SalaryReportModel(); //设置查询条件 //报表编号 searchModel.ReprotNo = txtReportNo.Text.Trim(); //报表主题 searchModel.ReportName = txtReportName.Text.Trim(); //所属年月 searchModel.ReportMonth = Request.Form["ddlYear"].ToString() + Request.Form["ddlMonth"].ToString(); //编制状态 searchModel.Status = Request.Form["ddlStatus"].ToString(); //审批状态 searchModel.FlowStatus = Request.Form["ddlFlowStatus"].ToString(); //查询数据 DataTable dtReport = SalaryReportBus.SearchReportInfo(searchModel); //导出标题 string headerTitle = "工资报表编号|工资报表主题|所属月份|开始日期|结束日期|编制人|编制日期|报表状态|审批状态"; string[] header = headerTitle.Split('|'); //导出标题所对应的列字段名称 string columnFiled = "ReprotNo|ReportName|ReportMonth|StartDate|EndDate|Creator|CreateDate|StatusName|FlowStatus"; string[] field = columnFiled.Split('|'); XBase.Common.OutputToExecl.ExportToTable(this.Page, dtReport, header, field, "工资报表列表"); }
protected string GetSource() { string ID = Request.QueryString["ID"].Trim().ToString(); DataTable dtReportInfo = SalaryReportBus.GetReportInfoByNo(ID); int defaultCount = Convert.ToInt32(this.linesPerPage.Value); //设置查询条件 StringBuilder htmlStr = new StringBuilder(); htmlStr.Append("\r\t <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"); //表头开始(在打印预览中每页都有)**************************************************************** htmlStr.Append("\r\t <thead style=\"display:table-header-group;font-weight:bold\">"); htmlStr.Append("\r\t <tr><td colspan=\"18\">"); htmlStr.Append("\r\t <table width=\"98%\" height=\"40\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" =\"center\">"); htmlStr.Append("\r\t <tr>"); htmlStr.Append("\r\t <td align=\"center\" class=\"pS\" valign=\"middle\"><strong> 工资报表 </strong></td>"); htmlStr.Append("\r\t </tr></table>"); htmlStr.Append("\r\t <table width=\"98%\" height=\"25px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"); htmlStr.Append("\r\t <tr><td align=\"left\" style=\"height: 25px;\" class=\"td\" colspan=\"2\">编制单位:" + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyName + " </td>"); // htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" class=\"td\" colspan=\"3\">会计期间:" + AccountDate + " </td>"); htmlStr.Append("\r\t <td align=\"right\" style=\"height: 25px;\" class=\"td\" colspan=\"3\"> </td>"); htmlStr.Append("\r\t </tr></table>"); htmlStr.Append("\r\t <table width=\"98%\" height=\"25px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"); htmlStr.Append("\r\t <tr><td align=\"center\" style=\"height: 25px;\" > 工资报表编号</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReprotNo") + " </td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 工资报表主题</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportName") + " </td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 所属月份</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportYear") + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportMonth") + " </td>"); htmlStr.Append("\r\t </tr><tr>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 开始时间</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "StartDate") + " </td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 结束时间</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "EndDate") + " </td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 编制人</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "Creator") + " </td>"); htmlStr.Append("\r\t </tr><tr>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 报表状态</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "Status") + " </td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" > 编制日期</td>"); htmlStr.Append("\r\t <td align=\"left\" style=\"height: 25px;\" > " + GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "CreateDate") + " </td>"); //htmlStr.Append("\r\t <td align=\"center\" style=\"height: 25px;\" class=\"td\" colspan=\"3\">会计期间:" + AccountDate + " </td>"); //htmlStr.Append("\r\t <td align=\"right\" style=\"height: 25px;\" class=\"td\" colspan=\"3\">单位:元 </td>"); htmlStr.Append("\r\t </tr> "); htmlStr.Append("\r\t </table><br/>"); htmlStr.Append("\r\t </td></tr>"); string resul = SalaryReportBus.PrintInitSalaryReportInfo(GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReprotNo"), defaultCount, Printclass); htmlStr.Append(resul); //表尾开始(在打印预览中每页都有)**************************************************************** htmlStr.Append("\r\t <tfoot class='noprint2' style=\"display:table-footer-group;font-weight:bold\">"); htmlStr.Append("\r\t <tr><td align=\"left\" class=\"noprint2\" colspan=\"7\"> 制表: " + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName + "</td>"); htmlStr.Append("\r\t <td align=\"center\" style=\"height: 23px\" class=\"noprint2\" colspan=\"10\" >打印日期:" + DateTime.Now.ToString("yyyy-MM-dd") + ""); htmlStr.Append("\r\t </td>"); htmlStr.Append("\r\t </tr></tfoot>"); //表尾结束(在打印预览中每页都有)**************************************************************** htmlStr.Append("\r\t </table>"); return(htmlStr.ToString()); }
/// <summary> /// 初期表示工资报表信息 /// </summary> /// <param name="ID">工资报表ID</param> private void InitReprotInfo(string ID) { //获取基本信息 DataTable dtReportInfo = SalaryReportBus.GetReportInfoByID(ID); hidModuleID.Value = ConstUtil.MODULE_ID_HUMAN_SALARY_REPORT_LIST; //数据存在时 if (dtReportInfo != null && dtReportInfo.Rows.Count > 0) { //报表编号 string reportNo = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReprotNo"); divCodeNo.InnerHtml = reportNo; txtIdentityID.Value = ID; txtReportNo.Value = reportNo; //报表主题 txtTitle.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportName"); //报表状态 txtReportStatus.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "Status"); string ssd = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "FlowStatus"); //if (string.IsNullOrEmpty(ssd)) //{ // txtBillStatus.Value = "1"; //} //else //{ // txtBillStatus.Value = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "FlowStatus"); //} string temp = ""; if (txtReportStatus.Text == "待提交") { temp = "1"; } else if (txtReportStatus.Text == "已生成") { temp = "1"; } else if (txtReportStatus.Text == "已确认") { temp = "2"; } else if (txtReportStatus.Text == "已提交") { temp = "1"; } txtBillStatus.Value = temp; if (txtReportStatus.Text == "已确认") { //txtBillStatus.Value = "2"; // btnSave.Visible = false; //btnSave.Attributes.Add("style", "display:none"); //this.ImgReBuild .Attributes.Add("style", "display:none"); //document.getElementById("ImgReBuild").src = "../../../Images/Button/ btn_qxsc.jpg"; //document.getElementById("ImgReBuild").attachEvent("onclick", DoDelete); //document.getElementById("ImgReBuild").src = "../../../Images/Button/ UnClick_qxsc.jpg"; //document.getElementById("ImgReBuild").attachEvent("onclick", gogo); ImgReBuild.Src = "../../../Images/Button/UnClick_qxsc.jpg"; ImgReBuild.Attributes.Add("onclick", "gogo();"); //btnUnSave.Attributes.Add("style", "display:Block"); btnSave.Src = "../../../Images/Button/UnClick_bc.jpg"; btnSave.Attributes.Add("onclick", "gogo();"); // Response.Write("<script language='javascript'>GetFlowButton_DisplayControl()</script>"); } else if (txtReportStatus.Text == "已提交") { //btnSave.Attributes.Add("style", "display:none"); //btnUnSave.Attributes.Add("style", "display:Block"); ImgReBuild.Src = "../../../Images/Button/UnClick_qxsc.jpg"; ImgReBuild.Attributes.Add("onclick", "gogo();"); btnSave.Src = "../../../Images/Button/UnClick_bc.jpg"; btnSave.Attributes.Add("onclick", "gogo();"); // Response.Write("<script language='javascript'>GetFlowButton_DisplayControl()</script>"); } //所属年月 ddlYear.SelectedValue = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportYear"); ddlMonth.SelectedValue = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "ReportMonth"); ddlYear.Enabled = false; ddlMonth.Enabled = false; //开始日期 txtStartDate.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "StartDate"); txtStartDate.Enabled = false; //结束日期 txtEndDate.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "EndDate"); txtEndDate.Enabled = false; //编制人 UserCreator.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "Creator"); //编制日期 txtCreateDate.Text = GetSafeData.ValidateDataRow_String(dtReportInfo.Rows[0], "CreateDate"); UserCreator.Enabled = false; txtCreateDate.Enabled = false; btnCreateReport.Disabled = true; btnCreateReport.Src = "../../../Images/Button/cw_uscbb.jpg"; //设置页面信息 divSalaryDetailInfo.InnerHtml = SalaryReportBus.InitSalaryReportInfo(reportNo); } }