public void EXPORTYCGL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int total = 0; DataTable dt = new SZHL_YCGLB().GetDataPager("SZHL_YCGL yc left join SZHL_YCGL_CAR car on yc.CarID=car.ID", "yc.*,car.CarBrand,car.CarType,car.CarNum ,dbo.fn_PDStatus(yc.intProcessStanceid) AS StateName", 2000, 1, " yc.CRDate desc", "", ref total); string sqlCol = "SYUser|使用人,XCType|行程类别,CarNum|使用车辆,SYRS|用车人数,JSR|驾驶员,Remark|使用说明,StartTime|开始时间,EndTime|结束时间,StartAddress|出发地点,EndAddress|到达地点"; CommonHelp ch = new CommonHelp(); DataTable dt2 = dt.DelTableCol(sqlCol); foreach (DataRow dr in dt2.Rows) { try { dr["使用人"] = new JH_Auth_UserB().GetUserRealName(UserInfo.QYinfo.ComId, dr["使用人"].ToString()); if (!string.IsNullOrEmpty(dr["驾驶员"].ToString())) { dr["驾驶员"] = new JH_Auth_UserB().GetUserRealName(UserInfo.QYinfo.ComId, dr["驾驶员"].ToString()); } } catch (Exception) { } } msg.ErrorMsg = ch.ExportToExcel("用车记录", dt2); }
/// <summary> /// 导出任务 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void EXPORTRW(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { GETRWGLLIST(context, msg, P1, P2, UserInfo); DataTable dt = msg.Result; string sqlCol = "CRUserName|负责人,CRUserName|创建人,TypeName|任务类型,RWJZDate|任务截止日期,RWTitle|任务标题,RWContent|任务内容"; CommonHelp ch = new CommonHelp(); DataTable dt2 = dt.DelTableCol(sqlCol); foreach (DataRow dr in dt2.Rows) { try { dr["任务内容"] = CommonHelp.RemoveHtml(dr["任务内容"].ToString()); } catch (Exception) { } } msg.ErrorMsg = ch.ExportToExcel("任务管理", dt2); }
/// <summary> /// 导出工作报告 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void EXPORTGZBG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { GETGZBGLIST(context, msg, P1, P2, UserInfo); DataTable dt = msg.Result; string sqlCol = "BranchName|部门,TypeName|类型,RBDate|日期,RBContent|报告内容,TypeName|类型,CRUserName|姓名,RBWCQK|完成情况"; CommonHelp ch = new CommonHelp(); DataTable dt2 = dt.DelTableCol(sqlCol); foreach (DataRow dr in dt2.Rows) { try { dr["报告内容"] = CommonHelp.RemoveHtml(dr["报告内容"].ToString()); dr["完成情况"] = CommonHelp.RemoveHtml(dr["完成情况"].ToString()); } catch (Exception) { } } msg.ErrorMsg = ch.ExportToExcel("工作报告", dt2); }