20240416 资料收发文登记记录导入

This commit is contained in:
毕文静 2024-04-16 15:22:49 +08:00
parent 87ed94f69c
commit bfdc028335
17 changed files with 4912 additions and 749 deletions

View File

@ -0,0 +1,84 @@
CREATE TABLE [dbo].[Sys_DataInTemp](
[TempId] [nvarchar](50) NOT NULL,
[ProjectId] [nvarchar](50) NULL,
[UserId] [nvarchar](50) NULL,
[Time] [datetime] NULL,
[RowNo] [int] NULL,
[Value1] [nvarchar](100) NULL,
[Value2] [nvarchar](100) NULL,
[Value3] [nvarchar](100) NULL,
[Value4] [nvarchar](100) NULL,
[Value5] [nvarchar](100) NULL,
[Value6] [nvarchar](100) NULL,
[Value7] [nvarchar](100) NULL,
[Value8] [nvarchar](100) NULL,
[Value9] [nvarchar](100) NULL,
[Value10] [nvarchar](100) NULL,
[Value11] [nvarchar](100) NULL,
[Value12] [nvarchar](100) NULL,
[Value13] [nvarchar](100) NULL,
[Value14] [nvarchar](100) NULL,
[Value15] [nvarchar](100) NULL,
[Value16] [nvarchar](100) NULL,
[Value17] [nvarchar](100) NULL,
[Value18] [nvarchar](100) NULL,
[Value19] [nvarchar](100) NULL,
[Value20] [nvarchar](100) NULL,
[Value21] [nvarchar](100) NULL,
[Value22] [nvarchar](100) NULL,
[Value23] [nvarchar](100) NULL,
[Value24] [nvarchar](100) NULL,
[Value25] [nvarchar](100) NULL,
[Value26] [nvarchar](100) NULL,
[Value27] [nvarchar](100) NULL,
[Value28] [nvarchar](100) NULL,
[Value29] [nvarchar](100) NULL,
[Value30] [nvarchar](100) NULL,
[Value31] [nvarchar](100) NULL,
[Value32] [nvarchar](100) NULL,
[Value33] [nvarchar](100) NULL,
[Value34] [nvarchar](100) NULL,
[Value35] [nvarchar](100) NULL,
[Value36] [nvarchar](100) NULL,
[Value37] [nvarchar](100) NULL,
[Value38] [nvarchar](100) NULL,
[Value39] [nvarchar](100) NULL,
[Value40] [nvarchar](100) NULL,
[Value41] [nvarchar](100) NULL,
[Value42] [nvarchar](100) NULL,
[Value43] [nvarchar](100) NULL,
[Value44] [nvarchar](100) NULL,
[Value45] [nvarchar](100) NULL,
[Value46] [nvarchar](100) NULL,
[Value47] [nvarchar](100) NULL,
[Value48] [nvarchar](100) NULL,
[Value49] [nvarchar](100) NULL,
[Value50] [nvarchar](100) NULL,
[ToopValue] [nvarchar](4000) NULL,
[Type] [nvarchar](50) NULL,
CONSTRAINT [PK_Sys_DataInTemp] PRIMARY KEY CLUSTERED
(
[TempId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Sys_DataInTemp] WITH CHECK ADD CONSTRAINT [FK_Sys_DataInTemp_Base_Project] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[Base_Project] ([ProjectId])
GO
ALTER TABLE [dbo].[Sys_DataInTemp] CHECK CONSTRAINT [FK_Sys_DataInTemp_Base_Project]
GO
ALTER TABLE [dbo].[Sys_DataInTemp] WITH CHECK ADD CONSTRAINT [FK_Sys_DataInTemp_Sys_User] FOREIGN KEY([UserId])
REFERENCES [dbo].[Sys_User] ([UserId])
GO
ALTER TABLE [dbo].[Sys_DataInTemp] CHECK CONSTRAINT [FK_Sys_DataInTemp_Sys_User]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'µ¼ÈëÁÙʱ±í' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Sys_DataInTemp'
GO

View File

@ -181,6 +181,7 @@
<Compile Include="Common\NPOIHelper.cs" />
<Compile Include="Common\PrinterDocService.cs" />
<Compile Include="Common\ProjectDataFlowSetService.cs" />
<Compile Include="Common\Sys_DataTempService.cs" />
<Compile Include="Common\UploadFileService.cs" />
<Compile Include="Common\UpLoadImageService.cs" />
<Compile Include="Common\UserShowColumnsService.cs" />

View File

@ -21,6 +21,17 @@ namespace BLL
return Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(e => e.DataReceivingDocId == dataReceivingDocId);
}
/// <summary>
/// 根据编号和名称获取资料收发文登记记录
/// </summary>
/// <param name="fileCode"></param>
/// <param name="fileName"></param>
/// <returns></returns>
public static Model.Comprehensive_DataReceivingDoc GetDataReceivingDocByCodeAndName(string fileCode, string fileName)
{
return Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(e => e.FileCode == fileCode && e.FileName == fileName);
}
/// <summary>
/// 添加资料收发文登记记录
/// </summary>

View File

@ -3240,6 +3240,11 @@ namespace BLL
/// 新项目质量月报模板文件原始虚拟路径
/// </summary>
public const string MonthReportNewTemplateUrl = "File\\Word\\CQMS\\项目质量月报.doc";
/// <summary>
/// 资料收发文登记记录导入模板原始虚拟路径
/// </summary>
public const string CQMS_DataReceivingDocTempUrl = "File\\Excel\\DataIn\\资料收发文登记记录导入模板.xlsx";
#endregion
#region

View File

@ -0,0 +1,266 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 导入到临时表
/// </summary>
public class Sys_DataTempService
{
/// <summary>
/// 根据主键获取导入临时表信息
/// </summary>
/// <param name="tempId">Id</param>
/// <returns></returns>
public static Model.Sys_DataInTemp GetDataInTempByTempId(string tempId)
{
return Funs.DB.Sys_DataInTemp.FirstOrDefault(x => x.TempId == tempId);
}
/// <summary>
/// 增加导入临时表记录
/// </summary>
/// <param name="dataInTemp">委托实体</param>
public static void AddDataInTemp(Model.Sys_DataInTemp dataInTemp)
{
Model.SGGLDB db = Funs.DB;
Model.Sys_DataInTemp newDataInTemp = new Model.Sys_DataInTemp();
newDataInTemp.TempId = dataInTemp.TempId;
newDataInTemp.ProjectId = dataInTemp.ProjectId;
newDataInTemp.UserId = dataInTemp.UserId;
newDataInTemp.Time = dataInTemp.Time;
newDataInTemp.RowNo = dataInTemp.RowNo;
newDataInTemp.Type = dataInTemp.Type;
newDataInTemp.Value1 = dataInTemp.Value1;
newDataInTemp.Value2 = dataInTemp.Value2;
newDataInTemp.Value3 = dataInTemp.Value3;
newDataInTemp.Value4 = dataInTemp.Value4;
newDataInTemp.Value5 = dataInTemp.Value5;
newDataInTemp.Value6 = dataInTemp.Value6;
newDataInTemp.Value7 = dataInTemp.Value7;
newDataInTemp.Value8 = dataInTemp.Value8;
newDataInTemp.Value9 = dataInTemp.Value9;
newDataInTemp.Value10 = dataInTemp.Value10;
newDataInTemp.Value11 = dataInTemp.Value11;
newDataInTemp.Value12 = dataInTemp.Value12;
newDataInTemp.Value13 = dataInTemp.Value13;
newDataInTemp.Value14 = dataInTemp.Value14;
newDataInTemp.Value15 = dataInTemp.Value15;
newDataInTemp.Value16 = dataInTemp.Value16;
newDataInTemp.Value17 = dataInTemp.Value17;
newDataInTemp.Value18 = dataInTemp.Value18;
newDataInTemp.Value19 = dataInTemp.Value19;
newDataInTemp.Value20 = dataInTemp.Value20;
newDataInTemp.Value21 = dataInTemp.Value21;
newDataInTemp.Value22 = dataInTemp.Value22;
newDataInTemp.Value23 = dataInTemp.Value23;
newDataInTemp.Value24 = dataInTemp.Value24;
newDataInTemp.Value25 = dataInTemp.Value25;
newDataInTemp.Value26 = dataInTemp.Value26;
newDataInTemp.Value27 = dataInTemp.Value27;
newDataInTemp.Value28 = dataInTemp.Value28;
newDataInTemp.Value29 = dataInTemp.Value29;
newDataInTemp.Value30 = dataInTemp.Value30;
newDataInTemp.Value31 = dataInTemp.Value31;
newDataInTemp.Value32 = dataInTemp.Value32;
newDataInTemp.Value33 = dataInTemp.Value33;
newDataInTemp.Value34 = dataInTemp.Value34;
newDataInTemp.Value35 = dataInTemp.Value35;
newDataInTemp.Value36 = dataInTemp.Value36;
newDataInTemp.Value37 = dataInTemp.Value37;
newDataInTemp.Value38 = dataInTemp.Value38;
newDataInTemp.Value39 = dataInTemp.Value39;
newDataInTemp.Value40 = dataInTemp.Value40;
newDataInTemp.Value41 = dataInTemp.Value41;
newDataInTemp.Value42 = dataInTemp.Value42;
newDataInTemp.Value43 = dataInTemp.Value43;
newDataInTemp.Value44 = dataInTemp.Value44;
newDataInTemp.Value45 = dataInTemp.Value45;
newDataInTemp.Value46 = dataInTemp.Value46;
newDataInTemp.Value47 = dataInTemp.Value47;
newDataInTemp.Value48 = dataInTemp.Value48;
newDataInTemp.Value49 = dataInTemp.Value49;
newDataInTemp.Value50 = dataInTemp.Value50;
newDataInTemp.ToopValue = dataInTemp.ToopValue;
db.Sys_DataInTemp.InsertOnSubmit(newDataInTemp);
db.SubmitChanges();
}
public static void AddDataInTemp(List<Model.Sys_DataInTemp> dataInTemps)
{
Model.SGGLDB db = Funs.DB;
foreach (var dataInTemp in dataInTemps)
{
Model.Sys_DataInTemp newDataInTemp = new Model.Sys_DataInTemp();
newDataInTemp.TempId = dataInTemp.TempId;
newDataInTemp.ProjectId = dataInTemp.ProjectId;
newDataInTemp.UserId = dataInTemp.UserId;
newDataInTemp.Time = dataInTemp.Time;
newDataInTemp.RowNo = dataInTemp.RowNo;
newDataInTemp.Type = dataInTemp.Type;
newDataInTemp.Value1 = dataInTemp.Value1;
newDataInTemp.Value2 = dataInTemp.Value2;
newDataInTemp.Value3 = dataInTemp.Value3;
newDataInTemp.Value4 = dataInTemp.Value4;
newDataInTemp.Value5 = dataInTemp.Value5;
newDataInTemp.Value6 = dataInTemp.Value6;
newDataInTemp.Value7 = dataInTemp.Value7;
newDataInTemp.Value8 = dataInTemp.Value8;
newDataInTemp.Value9 = dataInTemp.Value9;
newDataInTemp.Value10 = dataInTemp.Value10;
newDataInTemp.Value11 = dataInTemp.Value11;
newDataInTemp.Value12 = dataInTemp.Value12;
newDataInTemp.Value13 = dataInTemp.Value13;
newDataInTemp.Value14 = dataInTemp.Value14;
newDataInTemp.Value15 = dataInTemp.Value15;
newDataInTemp.Value16 = dataInTemp.Value16;
newDataInTemp.Value17 = dataInTemp.Value17;
newDataInTemp.Value18 = dataInTemp.Value18;
newDataInTemp.Value19 = dataInTemp.Value19;
newDataInTemp.Value20 = dataInTemp.Value20;
newDataInTemp.Value21 = dataInTemp.Value21;
newDataInTemp.Value22 = dataInTemp.Value22;
newDataInTemp.Value23 = dataInTemp.Value23;
newDataInTemp.Value24 = dataInTemp.Value24;
newDataInTemp.Value25 = dataInTemp.Value25;
newDataInTemp.Value26 = dataInTemp.Value26;
newDataInTemp.Value27 = dataInTemp.Value27;
newDataInTemp.Value28 = dataInTemp.Value28;
newDataInTemp.Value29 = dataInTemp.Value29;
newDataInTemp.Value30 = dataInTemp.Value30;
newDataInTemp.Value31 = dataInTemp.Value31;
newDataInTemp.Value32 = dataInTemp.Value32;
newDataInTemp.Value33 = dataInTemp.Value33;
newDataInTemp.Value34 = dataInTemp.Value34;
newDataInTemp.Value35 = dataInTemp.Value35;
newDataInTemp.Value36 = dataInTemp.Value36;
newDataInTemp.Value37 = dataInTemp.Value37;
newDataInTemp.Value38 = dataInTemp.Value38;
newDataInTemp.Value39 = dataInTemp.Value39;
newDataInTemp.Value40 = dataInTemp.Value40;
newDataInTemp.Value41 = dataInTemp.Value41;
newDataInTemp.Value42 = dataInTemp.Value42;
newDataInTemp.Value43 = dataInTemp.Value43;
newDataInTemp.Value44 = dataInTemp.Value44;
newDataInTemp.Value45 = dataInTemp.Value45;
newDataInTemp.Value46 = dataInTemp.Value46;
newDataInTemp.Value47 = dataInTemp.Value47;
newDataInTemp.Value48 = dataInTemp.Value48;
newDataInTemp.Value49 = dataInTemp.Value49;
newDataInTemp.Value50 = dataInTemp.Value50;
newDataInTemp.ToopValue = dataInTemp.ToopValue;
db.Sys_DataInTemp.InsertOnSubmit(newDataInTemp);
}
db.SubmitChanges();
}
/// <summary>
/// 修改导入临时表记录
/// </summary>
/// <param name="weldReport">焊接实体</param>
public static void UpdateDataInTemp(Model.Sys_DataInTemp dataInTemp)
{
Model.SGGLDB db = Funs.DB;
Model.Sys_DataInTemp newDataInTemp = db.Sys_DataInTemp.FirstOrDefault(e => e.TempId == dataInTemp.TempId);
if (newDataInTemp != null)
{
newDataInTemp.UserId = dataInTemp.UserId;
newDataInTemp.Time = dataInTemp.Time;
newDataInTemp.Value1 = dataInTemp.Value1;
newDataInTemp.Value2 = dataInTemp.Value2;
newDataInTemp.Value3 = dataInTemp.Value3;
newDataInTemp.Value4 = dataInTemp.Value4;
newDataInTemp.Value5 = dataInTemp.Value5;
newDataInTemp.Value6 = dataInTemp.Value6;
newDataInTemp.Value7 = dataInTemp.Value7;
newDataInTemp.Value8 = dataInTemp.Value8;
newDataInTemp.Value9 = dataInTemp.Value9;
newDataInTemp.Value10 = dataInTemp.Value10;
newDataInTemp.Value11 = dataInTemp.Value11;
newDataInTemp.Value12 = dataInTemp.Value12;
newDataInTemp.Value13 = dataInTemp.Value13;
newDataInTemp.Value14 = dataInTemp.Value14;
newDataInTemp.Value15 = dataInTemp.Value15;
newDataInTemp.Value16 = dataInTemp.Value16;
newDataInTemp.Value17 = dataInTemp.Value17;
newDataInTemp.Value18 = dataInTemp.Value18;
newDataInTemp.Value19 = dataInTemp.Value19;
newDataInTemp.Value20 = dataInTemp.Value20;
newDataInTemp.Value21 = dataInTemp.Value21;
newDataInTemp.Value22 = dataInTemp.Value22;
newDataInTemp.Value23 = dataInTemp.Value23;
newDataInTemp.Value24 = dataInTemp.Value24;
newDataInTemp.Value25 = dataInTemp.Value25;
newDataInTemp.Value26 = dataInTemp.Value26;
newDataInTemp.Value27 = dataInTemp.Value27;
newDataInTemp.Value28 = dataInTemp.Value28;
newDataInTemp.Value29 = dataInTemp.Value29;
newDataInTemp.Value30 = dataInTemp.Value30;
newDataInTemp.Value31 = dataInTemp.Value31;
newDataInTemp.Value32 = dataInTemp.Value32;
newDataInTemp.Value33 = dataInTemp.Value33;
newDataInTemp.Value34 = dataInTemp.Value34;
newDataInTemp.Value35 = dataInTemp.Value35;
newDataInTemp.Value36 = dataInTemp.Value36;
newDataInTemp.Value37 = dataInTemp.Value37;
newDataInTemp.Value38 = dataInTemp.Value38;
newDataInTemp.Value39 = dataInTemp.Value39;
newDataInTemp.Value40 = dataInTemp.Value40;
newDataInTemp.Value41 = dataInTemp.Value41;
newDataInTemp.Value42 = dataInTemp.Value42;
newDataInTemp.Value43 = dataInTemp.Value43;
newDataInTemp.Value44 = dataInTemp.Value44;
newDataInTemp.Value45 = dataInTemp.Value45;
newDataInTemp.Value46 = dataInTemp.Value46;
newDataInTemp.Value47 = dataInTemp.Value47;
newDataInTemp.Value48 = dataInTemp.Value48;
newDataInTemp.Value49 = dataInTemp.Value49;
newDataInTemp.Value50 = dataInTemp.Value50;
newDataInTemp.ToopValue = dataInTemp.ToopValue;
newDataInTemp.Type = dataInTemp.Type;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除导入临时表记录
/// </summary>
/// <param name="tempId">委托主键</param>
public static void DeleteDataInTempByDataInTempID(string tempId)
{
Model.SGGLDB db = Funs.DB;
Model.Sys_DataInTemp dataInTemp = db.Sys_DataInTemp.FirstOrDefault(e => e.TempId == tempId);
if (dataInTemp != null)
{
db.Sys_DataInTemp.DeleteOnSubmit(dataInTemp);
db.SubmitChanges();
}
}
/// <summary>
/// 根据项目用户主键删除导入临时表记录
/// </summary>
/// <param name="projectId"></param>
/// <param name="userId"></param>
public static void DeleteDataInTempByProjectIdUserId(string projectId, string userId, string type)
{
Model.SGGLDB db = Funs.DB;
var dataInTemp = from x in db.Sys_DataInTemp where x.ProjectId == projectId && x.UserId == userId && x.Type == type select x;
if (dataInTemp.Count() > 0)
{
db.Sys_DataInTemp.DeleteAllOnSubmit(dataInTemp);
db.SubmitChanges();
}
}
}
}

View File

@ -32,8 +32,8 @@
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" ToolTip="新增" Hidden="true" runat="server" OnClick="btnNew_Click">
</f:Button>
<%--<f:Button ID="btnImport" ToolTip="导入" Hidden="true" Icon="PackageIn" runat="server" OnClick="btnImport_Click">
</f:Button>--%>
<f:Button ID="btnImport" ToolTip="导入" Hidden="true" Icon="PackageIn" runat="server" OnClick="btnImport_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@ -154,10 +154,10 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1024px" Height="550px">
</f:Window>
<%--<f:Window ID="Window2" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
<f:Window ID="Window2" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>--%>
Width="1024px" Height="560px">
</f:Window>
<%--<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="500px">

View File

@ -210,12 +210,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//protected void btnImport_Click(object sender, EventArgs e)
//{
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("DataReceivingDocDataIn.aspx", "导入 - ")));
//}
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("DataReceivingDocDataIn.aspx", "导入 - ")));
}
#endregion
#region
/// <summary>
/// 获取单位名称
@ -313,10 +313,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
this.btnMenuDel.Hidden = false;
}
//if (buttonList.Contains(BLL.Const.BtnSave))
//{
// this.btnImport.Hidden = false;
//}
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnImport.Hidden = false;
}
}
}
#endregion

View File

@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
@ -156,6 +165,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>

View File

@ -0,0 +1,205 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataReceivingDocDataIn.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.DataReceivingDocDataIn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导入资料收发文登记记录</title>
<style type="text/css">
.f-grid-row.red {
background-color: LightCoral;
}
.Label {
font-size: larger;
font-weight: bold;
}
</style>
<style type="text/css">
/*定义父容器*/
.content {
width: 550px;
height: 30px;
background: #E4F1FB;
margin: 0 auto;
}
/*定义进度条*/
.box {
width: 0px;
height: 30px;
line-height: 30px;
text-align: center;
background: #3BAAE3;
color: #fff;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:HiddenField ID="id" ClientIDMode="Static" runat="server"></f:HiddenField>
<f:Panel ID="Panel1" runat="server" Margin="2px" BodyPadding="2px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:HiddenField ID="hdfileName" runat="server"></f:HiddenField>
<f:FileUpload ID="FileExcel" runat="server" Label="数据文件" EmptyText="请上传EXCEl格式文件" Width="350px" LabelWidth="90px" LabelAlign="Right"></f:FileUpload>
<f:Button ID="imgbtnImport" runat="server" Text="上传" ToolTip="文件上传" OnClick="imgbtnImport_Click"></f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:CheckBox ID="ckUpdate" runat="server" Text="更新导入"></f:CheckBox>
<f:Button ID="btnSave" runat="server" Text="保存" ToolTip="审核保存" Icon="SystemSave" OnClick="btnSave_Click"></f:Button>
<f:Button ID="btnRefresh" runat="server" ClientIDMode="Static" Text="刷新" Icon="SystemSave" OnClick="btnRefresh_Click" Hidden="true"></f:Button>
<f:Button ID="btnAllDelete" runat="server" Icon="Delete" Text="删除记录" ToolTip="删除当前人所有临时导入记录" ConfirmText="删除当前人所有临时导入记录?"
ConfirmTarget="Top" OnClick="btnAllDelete_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="TableGo"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<f:Button ID="imgbtnUpload" runat="server" Icon="DiskDownload" Text="模板下载" OnClick="imgbtnUpload_Click" EnableAjaxLoading="false"></f:Button>
<%--<f:Button ID="lkAchievements" runat="server" Icon="DiskDownload" Text="导入说明" OnClick="lkAchievements_Click" EnableAjaxLoading="false"></f:Button>--%>
</Items>
<Items>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="数据导入" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="TempId" AllowCellEditing="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableColumnLines="true" ClicksToEdit="2" DataIDField="TempId" AllowSorting="true"
SortField="RowNo" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="70px" HeaderText="行号" ColumnID="RowNo" DataField="RowNo" SortField="RowNo"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField ColumnID="Value1" DataField="Value1" FieldType="String" HeaderText="日期" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value2" DataField="Value2" FieldType="String" HeaderText="文件号" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Value3" DataField="Value3" FieldType="String" HeaderText="文件名称" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Value4" DataField="Value4" FieldType="String" HeaderText="文件类别" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value5" DataField="Value5" FieldType="String" HeaderText="专业" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value6" DataField="Value6" FieldType="String" HeaderText="发件单位" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value7" DataField="Value7" FieldType="String" HeaderText="发件人" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value8" DataField="Value8" FieldType="String" HeaderText="份数" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value9" DataField="Value9" FieldType="String" HeaderText="文件处理人" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value10" DataField="Value10" FieldType="String" HeaderText="发出日期" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value11" DataField="Value11" FieldType="String" HeaderText="接收单位" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value12" DataField="Value12" FieldType="String" HeaderText="接收人" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value13" DataField="Value13" FieldType="String" HeaderText="是否需回复" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value14" DataField="Value14" FieldType="String" HeaderText="返回五环日期" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value15" DataField="Value15" FieldType="String" HeaderText="返回五环份数" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Value16" DataField="Value16" FieldType="String" HeaderText="下发至单位" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Value17" DataField="Value17" FieldType="String" HeaderText="下发份数" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="Value18" DataField="Value18" FieldType="String" HeaderText="下发单位接收人" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Value19" DataField="Value19" FieldType="String" HeaderText="是否存档" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" Selected="true" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
<f:Label Label="错误记录数" runat="server" ID="lbDataCout" CssClass="Label" LabelAlign="right" LabelWidth="120px"></f:Label>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="数据信息" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server"
IsModal="true" Width="1200px" Height="600px">
</f:Window>
<f:Window ID="Window2" Hidden="true" runat="server" MinHeight="30px"
Target="Parent" ShowHeader="false" BodyPadding="0" Margin="0"
IsModal="true" Width="550px" Height="32px">
<Items>
<f:ContentPanel ShowBorder="false" Height="30px" ShowHeader="false" ID="ContentPanel3" runat="server">
<div class="content" id="content">
<div class="box" id="box"></div>
</div>
</f:ContentPanel>
</Items>
</f:Window>
<f:Menu ID="Menu1" ClientIDMode="Static" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
<asp:ScriptManager ID="ScriptManager2" runat="server" EnablePageMethods="true">
<Scripts>
<asp:ScriptReference Path="~/res/DataInTable.js" />
</Scripts>
</asp:ScriptManager>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,695 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Threading;
namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class DataReceivingDocDataIn : PageBase
{
#region
/// <summary>
/// 上传预设的虚拟路径
/// </summary>
private string initPath = Const.ExcelUrl;
/// <summary>
/// 错误集合
/// </summary>
public static string errorInfos = string.Empty;
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (percent == null)
{
percent = new Dictionary<string, int>();
}
this.id.Text = this.CurrUser.UserId;
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
}
else if (GetRequestEventArgument() == "reloadGrid")
{
BindGrid();
}
}
#endregion
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10"
+ @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20,Value21,Value22,Value23,Value24,Value25,Value26,Value27,Value28,Value29,Value30"
+ @" ,Value31,Value32,Value33,Value34,Value35,Value36,Value37,Value38,Value39,Value40,Value41,Value42,Value43,Value44,Value45,Value46,Value47,Value48,Value49,Value50,ToopValue,Type"
+ @" FROM Sys_DataInTemp "
+ @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId));
listStr.Add(new SqlParameter("@Type", "DataReceivingDoc"));//资料收发文登记记录
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
var dataInTempAll = from x in Funs.DB.Sys_DataInTemp
where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "DataReceivingDoc"
select x;
for (int i = 0; i < Grid1.Rows.Count; i++)
{
var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString());
if (dataInTemp != null)
{
if (!string.IsNullOrEmpty(dataInTemp.ToopValue))
{
Grid1.Rows[i].RowCssClass = "red";
}
}
}
var errData = from x in dataInTempAll where x.ToopValue != null select x;
this.lbDataCout.Text = errData.Count().ToString();
}
#endregion
#region
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DataReceivingDocMenuId, Const.BtnSave))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DataReceivingDocDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - ")));
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 导入信息编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DataReceivingDocMenuId, BLL.Const.BtnSave))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DataReceivingDocDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - ")));
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 删除按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DataReceivingDocMenuId, Const.BtnSave))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.Sys_DataTempService.DeleteDataInTempByDataInTempID(rowID);
}
ShowNotify("删除成功!", MessageBoxIcon.Success);
this.BindGrid();
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 删除所有数据事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAllDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.DataReceivingDocMenuId, Const.BtnSave))
{
//先删除临时表中 该人员以前导入的数据
BLL.Sys_DataTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "DataReceivingDoc");
this.BindGrid();
ShowNotify("删除成功!", MessageBoxIcon.Success);
this.lbDataCout.Text = string.Empty;
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
#region
/// <summary>
/// 下载模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void imgbtnUpload_Click(object sender, EventArgs e)
{
this.TemplateUpload(BLL.Const.CQMS_DataReceivingDocTempUrl);
}
protected void TemplateUpload(string initTemplatePath)
{
string rootPath = Server.MapPath("~/");
string uploadfilepath = rootPath + initTemplatePath;
string filePath = Const.CQMS_DataReceivingDocTempUrl;
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();
}
/// <summary>
/// 导入说明
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//protected void lkAchievements_Click(object sender, EventArgs e)
//{
// this.TemplateUpload(Const.CQMS_DataReceivingDocTempUrl);
//}
#endregion
#region
public static Dictionary<string, int> percent { get; set; }
public static Dictionary<string, string> url { get; set; }
[System.Web.Services.WebMethod]
public static int getPercent(string id)
{
return percent[id];
}
#endregion
#region
/// <summary>
/// 文件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void imgbtnImport_Click(object sender, EventArgs e)
{
try
{
if (this.FileExcel.HasFile == false)
{
ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls" && IsXls != ".xlsx")
{
ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning);
return;
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
//指定上传文件名称
this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls;
//上传文件路径
string filePath = initFullPath + this.hdfileName.Text;
//文件上传服务器
this.FileExcel.PostedFile.SaveAs(filePath);
//文件上传服务器后的名称
string fileName = rootPath + initPath + this.hdfileName.Text;
//读取Excel
DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true);
//验证Excel读取是否有误
if (!string.IsNullOrEmpty(errorInfos))
{
ShowNotify(errorInfos, MessageBoxIcon.Warning);
return;
}
if (ds.Tables.Count > 0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Sys_DataInTemp newDataInTemp = new Sys_DataInTemp();
newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_DataInTemp));
newDataInTemp.ProjectId = this.CurrUser.LoginProjectId;
newDataInTemp.UserId = this.CurrUser.UserId;
newDataInTemp.Time = System.DateTime.Now;
newDataInTemp.Type = "DataReceivingDoc";
newDataInTemp.RowNo = i + 2;
newDataInTemp.Value1 = ds.Tables[0].Rows[i]["日期"].ToString().Trim();
newDataInTemp.Value2 = ds.Tables[0].Rows[i]["文件号"].ToString().Trim();
newDataInTemp.Value3 = ds.Tables[0].Rows[i]["文件名称"].ToString().Trim();
newDataInTemp.Value4 = ds.Tables[0].Rows[i]["文件类别"].ToString().Trim();
newDataInTemp.Value5 = ds.Tables[0].Rows[i]["专业"].ToString().Trim();
newDataInTemp.Value6 = ds.Tables[0].Rows[i]["发件单位"].ToString().Trim();
newDataInTemp.Value7 = ds.Tables[0].Rows[i]["发件人"].ToString().Trim();
newDataInTemp.Value8 = ds.Tables[0].Rows[i]["份数"].ToString().Trim();
newDataInTemp.Value9 = ds.Tables[0].Rows[i]["文件处理人"].ToString().Trim();
newDataInTemp.Value10 = ds.Tables[0].Rows[i]["发出日期"].ToString().Trim();
newDataInTemp.Value11 = ds.Tables[0].Rows[i]["接收单位"].ToString().Trim();
newDataInTemp.Value12 = ds.Tables[0].Rows[i]["接收人"].ToString().Trim();
newDataInTemp.Value13 = ds.Tables[0].Rows[i]["是否需回复"].ToString().Trim();
newDataInTemp.Value14 = ds.Tables[0].Rows[i]["返回五环日期"].ToString().Trim();
newDataInTemp.Value15 = ds.Tables[0].Rows[i]["返回五环份数"].ToString().Trim();
newDataInTemp.Value16 = ds.Tables[0].Rows[i]["下发至单位"].ToString().Trim();
newDataInTemp.Value17 = ds.Tables[0].Rows[i]["下发份数"].ToString().Trim();
newDataInTemp.Value18 = ds.Tables[0].Rows[i]["下发单位接收人"].ToString().Trim();
newDataInTemp.Value19 = ds.Tables[0].Rows[i]["是否存档"].ToString().Trim();
BLL.Sys_DataTempService.AddDataInTemp(newDataInTemp);
}
this.BindGrid();
ShowNotify("数据已导入临时表!", MessageBoxIcon.Success);
}
else
{
ShowNotify("无数据!", MessageBoxIcon.Warning);
return;
}
}
catch (Exception ex)
{
Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 保存审核事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId); }));
t.Start();
if (percent.ContainsKey(this.CurrUser.UserId))
{
percent[CurrUser.UserId] = 0;
}
else
{
percent.Add(CurrUser.UserId, 0);
}
PageContext.RegisterStartupScript("printX()");
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
this.BindGrid();
}
protected void btnSaveMethod(string LoginProjectId, string UserId)
{
var units = from x in Funs.DB.Base_Unit
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.ProjectId == LoginProjectId
select x;
var cNProfessionals = from x in Funs.DB.Base_CNProfessional select x;//专业
var dataInTemp = from x in Funs.DB.Sys_DataInTemp
where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "DataReceivingDoc"
select x;
int okCount = 0;
int i = 0;
int ir = dataInTemp.Count();
string erreMessage = "";
foreach (var tempData in dataInTemp)
{
if (tempData != null)
{
i++;
percent[UserId] = (int)(100 * i / ir);
string errInfo = string.Empty;
var isExitValue = Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.FileCode == tempData.Value2
&& x.FileName == tempData.Value3);
if (isExitValue == null || this.ckUpdate.Checked)
{
Model.Comprehensive_DataReceivingDoc newData = new Model.Comprehensive_DataReceivingDoc();
if (!string.IsNullOrEmpty(tempData.Value1.Trim()))
{
try
{
newData.ReceiveDate = Funs.GetNewDateTime(tempData.Value1.Trim());
}
catch (Exception)
{
errInfo += "日期格式不正确;";
}
}
else
{
errInfo += "日期为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value2.Trim()))
{
newData.FileCode = tempData.Value2.Trim();
}
else
{
errInfo += "文件号为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value3.Trim()))
{
newData.FileName = tempData.Value3.Trim();
}
else
{
errInfo += "文件名称为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value4.Trim()))
{
newData.FileType = tempData.Value4.Trim();
}
else
{
errInfo += "文件类别为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value5.Trim()))
{
var professional = cNProfessionals.FirstOrDefault(e => e.ProfessionalName == tempData.Value5.Trim());
if (professional != null)
{
newData.CNProfessionalId = professional.CNProfessionalId;
}
else
{
errInfo += "专业不存在;";
}
}
else
{
errInfo += "专业为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value6.Trim()))
{
var unit = units.FirstOrDefault(e => e.UnitName == tempData.Value6.Trim());
if (unit != null)
{
newData.SendUnit = unit.UnitId;
}
else
{
errInfo += "发件单位不存在;";
}
}
else
{
errInfo += "发件单位为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value7.Trim()))//发件人
{
newData.SendMan = tempData.Value7.Trim();
}
else
{
errInfo += "发件人为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value8.Trim()))//份数
{
try
{
newData.Copies = Funs.GetNewInt(tempData.Value8.Trim());
}
catch (Exception)
{
errInfo += "份数格式不正确;";
}
}
else
{
errInfo += "份数为必填项;";
}
if (!string.IsNullOrEmpty(tempData.Value9.Trim())) //文件处理人
{
newData.DocumentHandler = tempData.Value9.Trim();
}
if (!string.IsNullOrEmpty(tempData.Value10.Trim())) //发出日期
{
try
{
newData.SendDate = Funs.GetNewDateTime(tempData.Value10.Trim());
}
catch (Exception)
{
errInfo += "发出日期格式不正确;";
}
}
if (!string.IsNullOrEmpty(tempData.Value11.Trim()))//接收单位
{
string unitList = string.Empty;
List<string> lists = tempData.Value11.Trim().Split(',').ToList();
if (lists.Count > 0)
{
foreach (var item in lists)
{
var unit = units.FirstOrDefault(x => x.UnitName == item.Trim());
if (unit != null)
{
unitList += unit.UnitId + ",";
}
else
{
errInfo += "接收单位不存在;";
}
}
if (!string.IsNullOrEmpty(unitList))
{
newData.ReceiveUnit = unitList.Substring(0, unitList.LastIndexOf(","));
}
}
}
if (!string.IsNullOrEmpty(tempData.Value12.Trim()))//接收人
{
newData.ReceiveMan = tempData.Value12.Trim();
}
if (tempData.Value13.Trim() == "是") //是否需回复
{
newData.IsReply = true;
}
else
{
newData.IsReply = false;
}
if (!string.IsNullOrEmpty(tempData.Value14.Trim())) //返回五环日期
{
try
{
newData.ReturnWuhuangDate = Funs.GetNewDateTime(tempData.Value14.Trim());
}
catch (Exception)
{
errInfo += "返回五环日期格式不正确;";
}
}
if (!string.IsNullOrEmpty(tempData.Value15.Trim()))//返回五环份数
{
try
{
newData.RetrunWuhuangCopies = Funs.GetNewInt(tempData.Value15.Trim());
}
catch (Exception)
{
errInfo += "返回五环份数格式不正确;";
}
}
if (!string.IsNullOrEmpty(tempData.Value16.Trim()))//下发至单位
{
string unitLists = string.Empty;
List<string> lists = tempData.Value16.Trim().Split(',').ToList();
if (lists.Count > 0)
{
foreach (var item in lists)
{
var unit = units.FirstOrDefault(x => x.UnitName == item.Trim());
if (unit != null)
{
unitLists += unit.UnitId + ",";
}
else
{
errInfo += "下发至单位不存在;";
}
}
if (!string.IsNullOrEmpty(unitLists))
{
newData.IssueToUnit = unitLists.Substring(0, unitLists.LastIndexOf(","));
}
}
}
if (!string.IsNullOrEmpty(tempData.Value17.Trim())) //下发份数
{
try
{
newData.IssueCopies = Funs.GetNewInt(tempData.Value17.Trim());
}
catch (Exception)
{
errInfo += "下发份数格式不正确;";
}
}
if (!string.IsNullOrEmpty(tempData.Value18.Trim()))//下发单位接收人
{
newData.IssueUnitReceiver = tempData.Value18.Trim();
}
if (!string.IsNullOrEmpty(tempData.Value19.Trim())) //是否存档
{
if (tempData.Value19.Trim() == "是")
{
newData.IsOnFile = true;
}
else
{
newData.IsOnFile = false;
}
}
if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 这插入管线焊口
{
newData.ProjectId = this.CurrUser.LoginProjectId;
var data = BLL.DataReceivingDocService.GetDataReceivingDocByCodeAndName(newData.FileCode, newData.FileName);
if (data == null)
{
newData.DataReceivingDocId = SQLHelper.GetNewID(typeof(Model.Comprehensive_DataReceivingDoc));
BLL.DataReceivingDocService.AddDataReceivingDoc(newData);
}
else
{
newData.DataReceivingDocId = data.DataReceivingDocId;
BLL.DataReceivingDocService.UpdateDataReceivingDoc(newData);
}
BLL.Sys_DataTempService.DeleteDataInTempByDataInTempID(tempData.TempId);
okCount++;
}
}
else
{
errInfo = "该条记录已存在于资料收发文登记记录表中。";
}
if (!string.IsNullOrEmpty(errInfo))
{
tempData.ToopValue = errInfo;
BLL.Sys_DataTempService.UpdateDataInTemp(tempData);
erreMessage += errInfo + ";";
}
}
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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, System.Text.Encoding.UTF8) + ".xlsx");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#endregion
}
}

View File

@ -0,0 +1,267 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Comprehensive {
public partial class DataReceivingDocDataIn {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// id 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField id;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdfileName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdfileName;
/// <summary>
/// FileExcel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload FileExcel;
/// <summary>
/// imgbtnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button imgbtnImport;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// ckUpdate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckUpdate;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnRefresh;
/// <summary>
/// btnAllDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAllDelete;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// imgbtnUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button imgbtnUpload;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// lbDataCout 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbDataCout;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// ContentPanel3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel3;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
/// <summary>
/// ScriptManager2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManager2;
}
}

View File

@ -0,0 +1,94 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataReceivingDocDataInEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.DataReceivingDocDataInEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑导入资料收发文登记记录</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtValue1" Label="日期" ShowRedStar="true" Required="true" runat="server" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue2" Label="文件号" ShowRedStar="true" Required="true" runat="server" MaxLength="50" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue3" Label="文件名称" ShowRedStar="true" Required="true" runat="server" MaxLength="50" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue4" Label="文件类别" ShowRedStar="true" Required="true" runat="server" MaxLength="50" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtValue5" Label="专业" ShowRedStar="true" Required="true" runat="server" MaxLength="50" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue6" Label="发件单位" ShowRedStar="true" Required="true" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue7" Label="发件人" ShowRedStar="true" Required="true" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue8" Label="份数" ShowRedStar="true" Required="true" runat="server" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtValue9" Label="文件处理人" runat="server" LabelWidth="120px">
</f:TextBox>
<f:NumberBox ID="txtValue10" Label="发出日期" runat="server" LabelWidth="120px">
</f:NumberBox>
<f:TextBox ID="txtValue11" Label="接收单位" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue12" Label="接收人" runat="server" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtValue13" Label="是否需回复" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue14" Label="返回五环日期" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue15" Label="返回五环份数" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue16" Label="下发至单位" runat="server" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtValue17" Label="下发份数" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue18" Label="下发单位接收人" runat="server" LabelWidth="120px">
</f:TextBox>
<f:TextBox ID="txtValue19" Label="是否存档" runat="server" LabelWidth="120px">
</f:TextBox>
<f:CheckBox ID="ckAll" runat="server" Checked="true" Text="是否批量修改"></f:CheckBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" Label="错误信息" ID="lbErrCout" Readonly="true" LabelWidth="120px"></f:TextArea>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,347 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class DataReceivingDocDataInEdit : PageBase
{
#region
/// <summary>
/// 临时表主键
/// </summary>
public string TempId
{
get
{
return (string)ViewState["TempId"];
}
set
{
ViewState["TempId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.TempId = Request.Params["TempId"];
this.txtValue1.Focus();
var dataInTemp = BLL.Sys_DataTempService.GetDataInTempByTempId(this.TempId);
if (dataInTemp != null)
{
this.txtValue1.Text = dataInTemp.Value1;
this.txtValue2.Text = dataInTemp.Value2;
this.txtValue3.Text = dataInTemp.Value3;
this.txtValue4.Text = dataInTemp.Value4;
this.txtValue5.Text = dataInTemp.Value5;
this.txtValue6.Text = dataInTemp.Value6;
this.txtValue7.Text = dataInTemp.Value7;
this.txtValue8.Text = dataInTemp.Value8;
this.txtValue9.Text = dataInTemp.Value9;
this.txtValue10.Text = dataInTemp.Value10;
this.txtValue11.Text = dataInTemp.Value11;
this.txtValue12.Text = dataInTemp.Value12;
this.txtValue13.Text = dataInTemp.Value13;
this.txtValue14.Text = dataInTemp.Value14;
this.txtValue15.Text = dataInTemp.Value15;
this.txtValue16.Text = dataInTemp.Value16;
this.txtValue17.Text = dataInTemp.Value17;
this.txtValue18.Text = dataInTemp.Value18;
this.txtValue19.Text = dataInTemp.Value19;
this.lbErrCout.Text = dataInTemp.ToopValue;
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
var dataInTemp = BLL.Sys_DataTempService.GetDataInTempByTempId(this.TempId);
if (this.ckAll.Checked)
{
var allDataInTemp = from x in Funs.DB.Sys_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId select x;
if (dataInTemp.Value1 != this.txtValue1.Text.Trim())
{
var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null));
if (tempValue1 != null)
{
foreach (var item in tempValue1)
{
item.Value1 = this.txtValue1.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value2 != this.txtValue2.Text.Trim())
{
var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null));
if (tempValue2 != null)
{
foreach (var item in tempValue2)
{
item.Value2 = this.txtValue2.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value3 != this.txtValue3.Text.Trim())
{
var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null));
if (tempValue3 != null)
{
foreach (var item in tempValue3)
{
item.Value3 = this.txtValue3.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value5 != this.txtValue5.Text.Trim())
{
var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null));
if (tempValue5 != null)
{
foreach (var item in tempValue5)
{
item.Value5 = this.txtValue5.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value6 != this.txtValue6.Text.Trim())
{
var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null));
if (tempValue6 != null)
{
foreach (var item in tempValue6)
{
item.Value6 = this.txtValue6.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value7 != this.txtValue7.Text.Trim())
{
var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null));
if (tempValue7 != null)
{
foreach (var item in tempValue7)
{
item.Value7 = this.txtValue7.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value8 != this.txtValue8.Text.Trim())
{
var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null));
if (tempValue8 != null)
{
foreach (var item in tempValue8)
{
item.Value8 = this.txtValue8.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value9 != this.txtValue9.Text.Trim())
{
var tempValue9 = allDataInTemp.Where(x => x.Value9 == dataInTemp.Value9 || (x.Value9 == null && dataInTemp.Value9 == null));
if (tempValue9 != null)
{
foreach (var item in tempValue9)
{
item.Value9 = this.txtValue9.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value10 != this.txtValue10.Text.Trim())
{
var tempValue10 = allDataInTemp.Where(x => x.Value10 == dataInTemp.Value10 || (x.Value10 == null && dataInTemp.Value10 == null));
if (tempValue10 != null)
{
foreach (var item in tempValue10)
{
item.Value10 = this.txtValue10.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value11 != this.txtValue11.Text.Trim())
{
var tempValue11 = allDataInTemp.Where(x => x.Value11 == dataInTemp.Value11 || (x.Value11 == null && dataInTemp.Value11 == null));
if (tempValue11 != null)
{
foreach (var item in tempValue11)
{
item.Value11 = this.txtValue11.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value12 != this.txtValue12.Text.Trim())
{
var tempValue12 = allDataInTemp.Where(x => x.Value12 == dataInTemp.Value12 || (x.Value12 == null && dataInTemp.Value12 == null));
if (tempValue12 != null)
{
foreach (var item in tempValue12)
{
item.Value12 = this.txtValue12.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value13 != this.txtValue13.Text.Trim())
{
var tempValue13 = allDataInTemp.Where(x => x.Value13 == dataInTemp.Value13 || (x.Value13 == null && dataInTemp.Value13 == null));
if (tempValue13 != null)
{
foreach (var item in tempValue13)
{
item.Value13 = this.txtValue13.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value14 != this.txtValue14.Text.Trim())
{
var tempValue14 = allDataInTemp.Where(x => x.Value14 == dataInTemp.Value14 || (x.Value14 == null && dataInTemp.Value14 == null));
if (tempValue14 != null)
{
foreach (var item in tempValue14)
{
item.Value14 = this.txtValue14.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value15 != this.txtValue15.Text.Trim())
{
var tempValue15 = allDataInTemp.Where(x => x.Value15 == dataInTemp.Value15 || (x.Value15 == null && dataInTemp.Value15 == null));
if (tempValue15 != null)
{
foreach (var item in tempValue15)
{
item.Value15 = this.txtValue15.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value16 != this.txtValue16.Text.Trim())
{
var tempValue16 = allDataInTemp.Where(x => x.Value16 == dataInTemp.Value16 || (x.Value16 == null && dataInTemp.Value16 == null));
if (tempValue16 != null)
{
foreach (var item in tempValue16)
{
item.Value16 = this.txtValue16.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value17 != this.txtValue17.Text.Trim())
{
var tempValue17 = allDataInTemp.Where(x => x.Value17 == dataInTemp.Value17 || (x.Value17 == null && dataInTemp.Value17 == null));
if (tempValue17 != null)
{
foreach (var item in tempValue17)
{
item.Value17 = this.txtValue17.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value18 != this.txtValue18.Text.Trim())
{
var tempValue18 = allDataInTemp.Where(x => x.Value18 == dataInTemp.Value18 || (x.Value18 == null && dataInTemp.Value18 == null));
if (tempValue18 != null)
{
foreach (var item in tempValue18)
{
item.Value18 = this.txtValue18.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
if (dataInTemp.Value19 != this.txtValue19.Text.Trim())
{
var tempValue19 = allDataInTemp.Where(x => x.Value19 == dataInTemp.Value19 || (x.Value19 == null && dataInTemp.Value19 == null));
if (tempValue19 != null)
{
foreach (var item in tempValue19)
{
item.Value19 = this.txtValue19.Text.Trim();
Funs.DB.SubmitChanges();
}
}
}
var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue);
if (toopValue != null)
{
foreach (var item in toopValue)
{
item.ToopValue = null;
Funs.DB.SubmitChanges();
}
}
}
else
{
Model.Sys_DataInTemp newDataInTemp = new Model.Sys_DataInTemp();
newDataInTemp.ProjectId = this.CurrUser.LoginProjectId;
newDataInTemp.UserId = this.CurrUser.UserId;
newDataInTemp.Time = System.DateTime.Now;
newDataInTemp.Type = dataInTemp.Type;
newDataInTemp.Value1 = this.txtValue1.Text.Trim();
newDataInTemp.Value2 = this.txtValue2.Text.Trim();
newDataInTemp.Value3 = this.txtValue3.Text.Trim();
newDataInTemp.Value4 = this.txtValue4.Text.Trim();
newDataInTemp.Value5 = this.txtValue5.Text.Trim();
newDataInTemp.Value6 = this.txtValue6.Text.Trim();
newDataInTemp.Value7 = this.txtValue7.Text.Trim();
newDataInTemp.Value8 = this.txtValue8.Text.Trim();
newDataInTemp.Value9 = this.txtValue9.Text.Trim();
newDataInTemp.Value10 = this.txtValue10.Text.Trim();
newDataInTemp.Value11 = this.txtValue11.Text.Trim();
newDataInTemp.Value12 = this.txtValue12.Text.Trim();
newDataInTemp.Value13 = this.txtValue13.Text.Trim();
newDataInTemp.Value14 = this.txtValue14.Text.Trim();
newDataInTemp.Value15 = this.txtValue15.Text.Trim();
newDataInTemp.Value16 = this.txtValue16.Text.Trim();
newDataInTemp.Value17 = this.txtValue17.Text.Trim();
newDataInTemp.Value18 = this.txtValue18.Text.Trim();
newDataInTemp.Value19 = this.txtValue19.Text.Trim();
if (!string.IsNullOrEmpty(this.TempId))
{
newDataInTemp.TempId = this.TempId;
newDataInTemp.ToopValue = null;
BLL.Sys_DataTempService.UpdateDataInTemp(newDataInTemp);
}
}
ShowNotify("信息修改完成!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#endregion
}
}

View File

@ -0,0 +1,258 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Comprehensive {
public partial class DataReceivingDocDataInEdit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// txtValue1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue1;
/// <summary>
/// txtValue2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue2;
/// <summary>
/// txtValue3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue3;
/// <summary>
/// txtValue4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue4;
/// <summary>
/// txtValue5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue5;
/// <summary>
/// txtValue6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue6;
/// <summary>
/// txtValue7 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue7;
/// <summary>
/// txtValue8 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue8;
/// <summary>
/// txtValue9 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue9;
/// <summary>
/// txtValue10 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtValue10;
/// <summary>
/// txtValue11 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue11;
/// <summary>
/// txtValue12 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue12;
/// <summary>
/// txtValue13 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue13;
/// <summary>
/// txtValue14 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue14;
/// <summary>
/// txtValue15 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue15;
/// <summary>
/// txtValue16 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue16;
/// <summary>
/// txtValue17 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue17;
/// <summary>
/// txtValue18 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue18;
/// <summary>
/// txtValue19 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtValue19;
/// <summary>
/// ckAll 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckAll;
/// <summary>
/// lbErrCout 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea lbErrCout;
}
}

View File

@ -426,6 +426,8 @@
<Content Include="CQMS\Comprehensive\DataReceivingDataIn.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDoc.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDocApprove.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDocDataIn.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDocDataInEdit.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDocEdit.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingEdit.aspx" />
<Content Include="CQMS\Comprehensive\DesignChangeOrder.aspx" />
@ -7348,6 +7350,20 @@
<Compile Include="CQMS\Comprehensive\DataReceivingDocApprove.aspx.designer.cs">
<DependentUpon>DataReceivingDocApprove.aspx</DependentUpon>
</Compile>
<Compile Include="CQMS\Comprehensive\DataReceivingDocDataIn.aspx.cs">
<DependentUpon>DataReceivingDocDataIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CQMS\Comprehensive\DataReceivingDocDataIn.aspx.designer.cs">
<DependentUpon>DataReceivingDocDataIn.aspx</DependentUpon>
</Compile>
<Compile Include="CQMS\Comprehensive\DataReceivingDocDataInEdit.aspx.cs">
<DependentUpon>DataReceivingDocDataInEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CQMS\Comprehensive\DataReceivingDocDataInEdit.aspx.designer.cs">
<DependentUpon>DataReceivingDocDataInEdit.aspx</DependentUpon>
</Compile>
<Compile Include="CQMS\Comprehensive\DataReceivingDocEdit.aspx.cs">
<DependentUpon>DataReceivingDocEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

File diff suppressed because it is too large Load Diff