提交代码

This commit is contained in:
高飞 2024-01-30 17:19:33 +08:00
parent 77f19c4965
commit 4586e54c65
4 changed files with 66 additions and 6 deletions

View File

@ -41,7 +41,7 @@ namespace FineUIPro.Web.TestRun.DriverRun
(CASE WHEN driverRun.IsAcceptInvite=1 THEN '是' ELSE '否' END) AS IsAcceptInvite, (CASE WHEN driverRun.IsAcceptInvite=1 THEN '是' ELSE '否' END) AS IsAcceptInvite,
driverRun.AttachUrl, driverRun.AttachUrl,
driverRun.Remark, driverRun.Remark,
Unit.UnitName AS SubUnitName" Unit.UnitName AS UnitName"
+ @" FROM DriverRun_DriverRunPlan AS driverRun" + @" FROM DriverRun_DriverRunPlan AS driverRun"
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = driverRun.UnitId WHERE driverRun.ProjectId=@projectId"; + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = driverRun.UnitId WHERE driverRun.ProjectId=@projectId";
List<SqlParameter> listStr = new List<SqlParameter>(); List<SqlParameter> listStr = new List<SqlParameter>();

View File

@ -9,7 +9,7 @@
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent"/>
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" <f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right"> BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars> <Toolbars>
@ -78,7 +78,11 @@
<f:Label ID="lblAttach" runat="server" Label="上传附件" <f:Label ID="lblAttach" runat="server" Label="上传附件"
LabelWidth="150px"> LabelWidth="150px">
</f:Label> </f:Label>
<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click"> <f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="保运合同" ToolTip="上传保运合同" runat="server" OnClick="btnAttach_Click">
</f:Button>
<f:Button ID="btnAttachK" Icon="TableCell" EnablePostBack="true" Text="保运考勤表" ToolTip="上传保运考勤表" runat="server" OnClick="btnAttachK_Click">
</f:Button>
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载保运考勤表模板" OnClick="btnDownLoad_Click" Text="下载保运考勤表模板">
</f:Button> </f:Button>
</Items> </Items>
</f:Panel> </f:Panel>

View File

@ -1,5 +1,6 @@
using BLL; using BLL;
using System; using System;
using System.IO;
namespace FineUIPro.Web.TestRun.DriverRun namespace FineUIPro.Web.TestRun.DriverRun
{ {
@ -65,6 +66,43 @@ namespace FineUIPro.Web.TestRun.DriverRun
} }
#endregion #endregion
#region
/// <summary>
/// 下载模板按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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")));
}
/// <summary>
/// 下载导入模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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 #region
/// <summary> /// <summary>
/// 保存按钮 /// 保存按钮

View File

@ -192,6 +192,24 @@ namespace FineUIPro.Web.TestRun.DriverRun {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnAttach; protected global::FineUIPro.Button btnAttach;
/// <summary>
/// btnAttachK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttachK;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary> /// <summary>
/// WindowAtt 控件。 /// WindowAtt 控件。
/// </summary> /// </summary>