diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx index 5dc8ca96..db1e93ad 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx @@ -24,6 +24,9 @@ AutoPostBack="true" OnCheckedChanged="TextBox_TextChanged"> + + @@ -36,9 +39,18 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs index 69891c58..fcf294a0 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.cs @@ -59,7 +59,7 @@ namespace FineUIPro.Web.DataShow var query = from x in db.SitePerson_PersonInOutNow where x.ChangeTime >= startDate && x.ChangeTime < endDate && x.ProjectId == this.ProjectId - group x by new { x.PersonId, x.ProjectId } into g + group x by new { x.PersonId, x.ProjectId} into g select new { g.Key.PersonId, @@ -73,12 +73,17 @@ namespace FineUIPro.Web.DataShow equals new { detail.PersonId, detail.ProjectId, MaxChangeTime = detail.ChangeTime } join y in db.SitePerson_Person on record.PersonId equals y.PersonId join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId + join u in db.Base_Unit on detail.UnitId equals u.UnitId + join tg in db.ProjectData_TeamGroup on y.TeamGroupId equals tg.TeamGroupId where detail.IsIn == true select new { PersonId = record.PersonId, PersonName = y.PersonName, WorkPostName = z.WorkPostName, + IdentityCard = y.IdentityCard, + UnitName = u.UnitName, + TeamGroupName= tg.TeamGroupName, ProjectId = record.ProjectId, ChangeTime = record.MaxChangeTime, PostType = z.PostType, @@ -156,5 +161,26 @@ namespace FineUIPro.Web.DataShow } #endregion + + #region 导出 + + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("项目当前现场" + filename+DateTime.Now.ToString("yyyyMMddHHmmss"), System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = this.Grid1.RecordCount; + BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs index 301d6a39..2f49f452 100644 --- a/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DataShow/ProjectSitePerson.aspx.designer.cs @@ -68,6 +68,15 @@ namespace FineUIPro.Web.DataShow /// protected global::FineUIPro.CheckBox chManager; + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + /// /// btnClose 控件。 ///