20210816
This commit is contained in:
@@ -1 +1,38 @@
|
||||
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:HttpException
|
||||
错误信息:文件“/ZHGL/RealName/LeavePost.aspx”不存在。
|
||||
错误堆栈:
|
||||
在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
|
||||
在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
|
||||
在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
|
||||
在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
|
||||
在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
|
||||
在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
|
||||
在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
|
||||
在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
|
||||
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
|
||||
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
|
||||
出错时间:08/16/2021 14:45:33
|
||||
出错文件:http://localhost:8118/ZHGL/RealName/LeavePost.aspx
|
||||
IP地址:::1
|
||||
|
||||
出错时间:08/16/2021 14:45:33
|
||||
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:NullReferenceException
|
||||
错误信息:未将对象引用设置到对象的实例。
|
||||
错误堆栈:
|
||||
在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
|
||||
在 FineUIPro.ResourceHelper.GetResourceContentAsBinary(String resName, String resVersion)
|
||||
在 FineUIPro.ResourceHandler.ProcessRequest(HttpContext context)
|
||||
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
|
||||
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
|
||||
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
|
||||
出错时间:08/16/2021 16:29:05
|
||||
出错文件:http://localhost:8118/res.axd?font=lib.iconfont.iconfont.woff&t=636947851460000000
|
||||
IP地址:::1
|
||||
|
||||
出错时间:08/16/2021 16:29:05
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1486,6 +1486,8 @@
|
||||
<Content Include="ZHGL\ProjectAccident\AccidentStatistics.aspx" />
|
||||
<Content Include="ZHGL\ProjectAccident\AccidentStatisticsEdit.aspx" />
|
||||
<Content Include="ZHGL\ProjectAccident\AccidentStatisticsView.aspx" />
|
||||
<Content Include="ZHGL\RealName\LeavePost.aspx" />
|
||||
<Content Include="ZHGL\RealName\LeavePostIn.aspx" />
|
||||
<Content Include="ZHGL\RealName\SynchroRecord.aspx" />
|
||||
<Content Include="ZHGL\RealName\SynchroSet.aspx" />
|
||||
<Content Include="ZHGL\RealName\BasicData.aspx" />
|
||||
@@ -14640,6 +14642,20 @@
|
||||
<Compile Include="ZHGL\ProjectAccident\AccidentStatisticsView.aspx.designer.cs">
|
||||
<DependentUpon>AccidentStatisticsView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\RealName\LeavePost.aspx.cs">
|
||||
<DependentUpon>LeavePost.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\RealName\LeavePost.aspx.designer.cs">
|
||||
<DependentUpon>LeavePost.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\RealName\LeavePostIn.aspx.cs">
|
||||
<DependentUpon>LeavePostIn.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\RealName\LeavePostIn.aspx.designer.cs">
|
||||
<DependentUpon>LeavePostIn.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\RealName\SynchroRecord.aspx.cs">
|
||||
<DependentUpon>SynchroRecord.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="编辑考勤" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="950px" Height="450px">
|
||||
Width="1000px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="导入考勤" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<Items>
|
||||
<f:Label ID="Label1" runat="server">
|
||||
</f:Label>
|
||||
<f:RadioButtonList ID="rblCheck" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rblCheck_SelectedIndexChanged">
|
||||
<f:RadioButtonList ID="rblCheck" runat="server" Hidden="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="rblCheck_SelectedIndexChanged">
|
||||
<f:RadioItem Value="手动" Text="手动" Selected="true" />
|
||||
<f:RadioItem Value="自动" Text="自动" />
|
||||
</f:RadioButtonList>
|
||||
@@ -27,61 +28,21 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<%--<f:DropDownBox runat="server" ID="drpPersonId" Label="人员姓名" EmptyText="请从下拉表格中选择"
|
||||
MatchFieldWidth="false" LabelAlign="Right" AutoPostBack="true" OnTextChanged="drpPersonId_TextChanged"
|
||||
EnableMultiSelect="false" Required="true" ShowRedStar="true" >
|
||||
<PopPanel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="PersonId"
|
||||
DataTextField="PersonName" DataKeyNames="PersonId" AllowSorting="true" SortField="CardNo"
|
||||
SortDirection="ASC" EnableColumnLines="true" Hidden="true" Width="900px" PageSize="10000"
|
||||
Height="300px" EnableMultiSelect="false" EnableCheckBoxSelect="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="卡号" ID="txtCardNo" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="姓名" ID="txtPersonName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="身份证号" ID="txtIdentityCard" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="300px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
|
||||
TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="CardNo" DataField="CardNo" SortField="CardNo"
|
||||
FieldType="String" HeaderText="卡号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PersonName" DataField="PersonName" EnableFilter="true"
|
||||
SortField="PersonName" FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderText="所在单位" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="WorkPostName" DataField="WorkPostName" SortField="WorkPostName"
|
||||
FieldType="String" HeaderText="岗位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</PopPanel>
|
||||
</f:DropDownBox>--%>
|
||||
<f:DropDownBox runat="server" ID="drpPersonId" Label="人员姓名" EmptyText="请从下拉表格中选择"
|
||||
<f:DropDownBox runat="server" ID="drpPersonId" Label="人员姓名" EmptyText="请从下拉表格中选择" ShowRedStar="true"
|
||||
EnableMultiSelect="true" MatchFieldWidth="false" Values="105,108" AutoPostBack="true" OnTextChanged="drpPersonId_TextChanged">
|
||||
<PopPanel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" Width="900px" Height="300px" Hidden="true"
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" Width="900px" Height="500px" Hidden="true"
|
||||
DataIDField="PersonId" DataTextField="PersonName" EnableMultiSelect="true" KeepCurrentSelection="true"
|
||||
DataKeyNames="PersonId" EnableCheckBoxSelect="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="卡号" ID="txtCardNo" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
<f:DropDownList runat="server" ID="drpUnit" Label="单位" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
Width="300px" LabelAlign="Right" LabelWidth="50px">
|
||||
</f:DropDownList>
|
||||
<%--<f:TextBox runat="server" Label="卡号" ID="txtCardNo" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</f:TextBox>--%>
|
||||
<f:TextBox runat="server" Label="姓名" ID="txtPersonName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
@@ -114,29 +75,13 @@
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtIdCard" Label="身份证号码" Readonly="true" runat="server"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="40% 25% 35%">
|
||||
<Items>
|
||||
<f:TextBox ID="txtWorkArea" runat="server" Label="单位工程" MaxLength="100" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpWorkArea" runat="server" AutoPostBack="true" EnableMultiSelect="true" OnSelectedIndexChanged="drpWorkArea_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:Label ID="Label4" runat="server" Text="说明:检查区域可从下拉框选择也可手动编辑。" CssClass="lab" MarginLeft="5px">
|
||||
</f:Label>
|
||||
<f:TextBox ID="txtIdCard" Label="身份证号码" Readonly="true" runat="server" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtAddress" runat="server" Label="进出地点" MaxLength="50" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpType" runat="server" Label="进出时间">
|
||||
<f:DropDownList ID="drpType" runat="server" Label="进出时间" ShowRedStar="true">
|
||||
<f:ListItem Value="1" Text="入场时间" />
|
||||
<f:ListItem Value="0" Text="出场时间" />
|
||||
</f:DropDownList>
|
||||
@@ -146,6 +91,28 @@
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpWorkArea" runat="server" AutoPostBack="true" EnableMultiSelect="true"
|
||||
OnSelectedIndexChanged="drpWorkArea_SelectedIndexChanged" Label="单位工程">
|
||||
</f:DropDownList>
|
||||
<f:Label ID="Label4" runat="server" Text="说明:单位工程可从下拉框选择也可手动编辑。" CssClass="lab" MarginLeft="5px">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtWorkArea" runat="server" MaxLength="100" LabelAlign="Right" Label=" ">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtAddress" runat="server" Label="进出地点" MaxLength="50" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
|
||||
@@ -53,6 +53,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
///区域下拉框
|
||||
BLL.UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.ProjectId, true);
|
||||
UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true);
|
||||
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnit.Enabled = false;
|
||||
}
|
||||
BindGrid(string.Empty);
|
||||
this.CheckingId = Request.Params["CheckingId"];
|
||||
if (!string.IsNullOrEmpty(Request.Params["type"]))
|
||||
@@ -145,14 +151,25 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
/// <param name="e"></param>
|
||||
protected void drpWorkArea_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpWorkArea.SelectedValue != BLL.Const._Null)
|
||||
string selectName = string.Empty;
|
||||
foreach (var item in this.drpWorkArea.SelectedValueArray)
|
||||
{
|
||||
this.txtWorkArea.Text = this.drpWorkArea.SelectedText;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtWorkArea.Text = string.Empty;
|
||||
if (item != Const._Null)
|
||||
{
|
||||
string text = this.drpWorkArea.Items.FindByValue(item).Text;
|
||||
if (string.IsNullOrEmpty(selectName))
|
||||
{
|
||||
selectName = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
selectName += ","+ text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.txtWorkArea.Text = selectName;
|
||||
this.drpWorkArea.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpWorkArea.SelectedValueArray);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -175,12 +192,18 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
string strSql = @"SELECT Person.PersonId,Person.CardNo,Person.PersonName,Person.IdentityCard,Person.UnitId,Person.WorkPostId,Unit.UnitName,WorkPost.WorkPostName "
|
||||
+ @" FROM SitePerson_Person AS Person "
|
||||
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = Person.UnitId "
|
||||
+ @" LEFT JOIN Base_WorkPost AS WorkPost ON WorkPost.WorkPostId = Person.WorkPostId WHERE ProjectId='" + this.ProjectId + "'";
|
||||
+ @" LEFT JOIN Base_WorkPost AS WorkPost ON WorkPost.WorkPostId = Person.WorkPostId "
|
||||
+@" WHERE IsUsed =1 AND (OutTime IS NULL OR OutTime > GETDATE()) AND ProjectId='" + this.ProjectId + "'";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
|
||||
//if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
|
||||
//{
|
||||
// strSql += " AND Person.CardNo LIKE @CardNo";
|
||||
// listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
|
||||
//}
|
||||
if (this.drpUnit.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND Person.CardNo LIKE @CardNo";
|
||||
listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
|
||||
strSql += " AND Person.UnitId = @UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
{
|
||||
|
||||
+38
-38
@@ -94,13 +94,13 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtCardNo 控件。
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCardNo;
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtPersonName 控件。
|
||||
@@ -129,42 +129,6 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdCard;
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// drpWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// txtAddress 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtAddress;
|
||||
|
||||
/// <summary>
|
||||
/// drpType 控件。
|
||||
/// </summary>
|
||||
@@ -192,6 +156,42 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtTime2;
|
||||
|
||||
/// <summary>
|
||||
/// drpWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// txtAddress 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtAddress;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
.f-grid-row.Red {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.LabelColor {
|
||||
color: Red;
|
||||
font-size: small;
|
||||
@@ -42,7 +43,7 @@
|
||||
TitleToolTip="人员信息" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="人员信息" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PersonId" DataIDField="PersonId" AllowSorting="true" SortField="CardNo,PersonName" SortDirection="ASC"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PersonId" DataIDField="PersonId" AllowSorting="true" SortField="PersonName" SortDirection="ASC"
|
||||
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" EnableColumnLines="true" ForceFit="true"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
|
||||
EnableTextSelection="True" EnableCheckBoxSelect="true">
|
||||
@@ -52,16 +53,14 @@
|
||||
<f:TextBox runat="server" Label="姓名" ID="txtPersonName" EmptyText="输入查询条件"
|
||||
Width="200px" LabelWidth="70px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="卡号" ID="txtCardNo" EmptyText="输入查询条件"
|
||||
Width="200px" LabelWidth="50px" LabelAlign="right" Hidden="true">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpPost" runat="server" Label="岗位" EnableEdit="true" EnableMultiSelect="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpPost_SelectedIndexChanged"
|
||||
Width="200px" LabelWidth="50px" LabelAlign="right" ForceSelection="false" EnableCheckBoxSelect="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpTreamGroup" runat="server" Label="班组" EnableEdit="true"
|
||||
Width="200px" LabelWidth="50px" LabelAlign="right" ForceSelection="false">
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" Label="身份证" ID="txtIdentityCard" EmptyText="输入查询条件"
|
||||
<f:TextBox runat="server" Label="身份证" ID="txtIdentityCard" EmptyText="输入查询条件"
|
||||
Width="200px" LabelWidth="70px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
@@ -70,10 +69,10 @@
|
||||
</Toolbars>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<Items>
|
||||
<f:CheckBox runat="server" ID="ckIdCardInfoNotOK" Label="信息不全" LabelAlign="right" LabelWidth="80px">
|
||||
</f:CheckBox>
|
||||
<f:CheckBox runat="server" ID="ckIspost" Label="未在岗" LabelAlign="right" LabelWidth="80px">
|
||||
<f:CheckBox runat="server" ID="ckIspost" Label="未在岗" LabelAlign="right" LabelWidth="80px">
|
||||
</f:CheckBox>
|
||||
<f:CheckBox runat="server" ID="ckJT" Label="未同步" LabelAlign="right" LabelWidth="80px">
|
||||
</f:CheckBox>
|
||||
@@ -93,7 +92,7 @@
|
||||
</f:Button>
|
||||
<f:Button ID="btnQR" ToolTip="批量生成二维码" Icon="TableRefresh" runat="server" OnClick="btnQR_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnPhoto" ToolTip="刷新照片转二进制" Icon="ArrowRefresh" runat="server" OnClick="btnPhoto_Click" >
|
||||
<f:Button ID="btnPhoto" ToolTip="刷新照片转二进制" Icon="ArrowRefresh" runat="server" OnClick="btnPhoto_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
@@ -103,43 +102,32 @@
|
||||
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField HeaderText="卡号" ColumnID="CardNo" DataField="CardNo" SortField="CardNo"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField HeaderText="岗位名称" ColumnID="WorkPostName" DataField="WorkPostName" SortField="WorkPostName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="200px">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField HeaderText="部门名称" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
|
||||
</f:RenderField> --%>
|
||||
<f:TemplateField ColumnID="tfI" HeaderText="身份证号" Width="170px" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbI" runat="server" Text=' <%# Bind("IdentityCard") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="tfI" HeaderText="身份证号" Width="170px" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbI" runat="server" Text=' <%# Bind("IdentityCard") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField HeaderText="班组" ColumnID="TeamGroupName" DataField="TeamGroupName" SortField="TeamGroupName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField HeaderText="单位工程" ColumnID="WorkAreaName" DataField="WorkAreaName" SortField="WorkAreaName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="110px" >
|
||||
</f:RenderField> --%>
|
||||
<f:RenderField Width="100px" ColumnID="InTime" DataField="InTime" SortField="InTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="入场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField HeaderText="电话" ColumnID="Telephone" DataField="Telephone" SortField="Telephone"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="110px">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField HeaderText="在场" ColumnID="IsUsedName" DataField="IsUsedName" SortField="IsUsedName"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="入场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="OutTime" DataField="OutTime" SortField="OutTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="出场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="状态" ColumnID="PersonState" DataField="PersonState" SortField="PersonState"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="OutTime" DataField="OutTime" SortField="OutTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="出场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
||||
@@ -179,84 +179,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
unitId = str[0];
|
||||
}
|
||||
}
|
||||
string strSql = "select * from View_SitePerson_Person Where ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@ProjectId", this.ProjectId)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
if (unitId == "0")
|
||||
{
|
||||
strSql += " AND UnitId IS NULL ";
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND UnitId =@UnitId ";
|
||||
listStr.Add(new SqlParameter("@UnitId", unitId));
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND PersonName LIKE @PersonName";
|
||||
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
|
||||
{
|
||||
strSql += " AND CardNo LIKE @CardNo";
|
||||
listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
|
||||
{
|
||||
strSql += " AND IdentityCard LIKE @IdentityCard";
|
||||
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND TeamGroupId = @TeamGroupId";
|
||||
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
|
||||
}
|
||||
|
||||
if (this.drpPost.SelectedItemArray.Count() > 1 || (this.drpPost.SelectedValue != BLL.Const._Null && this.drpPost.SelectedItemArray.Count() == 1))
|
||||
{
|
||||
strSql += " AND (1=2 ";
|
||||
int i = 0;
|
||||
foreach (var item in this.drpPost.SelectedValueArray)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
||||
{
|
||||
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
|
||||
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
strSql += ")";
|
||||
}
|
||||
if (this.ckTrain.Checked)
|
||||
{
|
||||
strSql += " AND TrainCount =0";
|
||||
}
|
||||
if (this.ckIspost.Checked)
|
||||
{
|
||||
strSql += " AND IsUsedName ='否'";
|
||||
}
|
||||
if (this.ckJT.Checked)
|
||||
{
|
||||
strSql += " AND RealNameAddTime IS NULL";
|
||||
}
|
||||
if (this.ckIdCardInfoNotOK.Checked)
|
||||
{
|
||||
strSql += " AND (IdcardType is null or IdentityCard is null or PhotoUrl is null or HeadImage IS NULL OR (LEN(IdentityCard) != 15 AND LEN(IdentityCard) != 18))";
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
var getData = PersonService.getListData(this.ProjectId, unitId, this.txtPersonName.Text.Trim(), this.txtIdentityCard.Text.Trim(),
|
||||
this.drpTreamGroup.SelectedValue, Funs.GetStringByArray(this.drpPost.SelectedValueArray), this.ckTrain.Checked, this.ckIspost.Checked, this.ckJT.Checked,
|
||||
this.ckIdCardInfoNotOK.Checked, Grid1);
|
||||
Grid1.RecordCount = PersonService.count;
|
||||
Grid1.DataSource = getData;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
@@ -737,5 +665,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
}
|
||||
ShowNotify("操作完成,新转二进制照片" + num.ToString() + "条", MessageBoxIcon.Success);
|
||||
}
|
||||
|
||||
|
||||
protected void drpPost_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpPost.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpPost.SelectedValueArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,15 +111,6 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// txtCardNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCardNo;
|
||||
|
||||
/// <summary>
|
||||
/// drpPost 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
<f:CheckBox runat="server" ID="ckIsOutside" Label="外聘" LabelAlign="Right"></f:CheckBox>
|
||||
<f:TextBox ID="txtTelephone" runat="server" Label="电话" LabelAlign="Right" MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:RadioButtonList ID="rblIsUsed" runat="server" Label="人员在场" LabelAlign="Right" Required="True" ShowRedStar="True">
|
||||
<f:RadioButtonList ID="rblIsUsed" runat="server" Label="审核通过" LabelAlign="Right" Required="True" ShowRedStar="True">
|
||||
<f:RadioItem Value="True" Text="是" />
|
||||
<f:RadioItem Value="False" Text="否" />
|
||||
</f:RadioButtonList>
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeavePost.aspx.cs"
|
||||
Inherits="FineUIPro.Web.ZHGL.RealName.LeavePost" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>实名制人员</title>
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="实名制人员" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="NewId" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
DataIDField="NewId" AllowSorting="true" SortField="InTime" EnableTextSelection="True"
|
||||
SortDirection="DESC" EnableColumnLines="true" OnSort="Grid1_Sort" ForceFit="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:RadioButtonList runat="server" ID="rblStates" AutoPostBack="true" Width="150px"
|
||||
OnSelectedIndexChanged="btnSearch_Click">
|
||||
<f:RadioItem Value="0" Text="全部" Selected="true" />
|
||||
<f:RadioItem Value="1" Text="离岗" />
|
||||
</f:RadioButtonList>
|
||||
<f:TextBox runat="server" Label="项目编码" id="txtProjectCode" LabelWidth="80px" Width="220px"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="姓名" id="txtName" LabelWidth="80px" Width="200px"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="身份证" id="txtIdentityCard" LabelWidth="80px" Width="280px"></f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" runat="server" Icon="SystemSearch" ToolTip="查询" OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" runat="server" OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDel" runat="server" Icon="Delete" ToolTip="清空" OnClick="btnDel_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="60px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="150px" ColumnID="Id" DataField="Id" FieldType="String" HeaderText="Id"
|
||||
HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="PersonName" DataField="PersonName"
|
||||
SortField="PersonName" FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="IdentityCard" DataField="IdentityCard"
|
||||
SortField="IdentityCard" FieldType="String" HeaderText="身份证" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="ProjectCode" DataField="ProjectCode"
|
||||
SortField="ProjectCode" FieldType="String" HeaderText="项目编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectShortName" DataField="ProjectShortName"
|
||||
SortField="ProjectShortName" FieldType="String" HeaderText="项目简称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="InTime" DataField="InTime" SortField="InTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="入场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="OutTime" DataField="OutTime" SortField="OutTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="出场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<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:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window2" Title="导入" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window2_Close"
|
||||
Width="1200px" Height="600px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,147 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Text;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.RealName
|
||||
{
|
||||
public partial class LeavePost : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
//this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
//this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.GridBind();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据,合并相同行
|
||||
/// </summary>
|
||||
private void GridBind()
|
||||
{
|
||||
var getData = LeavePostService.getListData(this.rblStates.SelectedValue, this.txtProjectCode.Text.Trim(), this.txtName.Text.Trim(), this.txtIdentityCard.Text.Trim(), Grid1);
|
||||
Grid1.RecordCount = LeavePostService.count;
|
||||
Grid1.DataSource = getData;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.GridBind();
|
||||
}
|
||||
|
||||
#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) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
this.GridBind();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/><html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
string html = row.Values[column.ColumnIndex].ToString();
|
||||
if (column.ColumnID == "tfNumber")
|
||||
{
|
||||
html = (row.FindControl("labNumber") as AspNet.Label).Text;
|
||||
}
|
||||
sb.AppendFormat("<td x:str>{0}</td>", html);
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页 排序
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
this.GridBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
|
||||
this.GridBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
this.GridBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("LeavePostIn.aspx", "导入 - ")));
|
||||
}
|
||||
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
this.GridBind();
|
||||
}
|
||||
|
||||
protected void btnDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
LeavePostService.DeleteLeavePost();
|
||||
ShowNotify("删除完成!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.RealName {
|
||||
|
||||
|
||||
public partial class LeavePost {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// rblStates 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblStates;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjectCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjectCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentityCard 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentityCard;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// btnDel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDel;
|
||||
|
||||
/// <summary>
|
||||
/// labNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label labNumber;
|
||||
|
||||
/// <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>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeavePostIn.aspx.cs" Inherits="FineUIPro.Web.ZHGL.RealName.LeavePostIn" %>
|
||||
|
||||
<!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>
|
||||
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1"
|
||||
OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
EnableColumnLines="true" BoxFlex="1" DataKeyNames="Id" DataIDField="Id" ForceFit="true"
|
||||
AllowSorting="true" SortField="ProjectCode,InTime" PageSize="100000" Height="400px">
|
||||
<Columns>
|
||||
<f:TemplateField Width="55px" HeaderText="序号">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="PersonName" DataField="PersonName"
|
||||
SortField="PersonName" FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="IdentityCard" DataField="IdentityCard"
|
||||
SortField="IdentityCard" FieldType="String" HeaderText="身份证" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="ProjectCode" DataField="ProjectCode"
|
||||
SortField="ProjectCode" FieldType="String" HeaderText="项目编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="ProjectShortName" DataField="ProjectShortName"
|
||||
SortField="ProjectShortName" FieldType="String" HeaderText="项目简称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="InTime" DataField="InTime" SortField="InTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="入场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="OutTime" DataField="OutTime" SortField="OutTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="出场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:HiddenField ID="hdCheckResult" runat="server">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,470 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.RealName
|
||||
{
|
||||
public partial class LeavePostIn : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 人员考勤集合
|
||||
/// </summary>
|
||||
public static List<Model.RealName_LeavePost> viewLeavePosts = new List<Model.RealName_LeavePost>();
|
||||
|
||||
/// <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)
|
||||
{
|
||||
this.hdFileName.Text = string.Empty;
|
||||
this.hdCheckResult.Text = string.Empty;
|
||||
if (viewLeavePosts != null)
|
||||
{
|
||||
viewLeavePosts.Clear();
|
||||
}
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 审核
|
||||
/// <summary>
|
||||
/// 审核
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.fuAttachUrl.HasFile == false)
|
||||
{
|
||||
ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
|
||||
if (IsXls != ".xls")
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (viewLeavePosts!=null)
|
||||
{
|
||||
viewLeavePosts.Clear();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
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.fuAttachUrl.PostedFile.SaveAs(filePath);
|
||||
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#region 读Excel提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
private void ImportXlsToData(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
string oleDBConnString = String.Empty;
|
||||
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
|
||||
oleDBConnString += "Data Source=";
|
||||
oleDBConnString += fileName;
|
||||
oleDBConnString += ";Extended Properties=Excel 8.0;";
|
||||
OleDbConnection oleDBConn = null;
|
||||
OleDbDataAdapter oleAdMaster = null;
|
||||
DataTable m_tableName = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
|
||||
oleDBConn = new OleDbConnection(oleDBConnString);
|
||||
oleDBConn.Open();
|
||||
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
|
||||
|
||||
if (m_tableName != null && m_tableName.Rows.Count > 0)
|
||||
{
|
||||
|
||||
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
|
||||
|
||||
}
|
||||
string sqlMaster;
|
||||
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
|
||||
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
|
||||
oleAdMaster.Fill(ds, "m_tableName");
|
||||
oleAdMaster.Dispose();
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 5);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集行数</param>
|
||||
/// <returns></returns>
|
||||
private bool AddDatasetToSQL(DataTable pds, int Cols)
|
||||
{
|
||||
string result = string.Empty;
|
||||
int ic, ir;
|
||||
ic = pds.Columns.Count;
|
||||
if (ic < Cols)
|
||||
{
|
||||
Alert.ShowInTop("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "行", MessageBoxIcon.Warning);
|
||||
}
|
||||
ir = pds.Rows.Count;
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
var projects = from x in Funs.DB.Base_Project select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string col0 = pds.Rows[i][0].ToString().Trim();
|
||||
string col1 = pds.Rows[i][1].ToString().Trim();
|
||||
if (string.IsNullOrEmpty(col1))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "【姓名】不能为空!" + "|";
|
||||
}
|
||||
string col2 = pds.Rows[i][2].ToString().Trim();
|
||||
if (string.IsNullOrEmpty(col2))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "【身份证号码】不能为空!" + "|";
|
||||
}
|
||||
|
||||
string col3 = pds.Rows[i][3].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(col3))
|
||||
{
|
||||
var getProject = projects.FirstOrDefault(x=>x.ProjectCode ==col3 || x.JTProjectCode == col3);
|
||||
if (getProject == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "【项目编码】[" + col3 + "]错误!|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "【项目编码】不能为空!" + "|";
|
||||
}
|
||||
string col5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(col5))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime inTime = Convert.ToDateTime(col5);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "时间" + "," + "[" + col5 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
result = result.Substring(0, result.LastIndexOf("|"));
|
||||
errorInfos = result;
|
||||
Alert alert = new Alert
|
||||
{
|
||||
Message = result,
|
||||
Target = Target.Self
|
||||
};
|
||||
alert.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.hdFileName.Text))
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请先将错误数据修正,再重新导入保存!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#region Excel提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
private void ImportXlsToData2(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
string oleDBConnString = String.Empty;
|
||||
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
|
||||
oleDBConnString += "Data Source=";
|
||||
oleDBConnString += fileName;
|
||||
oleDBConnString += ";Extended Properties=Excel 8.0;";
|
||||
OleDbConnection oleDBConn = null;
|
||||
OleDbDataAdapter oleAdMaster = null;
|
||||
DataTable m_tableName = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
|
||||
oleDBConn = new OleDbConnection(oleDBConnString);
|
||||
oleDBConn.Open();
|
||||
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
|
||||
|
||||
if (m_tableName != null && m_tableName.Rows.Count > 0)
|
||||
{
|
||||
|
||||
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
|
||||
|
||||
}
|
||||
string sqlMaster;
|
||||
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
|
||||
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
|
||||
oleAdMaster.Fill(ds, "m_tableName");
|
||||
oleAdMaster.Dispose();
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 5);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集列数</param>
|
||||
/// <returns></returns>
|
||||
private bool AddDatasetToSQL2(DataTable pds, int Cols)
|
||||
{
|
||||
int ic, ir;
|
||||
viewLeavePosts.Clear();
|
||||
ic = pds.Columns.Count;
|
||||
if (ic < Cols)
|
||||
{
|
||||
Alert.ShowInTop("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
ir = pds.Rows.Count;
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
var projects = from x in Funs.DB.Base_Project select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
Model.RealName_LeavePost newLeavePost = new Model.RealName_LeavePost
|
||||
{
|
||||
Id = pds.Rows[i][0].ToString().Trim(),
|
||||
PersonName = pds.Rows[i][1].ToString().Trim(),
|
||||
IdentityCard = pds.Rows[i][2].ToString().Trim(),
|
||||
ProjectCode = pds.Rows[i][3].ToString().Trim(),
|
||||
ProjectShortName = pds.Rows[i][4].ToString().Trim(),
|
||||
InTime = Funs.GetNewDateTime(pds.Rows[i][5].ToString().Trim()),
|
||||
OutTime = Funs.GetNewDateTime(pds.Rows[i][6].ToString().Trim())
|
||||
};
|
||||
|
||||
var person =Funs.DB.RealName_LeavePost.FirstOrDefault(x=>x.ProjectCode == newLeavePost.ProjectCode && x.IdentityCard== newLeavePost.IdentityCard);
|
||||
if (person == null)
|
||||
{
|
||||
viewLeavePosts.Add(newLeavePost);
|
||||
}
|
||||
}
|
||||
if (viewLeavePosts.Count > 0)
|
||||
{
|
||||
this.Grid1.Hidden = false;
|
||||
this.Grid1.DataSource = viewLeavePosts;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
int a = viewLeavePosts.Count();
|
||||
var getProjects = from x in Funs.DB.Base_Project select x;
|
||||
for (int i = 0; i < a; i++)
|
||||
{
|
||||
Model.RealName_LeavePost newLeavePost = new Model.RealName_LeavePost
|
||||
{
|
||||
Id = viewLeavePosts[i].Id,
|
||||
PersonName = viewLeavePosts[i].PersonName,
|
||||
IdentityCard = viewLeavePosts[i].IdentityCard,
|
||||
ProjectCode = viewLeavePosts[i].ProjectCode,
|
||||
ProjectShortName = viewLeavePosts[i].ProjectShortName,
|
||||
InTime = viewLeavePosts[i].InTime,
|
||||
OutTime = viewLeavePosts[i].OutTime,
|
||||
};
|
||||
var getProject = getProjects.FirstOrDefault(x => x.ProjectCode == newLeavePost.ProjectCode || x.JTProjectCode == newLeavePost.ProjectCode);
|
||||
if (getProject != null)
|
||||
{
|
||||
newLeavePost.ProjectId = getProject.ProjectId;
|
||||
if (!newLeavePost.OutTime.HasValue)
|
||||
{
|
||||
var getPerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == getProject.ProjectId && x.IdentityCard == newLeavePost.IdentityCard);
|
||||
if (getPerson != null)
|
||||
{
|
||||
if (getPerson.OutTime.HasValue)
|
||||
{
|
||||
if (getPerson.OutTime >= newLeavePost.InTime)
|
||||
{
|
||||
newLeavePost.OutTime = getPerson.OutTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
newLeavePost.OutTime = newLeavePost.InTime.Value.AddDays(1);
|
||||
}
|
||||
}
|
||||
else if (getPerson.IsUsed == false)
|
||||
{
|
||||
newLeavePost.OutTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newLeavePost.OutTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BLL.LeavePostService.AddLeavePost(newLeavePost);
|
||||
}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initFullPath = rootPath + initPath;
|
||||
string filePath = initFullPath + this.hdFileName.Text;
|
||||
if (filePath != string.Empty && System.IO.File.Exists(filePath))
|
||||
{
|
||||
System.IO.File.Delete(filePath);//删除上传的XLS文件
|
||||
}
|
||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请先将错误数据修正,再重新导入保存!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下载模板
|
||||
/// <summary>
|
||||
/// 下载模板按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDownLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载导入模板
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
|
||||
{
|
||||
if (e.EventArgument == "Confirm_OK")
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string filePath = Const.RealName_LeavePostTemplateUrl;
|
||||
string uploadfilepath = rootPath + filePath;
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
FileInfo info = new FileInfo(uploadfilepath);
|
||||
long fileSize = info.Length;
|
||||
Response.ClearContent();
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.ContentType = "excel/plain";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
|
||||
Response.TransmitFile(uploadfilepath, 0, fileSize);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.RealName {
|
||||
|
||||
|
||||
public partial class LeavePostIn {
|
||||
|
||||
/// <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>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnDownLoad 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDownLoad;
|
||||
|
||||
/// <summary>
|
||||
/// fuAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// hdFileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdFileName;
|
||||
|
||||
/// <summary>
|
||||
/// hdCheckResult 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdCheckResult;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Tree>
|
||||
<TreeNode id="858E83E9-ADE5-452E-BD65-82D8DFF872C0" Text="分部、工作项及费用清单设置" NavigateUrl="JDGL/WBS/WBSSetAudit.aspx">
|
||||
<TreeNode id="F3AA42B3-5776-4992-A625-1216C579FEDE" Text="项目进度情况" NavigateUrl="JDGL/Check/ProgressCompletion.aspx">
|
||||
</TreeNode>
|
||||
<TreeNode id="E3905BF1-289B-4500-BD34-36F97D649AFC" Text="工作量录入" NavigateUrl="JDGL/WBS/WorkloadInput.aspx"></TreeNode>
|
||||
<TreeNode id="2A3F8526-95C7-4D30-B2DD-DD26696BE150" Text="工作量统计" NavigateUrl="JDGL/WBS/WorkloadStatistics.aspx"></TreeNode>
|
||||
<TreeNode id="59AAE0F0-2DB6-4065-B304-7E2C56EC3E5D" Text="赢得值曲线" NavigateUrl="JDGL/CostAnalysis/EarnedValueCurve.aspx"></TreeNode>
|
||||
<TreeNode id="2AE9D982-A499-497F-8F54-ADDA5856887E" Text="工程量完成情况" NavigateUrl="JDGL/Check/QuantityCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="82E513B9-1A6F-495A-A633-EBC89CE5273A" Text="低温储罐完成情况" NavigateUrl="JDGL/Check/LowTankCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="4ACA0647-4D44-462E-8277-1EF9F100566A" Text="钢结构完成情况" NavigateUrl="JDGL/Check/SteelStructureCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="92FD1845-F56C-4111-8BA0-91838A18B750" Text="设备完成情况" NavigateUrl="JDGL/Check/EquipmentCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="9AE07A76-3A54-4414-BC8C-C86A18C737BA" Text="管道完成情况" NavigateUrl="JDGL/Check/PipelineCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="8A8A1050-F227-42ED-9456-8CB5ECA36512" Text="电气完成情况" NavigateUrl="JDGL/Check/ElectricalCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="7EC1FBAF-BEC9-46CD-9E3B-0D0093B4E1C2" Text="仪表完成情况" NavigateUrl="JDGL/Check/MeterCompletion.aspx"></TreeNode>
|
||||
<TreeNode id="C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B" Text="全厂地下管网完成情况" NavigateUrl="JDGL/Check/UndergroundPipeCompletion.aspx"></TreeNode>
|
||||
</Tree>
|
||||
@@ -51,5 +51,6 @@
|
||||
<TreeNode id="D78C6E54-4240-4E82-B9B5-8ED76CF62981" Text="劳务实名制对接" NavigateUrl=""><TreeNode id="1E451E0C-A125-4117-B8AC-14E74011B52B" Text="同步设置" NavigateUrl="ZHGL/RealName/SynchroSet.aspx"></TreeNode>
|
||||
<TreeNode id="C0B52610-ED93-4881-AC61-1764C243F84A" Text="基础数据" NavigateUrl="ZHGL/RealName/BasicData.aspx"></TreeNode>
|
||||
<TreeNode id="F36E6C54-E39F-4032-874D-548EE090A35B" Text="同步记录" NavigateUrl="ZHGL/RealName/SynchroRecord.aspx"></TreeNode>
|
||||
<TreeNode id="4882C5F0-9D49-4B2E-BA30-E806D3CDF6FA" Text="离岗人员修正" NavigateUrl="ZHGL/RealName/LeavePost.aspx"></TreeNode>
|
||||
</TreeNode>
|
||||
</Tree>
|
||||
Reference in New Issue
Block a user