This commit is contained in:
2024-04-16 19:17:22 +08:00
30 changed files with 5304 additions and 872 deletions
@@ -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
+1
View File
@@ -181,6 +181,7 @@
<Compile Include="Common\NPOIHelper.cs" /> <Compile Include="Common\NPOIHelper.cs" />
<Compile Include="Common\PrinterDocService.cs" /> <Compile Include="Common\PrinterDocService.cs" />
<Compile Include="Common\ProjectDataFlowSetService.cs" /> <Compile Include="Common\ProjectDataFlowSetService.cs" />
<Compile Include="Common\Sys_DataTempService.cs" />
<Compile Include="Common\UploadFileService.cs" /> <Compile Include="Common\UploadFileService.cs" />
<Compile Include="Common\UpLoadImageService.cs" /> <Compile Include="Common\UpLoadImageService.cs" />
<Compile Include="Common\UserShowColumnsService.cs" /> <Compile Include="Common\UserShowColumnsService.cs" />
@@ -21,6 +21,17 @@ namespace BLL
return Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(e => e.DataReceivingDocId == dataReceivingDocId); 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>
/// 添加资料收发文登记记录 /// 添加资料收发文登记记录
/// </summary> /// </summary>
+5
View File
@@ -3240,6 +3240,11 @@ namespace BLL
/// 新项目质量月报模板文件原始虚拟路径 /// 新项目质量月报模板文件原始虚拟路径
/// </summary> /// </summary>
public const string MonthReportNewTemplateUrl = "File\\Word\\CQMS\\项目质量月报.doc"; public const string MonthReportNewTemplateUrl = "File\\Word\\CQMS\\项目质量月报.doc";
/// <summary>
/// 资料收发文登记记录导入模板原始虚拟路径
/// </summary>
public const string CQMS_DataReceivingDocTempUrl = "File\\Excel\\DataIn\\资料收发文登记记录导入模板.xlsx";
#endregion #endregion
#region #region
+266
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();
}
}
}
}
@@ -32,8 +32,8 @@
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" ToolTip="新增" Hidden="true" runat="server" OnClick="btnNew_Click"> <f:Button ID="btnNew" Icon="Add" EnablePostBack="true" ToolTip="新增" Hidden="true" runat="server" OnClick="btnNew_Click">
</f:Button> </f:Button>
<%--<f:Button ID="btnImport" ToolTip="导入" Hidden="true" Icon="PackageIn" runat="server" OnClick="btnImport_Click"> <f:Button ID="btnImport" ToolTip="导入" Hidden="true" Icon="PackageIn" runat="server" OnClick="btnImport_Click">
</f:Button>--%> </f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@@ -154,10 +154,10 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close" Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1024px" Height="550px"> Width="1024px" Height="550px">
</f:Window> </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" Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px"> Width="1024px" Height="560px">
</f:Window>--%> </f:Window>
<%--<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" <%--<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server" EnableMaximize="true" Target="Parent" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="500px"> IsModal="true" Width="700px" Height="500px">
@@ -210,12 +210,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
//protected void btnImport_Click(object sender, EventArgs e) protected void btnImport_Click(object sender, EventArgs e)
//{ {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("DataReceivingDocDataIn.aspx", "导入 - "))); PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("DataReceivingDocDataIn.aspx", "导入 - ")));
//} }
#endregion #endregion
#region #region
/// <summary> /// <summary>
/// 获取单位名称 /// 获取单位名称
@@ -313,10 +313,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{ {
this.btnMenuDel.Hidden = false; this.btnMenuDel.Hidden = false;
} }
//if (buttonList.Contains(BLL.Const.BtnSave)) if (buttonList.Contains(BLL.Const.BtnSave))
//{ {
// this.btnImport.Hidden = false; this.btnImport.Hidden = false;
//} }
} }
} }
#endregion #endregion
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnNew; protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary> /// <summary>
/// lblPageIndex 控件。 /// lblPageIndex 控件。
/// </summary> /// </summary>
@@ -156,6 +165,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks> /// </remarks>
protected global::FineUIPro.Window Window1; protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary> /// <summary>
/// Menu1 控件。 /// Menu1 控件。
/// </summary> /// </summary>
@@ -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>
@@ -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
}
}
@@ -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;
}
}
@@ -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>
@@ -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
}
}
@@ -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;
}
}
@@ -65,7 +65,12 @@
</f:FormRow> </f:FormRow>
<f:FormRow> <f:FormRow>
<Items> <Items>
<f:TextBox ID="txtImplementationFrontState" runat="server" Label="实施状态" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
<f:DropDownList ID="ddlImplementationFrontState" runat="server" Label="实施状态" Required="true" LabelAlign="Right" LabelWidth="130px">
<f:ListItem Value="" Text="-请选择-" Selected="true" />
<f:ListItem Value="整改中" Text="整改中" />
<f:ListItem Value="已闭合" Text="已闭合" />
</f:DropDownList>
<f:TextBox ID="txtResponsibleMan" runat="server" Label="责任人" MaxLength="100" LabelAlign="Right" LabelWidth="130px"></f:TextBox> <f:TextBox ID="txtResponsibleMan" runat="server" Label="责任人" MaxLength="100" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
@@ -83,7 +88,7 @@
<Items> <Items>
<f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server"> <f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server">
<Items> <Items>
<f:Label ID="Label1" runat="server" Label="上传附件" <f:Label ID="Label1" ShowRedStar="true" runat="server" Label="上传附件"
LabelAlign="Right" LabelWidth="130px"> LabelAlign="Right" LabelWidth="130px">
</f:Label> </f:Label>
<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click"> <f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click">
@@ -83,12 +83,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{ {
this.ddlProblem.SelectedValue = nCRManagement.Problem; this.ddlProblem.SelectedValue = nCRManagement.Problem;
} }
this.txtMeasure.Text = nCRManagement.Measure; this.txtMeasure.Text = nCRManagement.Measure;
this.txtResponsibleMan.Text = nCRManagement.ResponsibleMan; this.txtResponsibleMan.Text = nCRManagement.ResponsibleMan;
this.txtImplementationFrontState.Text = nCRManagement.ImplementationFrontState; //this.txtImplementationFrontState.Text = nCRManagement.ImplementationFrontState;
this.ddlImplementationFrontState.SelectedValue = nCRManagement.ImplementationFrontState;
var currApprove = NCRManagementApproveService.GetCurrentApprove(nCRManagement.NCRManagementId); var currApprove = NCRManagementApproveService.GetCurrentApprove(nCRManagement.NCRManagementId);
if (currApprove != null) if (currApprove != null)
{ {
@@ -142,7 +143,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.txtCompleteDate.Readonly = true; this.txtCompleteDate.Readonly = true;
this.drpCNProfessionalId.Readonly = true; this.drpCNProfessionalId.Readonly = true;
this.txtContents.Readonly = true; this.txtContents.Readonly = true;
this.txtImplementationFrontState.Readonly = true; this.ddlImplementationFrontState.Readonly = true;
this.txtIssuedDate.Readonly = true; this.txtIssuedDate.Readonly = true;
this.txtNCRCode.Readonly = true; this.txtNCRCode.Readonly = true;
this.txtResponsibleMan.Readonly = true; this.txtResponsibleMan.Readonly = true;
@@ -237,7 +238,9 @@ namespace FineUIPro.Web.CQMS.Comprehensive
nCRManagement.CompleteDate = Convert.ToDateTime(this.txtCompleteDate.Text); nCRManagement.CompleteDate = Convert.ToDateTime(this.txtCompleteDate.Text);
} }
nCRManagement.ResponsibleMan = this.txtResponsibleMan.Text.Trim(); nCRManagement.ResponsibleMan = this.txtResponsibleMan.Text.Trim();
nCRManagement.ImplementationFrontState = this.txtImplementationFrontState.Text.Trim(); nCRManagement.ImplementationFrontState = this.ddlImplementationFrontState.SelectedValue.Trim();
string ids = string.Empty; string ids = string.Empty;
var lists = this.drpUnitWorkIds.SelectedValueArray; var lists = this.drpUnitWorkIds.SelectedValueArray;
foreach (var item in lists) foreach (var item in lists)
@@ -272,6 +275,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement)); nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement));
this.hdAttachUrl.Text = nCRManagement.NCRManagementId; this.hdAttachUrl.Text = nCRManagement.NCRManagementId;
} }
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == nCRManagement.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return;
}
nCRManagement.CompileMan = this.CurrUser.UserId; nCRManagement.CompileMan = this.CurrUser.UserId;
nCRManagement.Status = BLL.Const.Comprehensive_Compile; nCRManagement.Status = BLL.Const.Comprehensive_Compile;
BLL.NCRManagementService.AddNCRManagement(nCRManagement); BLL.NCRManagementService.AddNCRManagement(nCRManagement);
@@ -279,6 +288,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
else else
{ {
nCRManagement.NCRManagementId = this.NCRManagementId; nCRManagement.NCRManagementId = this.NCRManagementId;
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return;
}
var model = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault(); var model = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault();
if (model != null) if (model != null)
{ {
@@ -344,7 +359,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
nCRManagement.CompleteDate = Convert.ToDateTime(this.txtCompleteDate.Text); nCRManagement.CompleteDate = Convert.ToDateTime(this.txtCompleteDate.Text);
} }
nCRManagement.ResponsibleMan = this.txtResponsibleMan.Text.Trim(); nCRManagement.ResponsibleMan = this.txtResponsibleMan.Text.Trim();
nCRManagement.ImplementationFrontState = this.txtImplementationFrontState.Text.Trim(); nCRManagement.ImplementationFrontState = this.ddlImplementationFrontState.SelectedValue.Trim();
string ids = string.Empty; string ids = string.Empty;
var lists = this.drpUnitWorkIds.SelectedValueArray; var lists = this.drpUnitWorkIds.SelectedValueArray;
foreach (var item in lists) foreach (var item in lists)
@@ -379,6 +394,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement)); nCRManagement.NCRManagementId = SQLHelper.GetNewID(typeof(Model.Comprehensive_NCRManagement));
this.hdAttachUrl.Text = nCRManagement.NCRManagementId; this.hdAttachUrl.Text = nCRManagement.NCRManagementId;
} }
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == nCRManagement.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return;
}
nCRManagement.CompileMan = this.CurrUser.UserId; nCRManagement.CompileMan = this.CurrUser.UserId;
nCRManagement.Status = BLL.Const.Comprehensive_Audit; nCRManagement.Status = BLL.Const.Comprehensive_Audit;
BLL.NCRManagementService.AddNCRManagement(nCRManagement); BLL.NCRManagementService.AddNCRManagement(nCRManagement);
@@ -386,6 +407,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
else else
{ {
nCRManagement.NCRManagementId = this.NCRManagementId; nCRManagement.NCRManagementId = this.NCRManagementId;
var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.NCRManagementId);
if (sour == null || string.IsNullOrEmpty(sour.AttachUrl))
{
Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning);
return;
}
//BLL.NCRManagementService.UpdateNCRManagement(nCRManagement); //BLL.NCRManagementService.UpdateNCRManagement(nCRManagement);
var oldNCRManagement = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault(); var oldNCRManagement = Funs.DB.Comprehensive_NCRManagement.Where(u => u.NCRManagementId == this.NCRManagementId).FirstOrDefault();
if (oldNCRManagement == null) //数据库没有记录 直接点提交 当前状态为 审核状态 if (oldNCRManagement == null) //数据库没有记录 直接点提交 当前状态为 审核状态
@@ -121,13 +121,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
protected global::FineUIPro.DropDownList drpUnitIds; protected global::FineUIPro.DropDownList drpUnitIds;
/// <summary> /// <summary>
/// txtImplementationFrontState 控件。 /// ddlImplementationFrontState 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtImplementationFrontState; protected global::FineUIPro.DropDownList ddlImplementationFrontState;
/// <summary> /// <summary>
/// txtResponsibleMan 控件。 /// txtResponsibleMan 控件。
@@ -152,7 +152,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
* @param doc Document对象 * @param doc Document对象
* @return * @return
*/ */
public static Cell CreateCell(String value, Document doc, double cellWidth, string cellMerge = "") public static Cell CreateCell(String value, Document doc, double cellWidth, string cellMerge = "",string CenterPage="")
{ {
Cell cell = new Cell(doc); Cell cell = new Cell(doc);
Paragraph p = new Paragraph(doc); Paragraph p = new Paragraph(doc);
@@ -172,6 +172,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
cell.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None; cell.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
} }
if (!string.IsNullOrEmpty(CenterPage))
{
//序号
value = " " + value;
}
p.AppendChild(new Run(doc, value)); p.AppendChild(new Run(doc, value));
@@ -211,8 +217,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
var endDate = Convert.ToDateTime(weekModel.EndDate); var endDate = Convert.ToDateTime(weekModel.EndDate);
//获取project //获取project
var pModel = db.Base_Project.FirstOrDefault(x => x.ProjectId == weekModel.ProjectId); var pModel = db.Base_Project.FirstOrDefault(x => x.ProjectId == weekModel.ProjectId);
var urlHz = startDate.ToString("yyyyMMdd")+"-"
+ endDate.ToString("yyyyMMdd");
newUrl = uploadfilepath.Replace("项目质量月报", pModel.ShortName + "项目质量月报(第"+ weekModel.SortId + "期)"); newUrl = uploadfilepath.Replace("项目质量月报", pModel.ShortName + "项目质量月报(第"+ weekModel.SortId + "期)"+ urlHz);
if (File.Exists(newUrl)) if (File.Exists(newUrl))
{ {
@@ -268,14 +276,19 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
bkmark = doc.Range.Bookmarks["quamanagername"]; bkmark = doc.Range.Bookmarks["quamanagername"];
if (bkmark != null) { if (bkmark != null) {
var zlName = ""; //var zlName = "";
//根据项目获取质量经理 ////根据项目获取质量经理
var puserList = db.Project_ProjectUser.Where(x => x.ProjectId == weekModel.ProjectId && x.RoleId.Contains(BLL.Const.QAManager)).ToList(); //var puserList = db.Project_ProjectUser.Where(x => x.ProjectId == weekModel.ProjectId && x.RoleId.Contains(BLL.Const.QAManager)).ToList();
foreach (var item in puserList) //foreach (var item in puserList)
{ //{
zlName+= db.Sys_User.FirstOrDefault(x => x.UserId == item.UserId).UserName+","; // zlName+= db.Sys_User.FirstOrDefault(x => x.UserId == item.UserId).UserName+",";
} //}
bkmark.Text = zlName;
var getPUser = Funs.DB.Project_ProjectUser.Where(x => x.ProjectId == weekModel.ProjectId);
////质量经理
var qa = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.QAManager));
bkmark.Text = db.Sys_User.FirstOrDefault(x => x.UserId == qa.UserId).UserName;
} }
bkmark = doc.Range.Bookmarks["reportAlldate"]; bkmark = doc.Range.Bookmarks["reportAlldate"];
@@ -325,7 +338,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width,"","1"));
row.Cells.Add(CreateCell(item.ProStage, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.ProStage, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.ProDescribe, doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.ProDescribe, doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.TargetValue, doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.TargetValue, doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -399,7 +412,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -451,7 +464,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -507,7 +520,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -562,7 +575,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -615,7 +628,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -706,7 +719,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell((numberIndex-1).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell((numberIndex-1).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.WorkName, doc, table.Rows[0].Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.WorkName, doc, table.Rows[0].Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.CheckNum.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.CheckNum.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.TotalCheckNum.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.TotalCheckNum.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
@@ -846,7 +859,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell((numberIndex - 1).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell((numberIndex - 1).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitName, doc, table.Rows[0].Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitName, doc, table.Rows[0].Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.PipeMountGuard.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.PipeMountGuard.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
@@ -911,7 +924,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -1118,21 +1131,29 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
numberIndex = 1; numberIndex = 1;
//需要插入的table //需要插入的table
var Unitname = ""; var Unitname = "";
int pageCount = 1;
foreach (var item in NondestructiveTestlist) foreach (var item in NondestructiveTestlist)
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell((numberIndex).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
//如果是第一列,或者 //如果是第一列,或者
if (numberIndex == 1 || Unitname != item.CreateMan) if (numberIndex == 1 || Unitname != item.CreateMan)
{ {
if (Unitname != item.CreateMan && numberIndex != 1)
{
pageCount += 1;
}
row.Cells.Add(CreateCell((pageCount).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width, "0", "1"));
row.Cells.Add(CreateCell(item.CreateMan, doc, table.Rows[0].Cells[1].CellFormat.Width, "0")); row.Cells.Add(CreateCell(item.CreateMan, doc, table.Rows[0].Cells[1].CellFormat.Width, "0"));
Unitname = item.CreateMan; Unitname = item.CreateMan;
} }
else else
{ {
row.Cells.Add(CreateCell((pageCount).ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width, "1", "1"));
row.Cells.Add(CreateCell(item.CreateMan, doc, table.Rows[0].Cells[1].CellFormat.Width, "1")); row.Cells.Add(CreateCell(item.CreateMan, doc, table.Rows[0].Cells[1].CellFormat.Width, "1"));
Unitname = item.CreateMan; Unitname = item.CreateMan;
} }
@@ -1147,6 +1168,11 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
table.Rows.Insert(numberIndex, row); table.Rows.Insert(numberIndex, row);
numberIndex += 1; numberIndex += 1;
if (Unitname != item.CreateMan)
{
pageCount += 1;
}
} }
//自动设置表格样式 //自动设置表格样式
table.AutoFit(AutoFitBehavior.FixedColumnWidths); table.AutoFit(AutoFitBehavior.FixedColumnWidths);
@@ -1199,7 +1225,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.UnitOrMajor, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.Quantity2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
@@ -2235,18 +2261,21 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
} }
numberIndex = 1; numberIndex = 1;
int? num1 = 0, num2 = 0; int? num1 = 0, num2 = 0;
int MonthsCountstring = 0, ProjectCountstring = 0;
foreach (var item in InspectionDataInspection) foreach (var item in InspectionDataInspection)
{ {
MonthsCountstring = Convert.ToInt32(item.RectificationRate.Replace("%", ""));
ProjectCountstring = Convert.ToInt32(item.TotationRate.Replace("%", ""));
//创建行 //创建行
Row row = new Row(doc); Row row = new Row(doc);
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width)); row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width));
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width)); row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); row.Cells.Add(CreateCell(item.TotationRate.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
row.Cells.Add(CreateCell(item.Remarks, doc, table.FirstRow.Cells[4].CellFormat.Width)); row.Cells.Add(CreateCell(item.Remarks, doc, table.FirstRow.Cells[4].CellFormat.Width));
table.Rows.Insert(numberIndex, row); table.Rows.Insert(numberIndex, row);
num1 += item.MonthsCount; num1 += MonthsCountstring;
num2 += item.ProjectCount; num2 += ProjectCountstring;
numberIndex += 1; numberIndex += 1;
} }
//自动设置表格样式 //自动设置表格样式
@@ -2256,8 +2285,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
Row rowhj = new Row(doc); Row rowhj = new Row(doc);
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[0].CellFormat.Width)); rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[0].CellFormat.Width));
rowhj.Cells.Add(CreateCell("合计", doc, table.FirstRow.Cells[1].CellFormat.Width)); rowhj.Cells.Add(CreateCell("合计", doc, table.FirstRow.Cells[1].CellFormat.Width));
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width)); rowhj.Cells.Add(CreateCell(num1.ToString() + "%", doc, table.FirstRow.Cells[2].CellFormat.Width));
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width)); rowhj.Cells.Add(CreateCell(num2.ToString() + "%", doc, table.FirstRow.Cells[3].CellFormat.Width));
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width)); rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
table.Rows.Insert(numberIndex, rowhj); table.Rows.Insert(numberIndex, rowhj);
@@ -2994,6 +3023,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
//总页数 //总页数
table.Rows[4].Cells[5].FirstParagraph.Runs[0].Text = doc.PageCount.ToString(); table.Rows[4].Cells[5].FirstParagraph.Runs[0].Text = doc.PageCount.ToString();
bkmark = doc.Range.Bookmarks["CountPage"];
if (bkmark != null)
{
bkmark.Text = doc.PageCount.ToString();
}
//页眉是第二个表 //页眉是第二个表
//tableIndex—要移动的表的索引。 //tableIndex—要移动的表的索引。
//rowIndex - 表中行的索引。 //rowIndex - 表中行的索引。
@@ -869,7 +869,7 @@
</f:Form> </f:Form>
</Items> </Items>
</f:Panel> </f:Panel>
<%--9.计量器具报验管理情况--%> <%--9.计量器具报验管理情况--%>
<f:Panel ID="Pnl9" IsFluid="true" Title="9.计量器具报验管理情况" runat="server" EnableCollapse="false" <f:Panel ID="Pnl9" IsFluid="true" Title="9.计量器具报验管理情况" runat="server" EnableCollapse="false"
ShowHeader="true"> ShowHeader="true">
<Items> <Items>
@@ -1302,15 +1302,15 @@
<Columns> <Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" <f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" /> TextAlign="Center" />
<f:RenderField Width="300px" ColumnID="ContentName" DataField="ContentName" ExpandUnusedSpace="true" <f:RenderField Width="300px" ColumnID="WorkName" DataField="WorkName" ExpandUnusedSpace="true"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="施工分包商"> FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="施工分包商">
</f:RenderField> </f:RenderField>
<f:RenderField Width="250px" ColumnID="MonthsCount" DataField="MonthsCount" <f:RenderField Width="250px" ColumnID="OneOKRate" DataField="OneOKRate"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="本月一次共捡合格率"> FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="本月一次共捡合格率">
</f:RenderField> </f:RenderField>
<f:RenderField Width="160px" ColumnID="ProjectCount" DataField="ProjectCount" <f:RenderField Width="160px" ColumnID="TotalOneOKRate" DataField="TotalOneOKRate"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="项目累计一次共捡合格率"> FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="项目累计一次共捡合格率">
</f:RenderField> </f:RenderField>
<f:RenderField Width="200px" ColumnID="Remarks" DataField="Remarks" <f:RenderField Width="200px" ColumnID="Remarks" DataField="Remarks"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="备注"> FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="备注">
<Editor> <Editor>
@@ -1499,11 +1499,19 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
var db = Funs.DB; var db = Funs.DB;
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
var list = new List<Model.Report_CQMS_MonthReportItem>(); var list = new List<Model.CheckStatisc>();
int i = 1; int i = 1;
int Quantity1Sum = 0; int CheckNum = 0;//本月检查点数
int Quantity2Sum = 0; int TotalCheckNum = 0;//累计检查点数
int OKNum = 0;//本月检查合格点数
int TotalOKNum = 0;//累计检查合格点数
string Quantity1Sum = String.Empty;//本月检查合格点数/本月检查点数
string Quantity2Sum = String.Empty;//累计检查合格点数/累计检查点数
//加载所有单位 //加载所有单位
var units = from x in Funs.DB.Project_ProjectUnit var units = from x in Funs.DB.Project_ProjectUnit
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
@@ -1521,43 +1529,85 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
c.CheckDate, c.CheckDate,
c.ProjectId, c.ProjectId,
u.UnitId, u.UnitId,
u.UnitName u.UnitName,
c.IsOnceQualified
}; };
var AllList = query.ToList(); var AllList = query.ToList();
var monethCount = query var monethCount = query
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate))); .Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
model.Id = Guid.NewGuid().ToString();
model.ContentName = item.UnitName; Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
model.MonthsCount = monethCount.Count(); checkStatisc.Id = Guid.NewGuid().ToString();
model.ProjectCount = AllList.Count(); checkStatisc.ReportId = ReportId;
model.ReportId = ReportId; checkStatisc.WorkName = item.UnitName;
checkStatisc.CheckNum = monethCount.Count();
checkStatisc.TotalCheckNum = AllList.Count();
checkStatisc.OKNum = monethCount.Count(x => x.IsOnceQualified == true);
checkStatisc.TotalOKNum = AllList.Count(x => x.IsOnceQualified == true);
if (checkStatisc.CheckNum != 0)//被除数不能为零
{
checkStatisc.OneOKRate = Math.Round((double)checkStatisc.OKNum / (double)checkStatisc.CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
checkStatisc.OneOKRate = "0%";
}
if (checkStatisc.TotalCheckNum != 0)//被除数不能为零
{
checkStatisc.TotalOneOKRate = Math.Round((double)checkStatisc.TotalOKNum / (double)checkStatisc.TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
checkStatisc.TotalOneOKRate = "0%";
}
//如果是修改,查询表中数据 //如果是修改,查询表中数据
if (objType == "1") if (objType == "1")
{ {
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "10"); var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "10");
if (NewModel != null) if (NewModel != null)
{ {
model.RectificationRate = NewModel.RectificationRate; checkStatisc.Remarks = NewModel.Remarks;
model.Remarks = NewModel.Remarks;
} }
} }
list.Add(model); list.Add(checkStatisc);
CheckNum += checkStatisc.CheckNum;
TotalCheckNum += checkStatisc.TotalCheckNum;
OKNum += checkStatisc.OKNum;
TotalOKNum += checkStatisc.TotalOKNum;
Quantity1Sum += monethCount.Count();
Quantity2Sum += AllList.Count();
i++; i++;
} }
gvInspectionDataInspection.DataSource = list; gvInspectionDataInspection.DataSource = list;
gvInspectionDataInspection.DataBind(); gvInspectionDataInspection.DataBind();
if (CheckNum != 0)//被除数不能为零
{
Quantity1Sum = Math.Round((double)OKNum / (double)CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
Quantity1Sum = "0%";
}
if (TotalCheckNum != 0)//被除数不能为零
{
Quantity2Sum = Math.Round((double)TotalOKNum / (double)TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
}
else
{
Quantity2Sum = "0%";
}
//合计 //合计
JObject summary = new JObject(); JObject summary = new JObject();
summary.Add("ContentName", "合计"); summary.Add("WorkName", "合计");
summary.Add("MonthsCount", Quantity1Sum.ToString()); summary.Add("OneOKRate", Quantity1Sum.ToString());
summary.Add("ProjectCount", Quantity2Sum.ToString()); summary.Add("TotalOneOKRate", Quantity2Sum.ToString());
gvInspectionDataInspection.SummaryData = summary; gvInspectionDataInspection.SummaryData = summary;
#endregion #endregion
@@ -1647,7 +1697,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
} }
else else
{ {
OneOKRate = "0%"; OneOKRate = "0";
} }
if (TotalCheckNum != 0)//被除数不能为零 if (TotalCheckNum != 0)//被除数不能为零
{ {
@@ -1655,7 +1705,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
} }
else else
{ {
TotalOneOKRate = "0%"; TotalOneOKRate = "0";
} }
//检验批统计:土建 //检验批统计:土建
@@ -2071,7 +2121,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
u.UnitId, u.UnitId,
u.UnitName, u.UnitName,
c.IssuedDate, c.IssuedDate,
c.Status c.Status,
c.ImplementationFrontState,
}; };
var AllList = query.ToList(); var AllList = query.ToList();
@@ -2083,8 +2134,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
NCRStatisc.WorkName = item.UnitName; NCRStatisc.WorkName = item.UnitName;
//NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(x => x.Status == "3"); //NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(x => x.Status == "3");
//NCRStatisc.OKNum = AllList.Count(x => x.Status == "3"); //NCRStatisc.OKNum = AllList.Count(x => x.Status == "3");
NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(); NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Where(x => x.ImplementationFrontState.Trim().Equals("已闭合")).Count();
NCRStatisc.OKNum = AllList.Count(); NCRStatisc.OKNum = AllList.Where(x => x.ImplementationFrontState.Trim().Equals("已闭合")).Count();
NCRStatisc.CheckNum = AllList.Count(); NCRStatisc.CheckNum = AllList.Count();
@@ -3427,10 +3478,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{ {
ReportId = ReportId, ReportId = ReportId,
ReType = "10", ReType = "10",
ContentName = values.Value<string>("ContentName"), ContentName = values.Value<string>("WorkName"),
MonthsCount = values.Value<int>("MonthsCount"), RectificationRate = values.Value<string>("OneOKRate"),
ProjectCount = values.Value<int>("ProjectCount"), TotationRate = values.Value<string>("TotalOneOKRate"),
//RectificationRate = values.Value<string>("RectificationRate"),
Remarks = values.Value<string>("Remarks"), Remarks = values.Value<string>("Remarks"),
}; };
if (gvInspectionDataInspection.Rows[rowIndex].DataKeys.Length > 0) if (gvInspectionDataInspection.Rows[rowIndex].DataKeys.Length > 0)
@@ -13,20 +13,24 @@
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" <f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch"> ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="控制点检查检测合格率统计" EnableCollapse="true" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="控制点检查检测合格率统计" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CheckDate" AllowCellEditing="true" EnableColumnLines="true" runat="server" BoxFlex="1" DataKeyNames="CheckDate" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="CheckDate" AllowSorting="true" SortField="CheckDate" ForceFit="true" ClicksToEdit="2" DataIDField="CheckDate" AllowSorting="true" SortField="CheckDate" ForceFit="true"
SortDirection="ASC" EnableTextSelection="true"> SortDirection="ASC" EnableTextSelection="true">
<Toolbars> <Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left"> <f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items> <Items>
<f:DropDownList ID="drpCNProfessional" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true" LabelWidth="110px"> <f:DropDownList ID="drpZhType" runat="server" Label="类别" LabelAlign="Right" EnableEdit="true" LabelWidth="110px" AutoPostBack="true" OnSelectedIndexChanged="drpZhType_SelectedIndexChanged">
<f:ListItem Value="1" Text="专业" Selected="true" />
<f:ListItem Value="2" Text="单位名称" />
</f:DropDownList>
<f:DropDownList ID="drpCNProfessional" runat="server" Label="" LabelAlign="Right" EnableEdit="true">
</f:DropDownList> </f:DropDownList>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime" <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime"
LabelAlign="right" > LabelAlign="right">
</f:DatePicker> </f:DatePicker>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime" <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime"
LabelAlign="right" > LabelAlign="right">
</f:DatePicker> </f:DatePicker>
<f:Button ID="btnSearch" Icon="SystemSearch" ToolTip="查询" <f:Button ID="btnSearch" Icon="SystemSearch" ToolTip="查询"
EnablePostBack="true" runat="server" OnClick="btnSearch_Click"> EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
@@ -21,8 +21,19 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业 if (drpZhType.SelectedValue.Equals("1"))
BindGvInspectionManagement(null); {
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, false);//专业
drpCNProfessional.Items.Insert(0, new FineUIPro.ListItem("- 请选择专业 -", BLL.Const._Null));
}
else
{
BLL.UnitService.InitUnitDownList(this.drpCNProfessional, this.CurrUser.LoginProjectId, false);//施工分包商
drpCNProfessional.Items.Insert(0, new FineUIPro.ListItem("- 请选择单位名称 -", BLL.Const._Null));
}
BindGvInspectionManagement(this.drpZhType.SelectedValue, this.drpCNProfessional.SelectedValue);
} }
} }
#region GridView #region GridView
@@ -30,7 +41,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// 绑定 /// 绑定
/// </summary> /// </summary>
/// <param name="cNProfessionalId"></param> /// <param name="cNProfessionalId"></param>
public void BindGvInspectionManagement(string cNProfessionalId) public void BindGvInspectionManagement(string ZyType, string cNProfessionalId)
{ {
if (string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && string.IsNullOrEmpty(this.txtEndTime.Text.Trim())) //未选择日期,统计项目开始起的每月数据 if (string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && string.IsNullOrEmpty(this.txtEndTime.Text.Trim())) //未选择日期,统计项目开始起的每月数据
{ {
@@ -49,10 +60,22 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{ {
if (DateTime.Now < NewDate) if (DateTime.Now < NewDate)
{ {
//统计所给时间段的全部数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
//统计所给时间段的合格数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true); {
//统计所给时间段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给时间段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
else
{
//统计所给时间段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给时间段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
@@ -70,12 +93,24 @@ namespace FineUIPro.Web.CQMS.ProcessControl
} }
else else
{ {
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
NextDate = Convert.ToDateTime(StartDate.Year + "-" + StartDate.Month + "-25"); NextDate = Convert.ToDateTime(StartDate.Year + "-" + StartDate.Month + "-25");
//统计所给事件段的全部数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, false); {
//统计所给事件段的合格数量
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, true);
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, true);
}
else
{
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NextDate, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NextDate); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NextDate);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); Statistics.OneStatisticsSunNumber = managementListOneNumber.Count();
@@ -93,10 +128,25 @@ namespace FineUIPro.Web.CQMS.ProcessControl
{ {
if (DateTime.Now < NewDate) if (DateTime.Now < NewDate)
{ {
//统计所给事件段的全部数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
//统计所给事件段的合格数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true); {
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
else
{
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
@@ -115,10 +165,22 @@ namespace FineUIPro.Web.CQMS.ProcessControl
} }
else else
{ {
//统计所给事件段的全部数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
//统计所给事件段的合格数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true); {
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true);
}
else
{
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); Statistics.OneStatisticsSunNumber = managementListOneNumber.Count();
@@ -151,11 +213,23 @@ namespace FineUIPro.Web.CQMS.ProcessControl
NewDate = Convert.ToDateTime(NextDate.Year + "-" + NextDate.Month + "-25"); NewDate = Convert.ToDateTime(NextDate.Year + "-" + NextDate.Month + "-25");
if (DateTime.Now < NewDate) if (DateTime.Now < NewDate)
{ {
//统计所给事件段的全部数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
//统计所给事件段的合格数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true); {
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
else
{
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, DateTime.Now, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", DateTime.Now);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); Statistics.OneStatisticsSunNumber = managementListOneNumber.Count();
@@ -173,10 +247,21 @@ namespace FineUIPro.Web.CQMS.ProcessControl
} }
else else
{ {
//统计所给事件段的全部数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
//统计所给事件段的合格数量 if (ZyType == "1")
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true); {
//统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true);
}
else
{ //统计所给事件段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, false);
//统计所给事件段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, NewDate, true);
}
Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate); Statistics.CheckDate += string.Format("{0:yyyy-MM-dd}", NewDate);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); Statistics.OneStatisticsSunNumber = managementListOneNumber.Count();
@@ -231,10 +316,25 @@ namespace FineUIPro.Web.CQMS.ProcessControl
EndDate = Convert.ToDateTime(this.txtEndTime.Text.Trim()); EndDate = Convert.ToDateTime(this.txtEndTime.Text.Trim());
} }
Model.InspectionManagementStatistics Statistics = new Model.InspectionManagementStatistics(); Model.InspectionManagementStatistics Statistics = new Model.InspectionManagementStatistics();
//统计所给时间段的全部数量
List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, false);
//统计所给时间段的合格数量 List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, true); List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber = new List<Model.View_CQMS_InspectionManagementDetail>();
if (ZyType == "1")
{
//统计所给时间段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, false);
//统计所给时间段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, true);
}
else
{
//统计所给时间段的全部数量
managementListSunNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, false);
//统计所给时间段的合格数量
managementListOneNumber = BLL.InspectionManagementService.getInspectionManagementDetailListByUnitIdAndDate(this.CurrUser.LoginProjectId, cNProfessionalId, StartDate, EndDate, true);
}
Statistics.CheckDate = string.Format("{0:yyyy-MM-dd}", StartDate) + " 至 " + string.Format("{0:yyyy-MM-dd}", EndDate); Statistics.CheckDate = string.Format("{0:yyyy-MM-dd}", StartDate) + " 至 " + string.Format("{0:yyyy-MM-dd}", EndDate);
Statistics.SunNumber = managementListSunNumber.Count(); Statistics.SunNumber = managementListSunNumber.Count();
Statistics.OneStatisticsSunNumber = managementListOneNumber.Count(); Statistics.OneStatisticsSunNumber = managementListOneNumber.Count();
@@ -255,14 +355,16 @@ namespace FineUIPro.Web.CQMS.ProcessControl
protected void btnSearch_Click(object sender, EventArgs e) protected void btnSearch_Click(object sender, EventArgs e)
{ {
if (this.drpCNProfessional.SelectedValue != BLL.Const._Null) BindGvInspectionManagement(this.drpZhType.SelectedValue, this.drpCNProfessional.SelectedValue);
{
BindGvInspectionManagement(this.drpCNProfessional.SelectedValue); //if (this.drpCNProfessional.SelectedValue != BLL.Const._Null)
} //{
else // BindGvInspectionManagement(this.drpCNProfessional.SelectedValue);
{ //}
BindGvInspectionManagement(null); //else
} //{
// BindGvInspectionManagement(null);
//}
} }
@@ -274,16 +376,38 @@ namespace FineUIPro.Web.CQMS.ProcessControl
Response.ContentType = "application/excel"; Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.UTF8; Response.ContentEncoding = Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount; this.Grid1.PageSize = Grid1.RecordCount;
if (this.drpCNProfessional.SelectedValue != BLL.Const._Null) //if (this.drpCNProfessional.SelectedValue != BLL.Const._Null)
{ //{
BindGvInspectionManagement(this.drpCNProfessional.SelectedValue); // BindGvInspectionManagement(this.drpCNProfessional.SelectedValue);
} //}
else //else
{ //{
BindGvInspectionManagement(null); // BindGvInspectionManagement(null);
} //}
BindGvInspectionManagement(this.drpZhType.SelectedValue, this.drpCNProfessional.SelectedValue);
Response.Write(GetGridTableHtml2(Grid1)); Response.Write(GetGridTableHtml2(Grid1));
Response.End(); Response.End();
} }
/// <summary>
///下拉动态加载数据信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpZhType_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpCNProfessional.Items.Clear();
if (drpZhType.SelectedValue.Equals("1"))
{
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, false);//专业
drpCNProfessional.Items.Insert(0, new FineUIPro.ListItem("- 请选择专业 -", BLL.Const._Null));
}
else
{
BLL.UnitService.InitUnitDownList(this.drpCNProfessional, this.CurrUser.LoginProjectId, false);//施工分包商
drpCNProfessional.Items.Insert(0, new FineUIPro.ListItem("- 请选择单位 -", BLL.Const._Null));
}
this.drpCNProfessional.SelectedIndex = 0;
}
} }
} }
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.CQMS.ProcessControl {
/// </remarks> /// </remarks>
protected global::FineUIPro.Toolbar ToolSearch; protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// drpZhType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpZhType;
/// <summary> /// <summary>
/// drpCNProfessional 控件。 /// drpCNProfessional 控件。
/// </summary> /// </summary>
+16
View File
@@ -426,6 +426,8 @@
<Content Include="CQMS\Comprehensive\DataReceivingDataIn.aspx" /> <Content Include="CQMS\Comprehensive\DataReceivingDataIn.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDoc.aspx" /> <Content Include="CQMS\Comprehensive\DataReceivingDoc.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingDocApprove.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\DataReceivingDocEdit.aspx" />
<Content Include="CQMS\Comprehensive\DataReceivingEdit.aspx" /> <Content Include="CQMS\Comprehensive\DataReceivingEdit.aspx" />
<Content Include="CQMS\Comprehensive\DesignChangeOrder.aspx" /> <Content Include="CQMS\Comprehensive\DesignChangeOrder.aspx" />
@@ -7348,6 +7350,20 @@
<Compile Include="CQMS\Comprehensive\DataReceivingDocApprove.aspx.designer.cs"> <Compile Include="CQMS\Comprehensive\DataReceivingDocApprove.aspx.designer.cs">
<DependentUpon>DataReceivingDocApprove.aspx</DependentUpon> <DependentUpon>DataReceivingDocApprove.aspx</DependentUpon>
</Compile> </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"> <Compile Include="CQMS\Comprehensive\DataReceivingDocEdit.aspx.cs">
<DependentUpon>DataReceivingDocEdit.aspx</DependentUpon> <DependentUpon>DataReceivingDocEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
+1 -1
View File
@@ -12,7 +12,7 @@
<appSettings> <appSettings>
<!--连接字符串--> <!--连接字符串-->
<!--<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>--> <!--<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>-->
<add key="ConnectionString" value="Server=DESKTOP-1QITK9E\MSSQLSERVER2;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=123;MultipleActiveResultSets=true;Connect Timeout=1200"/> <add key="ConnectionString" value="Server=.\SQL2012;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<!--系统名称--> <!--系统名称-->
<add key="SystemName" value="智慧施工管理信息系统V1.0"/> <add key="SystemName" value="智慧施工管理信息系统V1.0"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/> <add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

+14
View File
@@ -96,5 +96,19 @@ namespace Model
get { return id; } get { return id; }
set { id = value; } set { id = value; }
} }
private string reportId;
public string ReportId
{
get { return reportId; }
set { reportId = value; }
}
private string remarks;
public string Remarks
{
get { return remarks; }
set { remarks = value; }
}
} }
} }
+2631 -735
View File
File diff suppressed because it is too large Load Diff