提交代码

This commit is contained in:
高飞 2024-02-21 15:14:53 +08:00
parent 2c6a615726
commit b3357fb53f
15 changed files with 1068 additions and 507 deletions

1
.gitignore vendored
View File

@ -29,3 +29,4 @@
/SGGL/FineUIPro.Web/web.config
/SGGL/FineUIPro.Web/ErrLog.txt
/SGGL/FineUIPro.Web/FileUpload/TestRun/DriverSub/DriverSub/2024-02
/SGGL/FineUIPro.Web/FileUpload/TestRun/DriverRun

View File

@ -0,0 +1,2 @@
alter table DriverRun_DriverRunPlan add UsedDays int null
GO

View File

@ -1,16 +1,20 @@
using Newtonsoft.Json.Linq;
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Linq;
namespace FineUIPro.Web.AttachFile
{
/// <summary>
/// fileupload 的摘要说明
/// </summary>
public class fileupload : IHttpHandler, IRequiresSessionState
public class fileupload : PageBase, IHttpHandler, IRequiresSessionState
{
private void ResponseError(HttpContext context)
{
@ -51,7 +55,10 @@ namespace FineUIPro.Web.AttachFile
// 文件名保存的服务器路径
string savedFileName = GetSavedFileName(fileName);
postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
if (owner.Contains("DriverRunPlanK"))
{
ImportXlsToData(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
}
string shortFileName = GetFileName(fileName);
string fileType = GetFileType(fileName);
if (!allowExtensions.Contains("." + fileType))
@ -139,5 +146,108 @@ namespace FineUIPro.Web.AttachFile
return false;
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 35);
}
catch (Exception exc)
{
//return null;
// return dt;
}
finally
{
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds, int Cols)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
return false;
}
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
var driverRunPlan = (from x in Funs.DB.DriverRun_DriverRunPlan
where x.ProjectId == this.CurrUser.LoginProjectId
select x).FirstOrDefault();
int usedDays = 0;
if (driverRunPlan != null)
{
for (int i = 0; i < ir; i++)
{
string row34 = pds.Rows[i][34].ToString().Trim();
if (!string.IsNullOrEmpty(row34))
{
usedDays += Funs.GetNewIntOrZero(row34);
}
}
if (driverRunPlan.UsedDays == null)
{
driverRunPlan.UsedDays = usedDays;
}
else
{
driverRunPlan.UsedDays += usedDays;
}
Funs.DB.SubmitChanges();
}
}
else
{
}
return true;
}
#endregion
}
}

View File

@ -2,6 +2,8 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Text;
@ -556,6 +558,10 @@ namespace FineUIPro.Web.AttachFile
{
attachUrl = item.Value<string>("folder") + savedName;
}
if (this.AttachPath.Contains("DriverRunPlanK"))
{
ImportXlsToData(Server.MapPath("~/" + attachUrl));
}
File.Delete(Server.MapPath("~/" + attachUrl));
BLL.LogService.AddSys_Log(this.CurrUser, "删除附件!", null, this.MenuId, BLL.Const.BtnDelete);
}
@ -569,6 +575,102 @@ namespace FineUIPro.Web.AttachFile
}
Session[sessionName] = source;
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 35);
}
catch (Exception exc)
{
//return null;
// return dt;
}
finally
{
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds, int Cols)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
return false;
}
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
var driverRunPlan = (from x in Funs.DB.DriverRun_DriverRunPlan
where x.ProjectId == this.CurrUser.LoginProjectId
select x).FirstOrDefault();
int usedDays = 0;
if (driverRunPlan != null)
{
for (int i = 0; i < ir; i++)
{
string row34 = pds.Rows[i][34].ToString().Trim();
if (!string.IsNullOrEmpty(row34))
{
usedDays += Funs.GetNewIntOrZero(row34);
}
}
driverRunPlan.UsedDays -= usedDays;
Funs.DB.SubmitChanges();
}
}
else
{
}
return true;
}
#endregion
#endregion
#region
@ -717,7 +819,7 @@ namespace FineUIPro.Web.AttachFile
{
this.toolBar.Hidden = false;
}
else if (this.Type == "-1")
else if (this.Type == "-1")
{
this.toolBar.Hidden = true;
}
@ -785,7 +887,7 @@ namespace FineUIPro.Web.AttachFile
if (isSupportType)
{
url = url.Replace(Funs.RootPath, "");
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/OnlineEditing.aspx?fileUrl={0}&&editorMode={1}", url,editorMode, "编辑 -")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../AttachFile/OnlineEditing.aspx?fileUrl={0}&&editorMode={1}", url, editorMode, "编辑 -")));
}
else
{

View File

@ -534,3 +534,103 @@ IP地址:::1
出错时间:02/06/2024 14:24:27
错误信息开始=====>
错误类型:ArgumentException
错误信息:提供的 URI 方案“http”无效应为“https”。
参数名: via
错误堆栈:
在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannelInternal()
在 System.ServiceModel.ClientBase`1.get_Channel()
在 BLL.CNCECHSSEWebService.getSupervise_SubUnitReport() 位置 E:\工作\五环施工平台\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2180
出错时间:02/21/2024 13:01:51
出错时间:02/21/2024 13:01:51
错误信息开始=====>
错误类型:ArgumentException
错误信息:提供的 URI 方案“http”无效应为“https”。
参数名: via
错误堆栈:
在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannelInternal()
在 System.ServiceModel.ClientBase`1.get_Channel()
在 BLL.CNCECHSSEWebService.getCheck_CheckInfo_Table8Item() 位置 E:\工作\五环施工平台\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2045
出错时间:02/21/2024 13:01:51
出错时间:02/21/2024 13:01:51
错误信息开始=====>
错误类型:ArgumentException
错误信息:提供的 URI 方案“http”无效应为“https”。
参数名: via
错误堆栈:
在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannelInternal()
在 System.ServiceModel.ClientBase`1.get_Channel()
在 BLL.CNCECHSSEWebService.getCheck_CheckRectify() 位置 E:\工作\五环施工平台\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1941
出错时间:02/21/2024 13:01:51
出错时间:02/21/2024 13:01:51
错误信息开始=====>
错误类型:ArgumentException
错误信息:提供的 URI 方案“http”无效应为“https”。
参数名: via
错误堆栈:
在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
在 System.ServiceModel.ChannelFactory`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannel()
在 System.ServiceModel.ClientBase`1.CreateChannelInternal()
在 System.ServiceModel.ClientBase`1.get_Channel()
在 BLL.CNCECHSSEWebService.getInformation_UrgeReport() 位置 E:\工作\五环施工平台\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1883
出错时间:02/21/2024 13:01:51
出错时间:02/21/2024 13:01:51

View File

@ -6153,6 +6153,7 @@
<ItemGroup>
<Compile Include="AttachFile\fileupload.ashx.cs">
<DependentUpon>fileupload.ashx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="AttachFile\Look.aspx.cs">
<DependentUpon>Look.aspx</DependentUpon>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress>false</Use64BitIISExpress>
<IISExpressSSLPort />

View File

@ -9,7 +9,7 @@
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" />
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="HBox" BoxConfigAlign="Stretch">
<Items>

View File

@ -13,7 +13,7 @@
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="开车保运计划" EnableCollapse="true"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="开车保运计划" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="DriverRunPlanId" AllowCellEditing="true" ClicksToEdit="2" DataIDField="DriverRunPlanId" AllowSorting="true" SortField="Code"
SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" EnableTextSelection="True" OnRowCommand="Grid1_RowCommand" OnRowDoubleClick="Grid1_RowDoubleClick">
@ -44,16 +44,22 @@
FieldType="String" HeaderText="预估保运人数" HeaderTextAlign="Center" Width="220px">
</f:RenderField>
<f:RenderField ColumnID="GuaranteedOperationPeriod" DataField="GuaranteedOperationPeriod"
FieldType="String" HeaderText="保运工期(月)" HeaderTextAlign="Center" Width="220px">
FieldType="String" HeaderText="保运工期(月)" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
<f:RenderField ColumnID="TotalGuaranteedOperationDays" DataField="TotalGuaranteedOperationDays"
FieldType="String" HeaderText="总保运人工日" HeaderTextAlign="Center" Width="220px">
FieldType="String" HeaderText="总保运人工日" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
<f:RenderField ColumnID="UsedDays" DataField="UsedDays"
FieldType="String" HeaderText="已用保运工日" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
<f:RenderField ColumnID="LeaveDays" DataField="LeaveDays"
FieldType="String" HeaderText="剩余保运工日" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
<f:RenderField ColumnID="Remark" DataField="Remark"
FieldType="String" HeaderText="备注" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:LinkButtonField HeaderText="附件" ConfirmTarget="Top" Width="80px" CommandName="AttachUrl" ColumnID="AttachUrl"
TextAlign="Center" ToolTip="附件查看" Icon="Find" />
<%--<f:LinkButtonField HeaderText="附件" ConfirmTarget="Top" Width="80px" CommandName="AttachUrl" ColumnID="AttachUrl"
TextAlign="Center" ToolTip="附件查看" Icon="Find" />--%>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />

View File

@ -39,6 +39,8 @@ namespace FineUIPro.Web.TestRun.DriverRun
driverRun.GuaranteedOperationPeriod,
driverRun.TotalGuaranteedOperationDays,
(CASE WHEN driverRun.IsAcceptInvite=1 THEN '是' ELSE '否' END) AS IsAcceptInvite,
isnull(driverRun.UsedDays,0) as UsedDays,
isnull(driverRun.TotalGuaranteedOperationDays,0)-isnull(driverRun.UsedDays,0) as LeaveDays,
driverRun.AttachUrl,
driverRun.Remark,
Unit.UnitName AS UnitName"

View File

@ -58,9 +58,50 @@ namespace FineUIPro.Web.TestRun.DriverRun
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
if (this.drpUnitId.SelectedValue == BLL.Const._Null)
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
Alert.ShowInTop("请选择单位名称!", MessageBoxIcon.Warning);
return;
}
string id = Request.Params["id"];
Model.DriverRun_DriverRunPlan newData = new Model.DriverRun_DriverRunPlan();
newData.Code = this.txtCode.Text.Trim();
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
newData.UnitId = this.drpUnitId.SelectedValue;
}
if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
{
newData.InstallationId = GetStringByArray(this.drpUnitWorkIds.SelectedValueArray);
string unitWorkNames = string.Empty;
foreach (var item in this.drpUnitWorkIds.SelectedValueArray)
{
var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(item);
if (unitWork != null)
{
unitWorkNames += unitWork.UnitWorkName + ",";
}
}
if (!string.IsNullOrEmpty(unitWorkNames))
{
newData.InstallationNames = unitWorkNames.Substring(0, unitWorkNames.LastIndexOf(","));
}
}
newData.EstimatedInsuredPersonNum = Funs.GetNewInt(this.txtEstimatedInsuredPersonNum.Text.Trim());
newData.GuaranteedOperationPeriod = Funs.GetNewInt(this.txtGuaranteedOperationPeriod.Text.Trim());
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlan&menuId={1}", this.hdId.Text, BLL.Const.DriverRunPlanMenuId)));
}
@ -72,11 +113,52 @@ namespace FineUIPro.Web.TestRun.DriverRun
/// <param name="e"></param>
protected void btnAttachK_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
if (this.drpUnitId.SelectedValue == BLL.Const._Null)
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
Alert.ShowInTop("请选择单位名称!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlan&menuId={1}", this.hdId.Text+"K", BLL.Const.DriverRunPlanMenuId)));
string id = Request.Params["id"];
Model.DriverRun_DriverRunPlan newData = new Model.DriverRun_DriverRunPlan();
newData.Code = this.txtCode.Text.Trim();
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
newData.UnitId = this.drpUnitId.SelectedValue;
}
if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
{
newData.InstallationId = GetStringByArray(this.drpUnitWorkIds.SelectedValueArray);
string unitWorkNames = string.Empty;
foreach (var item in this.drpUnitWorkIds.SelectedValueArray)
{
var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(item);
if (unitWork != null)
{
unitWorkNames += unitWork.UnitWorkName + ",";
}
}
if (!string.IsNullOrEmpty(unitWorkNames))
{
newData.InstallationNames = unitWorkNames.Substring(0, unitWorkNames.LastIndexOf(","));
}
}
newData.EstimatedInsuredPersonNum = Funs.GetNewInt(this.txtEstimatedInsuredPersonNum.Text.Trim());
newData.GuaranteedOperationPeriod = Funs.GetNewInt(this.txtGuaranteedOperationPeriod.Text.Trim());
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlanK&menuId={1}", this.hdId.Text + "K", BLL.Const.DriverRunPlanMenuId)));
}
#endregion
@ -159,22 +241,15 @@ namespace FineUIPro.Web.TestRun.DriverRun
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(id))
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = id;
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text.Trim();
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
}
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);

View File

@ -37,7 +37,7 @@
<add key="SECRET_KEY" value="6yq7q5PTTGfocWDmSN7hjxuiixsfURe1"/>
<!--人脸检测参数-->
<!--人脸活体检测参数1最好0最差 建议0.995 -->
<add key="BD_face_liveness" value="0.3"/>
<add key="BD_face_liveness" value="0.3"/>
<!--人脸高宽建议100-200-->
<!--<add key="BD_width" value="200" />-->
<!--<add key="BD_height" value="200" />-->
@ -77,7 +77,7 @@
<add verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro" validate="false"/>
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1"/>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000"/>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/"/>

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />