diff --git a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlan.aspx.cs b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlan.aspx.cs index e4cd5075..a550a026 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlan.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlan.aspx.cs @@ -41,7 +41,7 @@ namespace FineUIPro.Web.TestRun.DriverRun (CASE WHEN driverRun.IsAcceptInvite=1 THEN '是' ELSE '否' END) AS IsAcceptInvite, driverRun.AttachUrl, driverRun.Remark, - Unit.UnitName AS SubUnitName" + Unit.UnitName AS UnitName" + @" FROM DriverRun_DriverRunPlan AS driverRun" + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = driverRun.UnitId WHERE driverRun.ProjectId=@projectId"; List listStr = new List(); diff --git a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx index d7305912..d97d5e98 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx +++ b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx @@ -4,12 +4,12 @@ - + 编辑开车保运计划
- + @@ -47,7 +47,7 @@ - + @@ -78,7 +78,11 @@ - + + + + + @@ -97,4 +101,4 @@ - \ No newline at end of file + diff --git a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.cs b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.cs index 9658a7fe..1c31201e 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.cs @@ -1,5 +1,6 @@ using BLL; using System; +using System.IO; namespace FineUIPro.Web.TestRun.DriverRun { @@ -65,6 +66,43 @@ namespace FineUIPro.Web.TestRun.DriverRun } #endregion + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + "File\\Excel\\DataIn\\CivilStructure导入模板.xls"; + string filePath = "File\\Excel\\DataIn\\CivilStructure导入模板.xls"; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + #endregion + #region 保存 /// /// 保存按钮 diff --git a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.designer.cs index 026c7e3b..adba39d4 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunPlanEdit.aspx.designer.cs @@ -192,6 +192,24 @@ namespace FineUIPro.Web.TestRun.DriverRun { /// protected global::FineUIPro.Button btnAttach; + /// + /// btnAttachK 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachK; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + /// /// WindowAtt 控件。 ///