protected void toExcel(object sender, EventArgs e) { HrMingXiModel hm = new HrMingXiModel(); List <gongzi_gongzimingxi> list = hm.gongzi_list(Session["gongsi"].ToString()); if (list != null) { StringWriter sw = new StringWriter(); sw.WriteLine("姓名\t部门\t岗位\t身份证号\t入职时间\t基本工资\t绩效工资\t岗位工资\t当月合计工资\t跨度工资\t职称津贴\t当月出勤天数\t加班时间\t加班费\t全勤应发\t缺勤天数\t缺勤扣款\t迟到天数\t迟到扣款\t应发工资\t社保基数\t医疗技术\t公积金基数\t年金基数\t企业养老\t企业失业\t企业医疗\t企业工伤\t企业生育\t企业公积金\t企业年金\t滞纳金\t利息\t企业小计\t个人养老\t个人失业\t个人医疗\t个人生育\t个人公积金\t个人年金4%\t滞纳金\t利息\t个人小计\t税前工资\t应税工资\t税率\t扣除数\t代扣个人所得税\t年金1%\t实发工资\t验算公式\t银行账号\t调薪时间\t录入时间"); foreach (gongzi_gongzimingxi gz in list) { sw.WriteLine(gz.B + "\t" + gz.C + "\t" + gz.D + "\t" + gz.E + "\t" + gz.F + "\t" + gz.G + "\t" + gz.H + "\t" + gz.I + "\t" + gz.J + "\t" + gz.K + "\t" + gz.L + "\t" + gz.M + "\t" + gz.N + "\t" + gz.O + "\t" + gz.P + "\t" + gz.Q + "\t" + gz.R + "\t" + gz.S + "\t" + gz.T + "\t" + gz.U + "\t" + gz.V + "\t" + gz.W + "\t" + gz.X + "\t" + gz.Y + "\t" + gz.Z + "\t" + gz.AA + "\t" + gz.AB + "\t" + gz.AC + "\t" + gz.AD + "\t" + gz.AE + "\t" + gz.AF + "\t" + gz.AG + "\t" + gz.AH + "\t" + gz.AI + "\t" + gz.AJ + "\t" + gz.AK + "\t" + gz.AL + "\t" + gz.AM + "\t" + gz.AN + "\t" + gz.AO + "\t" + gz.AP + "\t" + gz.AQ + "\t" + gz.AR + "\t" + gz.ASA + "\t" + gz.ATA + "\t" + gz.AU + "\t" + gz.AV + "\t" + gz.AW + "\t" + gz.AX + "\t" + gz.AY + "\t" + gz.AZ + "\t" + gz.BA + "\t" + gz.BB + "\t" + gz.BC); } sw.Close(); Response.AddHeader("Content-Disposition", "attachment; filename=工资明细.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.Write(sw); Response.End(); } else { Response.Write(" <script>alert('保存失败'); location='ming_xi.aspx';</script>"); } }
protected void toExcel(object sender, EventArgs e) { HrMingXiModel hm = new HrMingXiModel(); List <gongzi_gongzimingxi> list = hm.gongzi_list(Session["gongsi"].ToString()); if (list != null) { StringWriter sw = new StringWriter(); sw.WriteLine("员工姓名\t支付金额\t员工银行账号\t币种"); foreach (gongzi_gongzimingxi bp in list) { sw.WriteLine(bp.B + "\t" + bp.AY + "\t" + bp.BA + "\t" + "人民币"); } sw.Close(); Response.AddHeader("Content-Disposition", "attachment; filename=报盘.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.Write(sw); Response.End(); } else { Response.Write(" <script>alert('保存失败'); location='ming_xi.aspx';</script>"); } }
protected void toExcel(object sender, EventArgs e) { HrMingXiModel hm = new HrMingXiModel(); List <gongzi_gongzimingxi> list = hm.gongzi_list(Session["gongsi"].ToString()); if (list != null) { StringWriter sw = new StringWriter(); sw.WriteLine("姓名\t证件类型\t证件号码\t收入金额\t基本养老保险金\t失业保险金\t住房公积金\t年金(个人部分)"); foreach (gongzi_gongzimingxi baoshui in list) { sw.WriteLine(baoshui.B + "\t" + "身份证" + "\t" + baoshui.E + "\t" + baoshui.U + "\t" + baoshui.AI + "\t" + baoshui.AK + "\t" + baoshui.AN + "\t" + baoshui.AO); } sw.Close(); Response.AddHeader("Content-Disposition", "attachment; filename=报税.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.Write(sw); Response.End(); } else { Response.Write(" <script>alert('保存失败'); location='ming_xi.aspx';</script>"); } }