人员考试

This commit is contained in:
李超 2023-02-23 18:49:20 +08:00
parent d3116638f6
commit 8eca8fb237
14 changed files with 1537 additions and 76 deletions

View File

@ -2315,6 +2315,11 @@ namespace BLL
/// 人员信息
/// </summary>
public const string PersonListMenuId = "AD6FC259-CF40-41C7-BA3F-15AC50C1DD20";
/// <summary>
/// 人员请假信息
/// </summary>
public const string PersonAskForLeaveListMenuId = "1D9BC5A9-6CFF-4C38-BA69-D48BFAE6DDB3";
/// <summary>
/// 人员项目转换
/// </summary>

View File

@ -1694,3 +1694,24 @@ IP地址:::1
出错时间:02/14/2023 15:08:41
错误信息开始=====>
错误类型:HttpCompileException
错误信息:d:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\SitePerson\PersonAskForLeaveList.aspx(42): error CS1061: “ASP.hsse_siteperson_personaskforleavelist_aspx”不包含“btSearch_Click”的定义并且找不到可接受类型为“ASP.hsse_siteperson_personaskforleavelist_aspx”的第一个参数的扩展方法“btSearch_Click”(是否缺少 using 指令或程序集引用?)
错误堆栈:
在 System.Web.Compilation.BuildManager.CompileWebFile(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)
出错时间:02/23/2023 10:40:22
出错文件:http://localhost:8119/HSSE/SitePerson/PersonAskForLeaveList.aspx
IP地址:::1
出错时间:02/23/2023 10:40:22

View File

@ -1150,10 +1150,12 @@
<Content Include="HSSE\SitePerson\MonthReportEdit.aspx" />
<Content Include="HSSE\SitePerson\MonthReportIn.aspx" />
<Content Include="HSSE\SitePerson\MonthReportView.aspx" />
<Content Include="HSSE\SitePerson\PersonAskForLeaveList.aspx" />
<Content Include="HSSE\SitePerson\PersonAutoDetail.aspx" />
<Content Include="HSSE\SitePerson\PersonIn.aspx" />
<Content Include="HSSE\SitePerson\PersonInfo.aspx" />
<Content Include="HSSE\SitePerson\PersonInfoClock.aspx" />
<Content Include="HSSE\SitePerson\PersonAskForLeaveEdit.aspx" />
<Content Include="HSSE\SitePerson\PersonInfoEdit.aspx" />
<Content Include="HSSE\SitePerson\PersonInfoIn.aspx" />
<Content Include="HSSE\SitePerson\PersonList.aspx" />
@ -12402,6 +12404,13 @@
<Compile Include="HSSE\SitePerson\MonthReportView.aspx.designer.cs">
<DependentUpon>MonthReportView.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\SitePerson\PersonAskForLeaveList.aspx.cs">
<DependentUpon>PersonAskForLeaveList.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\SitePerson\PersonAskForLeaveList.aspx.designer.cs">
<DependentUpon>PersonAskForLeaveList.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\SitePerson\PersonAutoDetail.aspx.cs">
<DependentUpon>PersonAutoDetail.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -12430,6 +12439,13 @@
<Compile Include="HSSE\SitePerson\PersonInfoClock.aspx.designer.cs">
<DependentUpon>PersonInfoClock.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\SitePerson\PersonAskForLeaveEdit.aspx.cs">
<DependentUpon>PersonAskForLeaveEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\SitePerson\PersonAskForLeaveEdit.aspx.designer.cs">
<DependentUpon>PersonAskForLeaveEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\SitePerson\PersonInfoEdit.aspx.cs">
<DependentUpon>PersonInfoEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -0,0 +1,108 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonAskForLeaveEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.PersonAskForLeaveEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownBox runat="server" ID="drpPersonId" Label="人员姓名" EmptyText="请从下拉表格中选择" ShowRedStar="true"
EnableMultiSelect="false" MatchFieldWidth="false" Values="105,108" AutoPostBack="true" OnTextChanged="drpPersonId_TextChanged">
<PopPanel>
<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" >
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items>
<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="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>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker ID="dpDateA" runat="server" DateFormatString="yyyy-MM-dd HH:mm" Label="开始时间" ShowRedStar="true" Required="true" ShowTime="true">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker ID="dpDateZ" runat="server" DateFormatString="yyyy-MM-dd HH:mm" Label="结束时间" ShowRedStar="true" Required="true" ShowTime="true">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtReason" runat="server" MaxLength="100" LabelAlign="Right" Label="原由">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" MaxLength="100" LabelAlign="Right" Label="备注">
</f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,228 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.HSSE.SitePerson
{
public partial class PersonAskForLeaveEdit : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string LeaveId
{
get
{
return (string)ViewState["LeaveId"];
}
set
{
ViewState["LeaveId"] = value;
}
}
public string UnitId
{
get
{
return (string)ViewState["UnitId"];
}
set
{
ViewState["UnitId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
///区域下拉框
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);
LeaveId = Request.Params["LeaveId"];
if (!string.IsNullOrEmpty(LeaveId))
{
var getData = Funs.DB.SitePerson_AskForLeave.FirstOrDefault(x=>x.LeaveId== LeaveId);
if (getData != null)
{
if (!string.IsNullOrEmpty(getData.PersonId))
{
BindGrid(getData.PersonId);
this.drpPersonId.Value = getData.PersonId;
}
this.txtRemark.Text = getData.Remark;
this.txtReason.Text = getData.Reason;
this.dpDateA.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getData.DateA);
this.dpDateZ.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getData.DateZ);
}
}
else
{
this.dpDateA.Text = string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now);
this.dpDateZ.Text = string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now);
}
}
}
#endregion
#region DropDownList下拉选择事件
/// <summary>
/// 人员下拉框选择
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpPersonId_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.drpPersonId.Value))
{
var person = BLL.PersonService.GetPersonById(this.drpPersonId.Value);
if (person != null)
{
UnitId = person.UnitId;
}
}
}
#endregion
#region
/// <summary>
/// 下拉框查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid(string.Empty);
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid(string personId)
{
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 IsUsed =1 AND (OutTime IS NULL OR OutTime > GETDATE()) AND ProjectId='" + this.CurrUser.LoginProjectId + "'";
List<SqlParameter> listStr = new List<SqlParameter>();
//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.UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
{
strSql += " AND Person.PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
{
strSql += " AND Person.IdentityCard LIKE @IdentityCard";
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(personId))
{
strSql += " AND Person.PersonId = @PersonId";
listStr.Add(new SqlParameter("@PersonId", personId));
}
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();
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.drpPersonId.Value))
{
ShowNotify("请选择人员!", MessageBoxIcon.Warning);
return;
}
Model.SitePerson_AskForLeave newPersonInfo = null;
if (!string.IsNullOrEmpty(LeaveId))
{
newPersonInfo = Funs.DB.SitePerson_AskForLeave.FirstOrDefault(x => x.LeaveId == LeaveId);
}
else
{
newPersonInfo = new Model.SitePerson_AskForLeave
{
PersonId = this.drpPersonId.Value,
ProjectId = this.CurrUser.LoginProjectId,
Reason = this.txtReason.Text.Trim(),
Remark = this.txtRemark.Text.Trim()
};
}
var person = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.PersonId == this.drpPersonId.Value);
if (person != null)
{
newPersonInfo.UnitId = person.UnitId;
newPersonInfo.PersonName = person.PersonName;
}
newPersonInfo.DateA = Funs.GetNewDateTimeOrNow(dpDateA.Text + ":00");
newPersonInfo.DateZ = Funs.GetNewDateTimeOrNow(dpDateZ.Text + ":00");
newPersonInfo.Reason= this.txtReason.Text.Trim();
newPersonInfo.Remark= this.txtRemark.Text.Trim();
newPersonInfo.CreateMan = this.CurrUser.UserId;
newPersonInfo.CreateDate = DateTime.Now;
if (string.IsNullOrEmpty(LeaveId))
{
newPersonInfo.LeaveId = Guid.NewGuid().ToString();
Funs.DB.SitePerson_AskForLeave.InsertOnSubmit(newPersonInfo);
}
Funs.DB.SubmitChanges();
BLL.LogService.AddSys_Log(this.CurrUser, newPersonInfo.PersonId, newPersonInfo.PersonId, BLL.Const.PersonAskForLeaveListMenuId, BLL.Const.BtnDelete);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
}
}

View File

@ -0,0 +1,161 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.SitePerson
{
public partial class PersonAskForLeaveEdit
{
/// <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>
/// drpPersonId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox drpPersonId;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// txtPersonName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPersonName;
/// <summary>
/// txtIdentityCard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtIdentityCard;
/// <summary>
/// dpDateA 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker dpDateA;
/// <summary>
/// dpDateZ 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker dpDateZ;
/// <summary>
/// txtReason 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtReason;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}

View File

@ -0,0 +1,116 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonAskForLeaveList.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.PersonAskForLeaveList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>人员信息</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.f-grid-row.Red {
background-color: red;
}
.LabelColor {
color: Red;
font-size: small;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="请假信息"
TitleToolTip="请假信息" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="请假信息" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="LeaveId" DataIDField="LeaveId" AllowSorting="true" SortField="DateA" SortDirection="DESC"
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" EnableColumnLines="true" ForceFit="true"
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
EnableTextSelection="True" >
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Left" runat="server">
<Items>
<f:TextBox runat="server" Label="姓名" ID="txtPersonName" EmptyText="输入查询条件"
Width="200px" LabelWidth="70px" LabelAlign="right">
</f:TextBox>
<f:DropDownList ID="drpUnit" runat="server" Label="单位" EnableEdit="true"
Width="300px" LabelWidth="50px" LabelAlign="right" ForceSelection="false" >
</f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btSearch" ToolTip="查询" Icon="SystemSearch" runat="server" OnClick="btnSearch_Click"></f:Button>
<f:Button ID="btnNew" ToolTip="增加" Icon="Add" runat="server" Hidden="true" OnClick="btnNew_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="90px" ColumnID="PersonName" DataField="PersonName" SortField="PersonName"
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
TextAlign="Center">
</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="Reason" DataField="Reason" SortField="Reason"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="200px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="DateA" DataField="DateA" SortField="DateA"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm" HeaderText="入场时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="DateZ" DataField="DateZ" SortField="DateZ"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm" HeaderText="入场时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField HeaderText="备注" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
</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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</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="1000px" Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="修改" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Icon="Delete" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,328 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.HSSE.SitePerson
{
public partial class PersonAskForLeaveList : PageBase
{
#region
/// <summary>
/// 人员主键
/// </summary>
public string PersonId
{
get
{
return (string)ViewState["PersonId"];
}
set
{
ViewState["PersonId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true);
////权限按钮方法
this.GetButtonPower();
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string unitId = string.Empty;
string projectId = string.Empty;
string strSql = "select a.*,b.UnitName from SitePerson_AskForLeave a left join Base_unit b on a.UnitId = b.UnitId Where a.ProjectId = @ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)
};
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
{
strSql += " AND a.PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != BLL.Const._Null)
{
strSql += " AND a.UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue));
}
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();
}
}
#endregion
#region
/// <summary>
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <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();
}
#endregion
#region
/// <summary>
/// 增加按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonAskForLeaveEdit.aspx")));
}
#endregion
#region
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
this.PersonId = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonAskForLeaveEdit.aspx?LeaveId={0} ", this.PersonId, "编辑 - ")));
}
/// <summary>
/// Grid双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
#endregion
#region
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
string id = Grid1.SelectedRowID.Split(',')[0];
if (!string.IsNullOrEmpty(id))
{
var askForLeave = Funs.DB.SitePerson_AskForLeave.FirstOrDefault(x => x.LeaveId == id);
if (askForLeave != null)
{
Funs.DB.SitePerson_AskForLeave.DeleteOnSubmit(askForLeave);
Funs.DB.SubmitChanges();
BindGrid();
}
}
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 判断按钮权限
/// </summary>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PersonAskForLeaveListMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
}
}
#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) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
//this.Grid1.PageSize = this.;
BindGrid();
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\"/>");
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;
}
if (column.ColumnID == "tfI")
{
html = (row.FindControl("lbI") as AspNet.Label).Text;
}
//sb.AppendFormat("<td>{0}</td>", html);
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{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 btnSearch_Click(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
}
}

View File

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.SitePerson
{
public partial class PersonAskForLeaveList
{
/// <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>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtPersonName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPersonName;
/// <summary>
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btSearch;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <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>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <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;
}
}

View File

@ -328,6 +328,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
#region
/// <summary>
/// 保存按钮

View File

@ -8,8 +8,6 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
using Model;
using FineUIPro.Web.BaseInfo;
namespace FineUIPro.Web.ProjectData
{
@ -314,72 +312,45 @@ namespace FineUIPro.Web.ProjectData
{
string id = this.trProjects.SelectedNode.NodeID;
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
if (installation != null)
if (installation.SuperInstallationId == "0") //删除一级装置
{
ShowNotify("已关联项目无法删除!", MessageBoxIcon.Warning);
return;
if (installation.InstallationName == "总图")
{
DeleteZTData(installation.InstallationId);
}
else
{
BLL.Project_InstallationService.DeleteInstallation(id);
var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
foreach (var installation2 in installation2s)
{
BLL.Project_InstallationService.DeleteInstallation(installation2.InstallationId);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation2.InstallationId select x;
foreach (var installation3 in installation3s)
{
DeleteData(installation3.InstallationId);
}
}
}
}
var cnProfession = Funs.DB.WBS_CnProfession.FirstOrDefault(x => x.InstallationId == id);
if (cnProfession != null)
else
{
ShowNotify("已关联专业无法删除!", MessageBoxIcon.Warning);
return;
Model.Project_Installation installation2 = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
Model.Project_Installation installation1 = BLL.Project_InstallationService.GetInstallationByInstallationId(installation2.SuperInstallationId);
if (installation1.SuperInstallationId == "0") //删除二级装置
{
BLL.Project_InstallationService.DeleteInstallation(id);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
foreach (var installation3 in installation3s)
{
DeleteData(installation3.InstallationId);
}
}
else //删除二级装置
{
DeleteData(id);
}
}
var unitWorks = (from x in Funs.DB.WBS_UnitWork where x.InstallationId == id select x).ToList();
if (unitWorks != null)
{
ShowNotify("已关联单位工程无法删除!", MessageBoxIcon.Warning);
return;
}
var workArea = (from x in Funs.DB.ProjectData_WorkArea where x.InstallationId == id select x).ToList();
if (workArea != null)
{
ShowNotify("已关联施工区域无法删除!", MessageBoxIcon.Warning);
return;
}
//if (installation.SuperInstallationId == "0") //删除一级装置
//{
// if (installation.InstallationName == "总图")
// {
// DeleteZTData(installation.InstallationId);
// }
// else
// {
// BLL.Project_InstallationService.DeleteInstallation(id);
// var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
// foreach (var installation2 in installation2s)
// {
// BLL.Project_InstallationService.DeleteInstallation(installation2.InstallationId);
// var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation2.InstallationId select x;
// foreach (var installation3 in installation3s)
// {
// DeleteData(installation3.InstallationId);
// }
// }
// }
//}
//else
//{
// Model.Project_Installation installation2 = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
// Model.Project_Installation installation1 = BLL.Project_InstallationService.GetInstallationByInstallationId(installation2.SuperInstallationId);
// if (installation1.SuperInstallationId == "0") //删除二级装置
// {
// BLL.Project_InstallationService.DeleteInstallation(id);
// var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
// foreach (var installation3 in installation3s)
// {
// DeleteData(installation3.InstallationId);
// }
// }
// else //删除二级装置
// {
// DeleteData(id);
// }
//}
BLL.Project_InstallationService.DeleteInstallation(id);
ShowNotify("删除成功!", MessageBoxIcon.Success);
InitTreeMenu();
}
@ -411,13 +382,6 @@ namespace FineUIPro.Web.ProjectData
BLL.WbsDetailService.DeleteWbsDetailByToWbs(wbsSet.WbsSetId); //删除进度记录
BLL.WbsSetService.DeleteWbsSet(wbsSet.WbsSetId);
}
var unitWorks = (from x in Funs.DB.WBS_UnitWork where x.InstallationId == installationId select x).ToList();
foreach (var unitWork in unitWorks)
{
BLL.BreakdownProjectService.DeleteAllBreakdownByUnitWorkId(unitWork.UnitWorkId);
BLL.DivisionProjectService.DeleteDivisionProjectByUnitWorkId(unitWork.UnitWorkId);
BLL.UnitWorkService.DeleteUnitWorkById(unitWork.UnitWorkId);
}
//删除单位工程及子单位工程
var unitProjects = from x in Funs.DB.Wbs_UnitProject join y in Funs.DB.WBS_CnProfession on x.CnProfessionId equals y.CnProfessionId where y.InstallationId == installationId && x.CnProfessionId != null select x;

View File

@ -23,8 +23,7 @@
<TreeNode id="874B4232-E0AD-41CD-8C66-8A7FF2D79358" Text="项目安全协议清单" NavigateUrl="HSSE/QualityAudit/ProjectRecord.aspx"></TreeNode>
</TreeNode>
</TreeNode>
<TreeNode id="EE260447-028F-46AF-8864-9A5DC9DAA5BD" Text="人员培训" NavigateUrl=""><TreeNode id="AD6FC259-CF40-41C7-BA3F-15AC50C1DD20" Text="人员信息档案" NavigateUrl="HSSE/SitePerson/PersonList.aspx"></TreeNode>
<TreeNode id="1182E353-FAB9-4DB1-A1EC-F41A00892128" Text="培训记录" NavigateUrl="HSSE/EduTrain/TrainRecord.aspx"></TreeNode>
<TreeNode id="EE260447-028F-46AF-8864-9A5DC9DAA5BD" Text="人员培训" NavigateUrl=""><TreeNode id="1182E353-FAB9-4DB1-A1EC-F41A00892128" Text="培训记录" NavigateUrl="HSSE/EduTrain/TrainRecord.aspx"></TreeNode>
<TreeNode id="F81E3F54-B3A9-4DDB-9C8C-1574317E040F" Text="人员培训查询" NavigateUrl="HSSE/EduTrain/TrainFind.aspx"></TreeNode>
<TreeNode id="B782A26B-D85C-4F84-8B45-F7AA47B3159E" Text="培训计划" NavigateUrl="HSSE/EduTrain/Plan.aspx"></TreeNode>
<TreeNode id="E108F75D-89D0-4DCA-8356-A156C328805C" Text="培训任务" NavigateUrl="HSSE/EduTrain/Task.aspx"></TreeNode>
@ -32,6 +31,8 @@
<TreeNode id="FAF7F4A4-A4BC-4D94-9E88-0CF5A380DB34" Text="考试计划" NavigateUrl="HSSE/EduTrain/TestPlan.aspx"></TreeNode>
<TreeNode id="0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A" Text="考试记录" NavigateUrl="HSSE/EduTrain/TestRecord.aspx"></TreeNode>
<TreeNode id="6FF941C1-8A00-4A74-8111-C892FC30A8DA" Text="考试统计" NavigateUrl="HSSE/EduTrain/TestStatistics.aspx"></TreeNode>
<TreeNode id="1D9BC5A9-6CFF-4C38-BA69-D48BFAE6DDB3" Text="人员请假" NavigateUrl="HSSE/SitePerson/PersonAskForLeaveList.aspx"></TreeNode>
<TreeNode id="AD6FC259-CF40-41C7-BA3F-15AC50C1DD20" Text="人员信息档案" NavigateUrl="HSSE/SitePerson/PersonList.aspx"></TreeNode>
<TreeNode id="8F15D3BE-BE21-4A6F-AD5C-2BBECEE46149" Text="人工时日报" NavigateUrl="HSSE/SitePerson/DayReport.aspx"></TreeNode>
<TreeNode id="6C97E014-AF13-46E5-ADB2-03D327C560EC" Text="人工时月报" NavigateUrl="HSSE/SitePerson/MonthReport.aspx"></TreeNode>
<TreeNode id="7ACB0CB1-15D8-4E8E-A54D-0CDC5F69B39A" Text="发卡管理" NavigateUrl="HSSE/SitePerson/SendCard.aspx"></TreeNode>

View File

@ -1823,6 +1823,9 @@ namespace Model
partial void InsertSeDin_MonthReportFlowOperate(SeDin_MonthReportFlowOperate instance);
partial void UpdateSeDin_MonthReportFlowOperate(SeDin_MonthReportFlowOperate instance);
partial void DeleteSeDin_MonthReportFlowOperate(SeDin_MonthReportFlowOperate instance);
partial void InsertSitePerson_AskForLeave(SitePerson_AskForLeave instance);
partial void UpdateSitePerson_AskForLeave(SitePerson_AskForLeave instance);
partial void DeleteSitePerson_AskForLeave(SitePerson_AskForLeave instance);
partial void InsertSitePerson_Checking(SitePerson_Checking instance);
partial void UpdateSitePerson_Checking(SitePerson_Checking instance);
partial void DeleteSitePerson_Checking(SitePerson_Checking instance);
@ -7110,6 +7113,14 @@ namespace Model
}
}
public System.Data.Linq.Table<SitePerson_AskForLeave> SitePerson_AskForLeave
{
get
{
return this.GetTable<SitePerson_AskForLeave>();
}
}
public System.Data.Linq.Table<SitePerson_Checking> SitePerson_Checking
{
get
@ -289395,6 +289406,308 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SitePerson_AskForLeave")]
public partial class SitePerson_AskForLeave : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _LeaveId;
private string _PersonId;
private string _PersonName;
private string _UnitId;
private string _ProjectId;
private string _Reason;
private System.Nullable<System.DateTime> _DateA;
private System.Nullable<System.DateTime> _DateZ;
private System.Nullable<System.DateTime> _CreateDate;
private string _CreateMan;
private string _Remark;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnLeaveIdChanging(string value);
partial void OnLeaveIdChanged();
partial void OnPersonIdChanging(string value);
partial void OnPersonIdChanged();
partial void OnPersonNameChanging(string value);
partial void OnPersonNameChanged();
partial void OnUnitIdChanging(string value);
partial void OnUnitIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnReasonChanging(string value);
partial void OnReasonChanged();
partial void OnDateAChanging(System.Nullable<System.DateTime> value);
partial void OnDateAChanged();
partial void OnDateZChanging(System.Nullable<System.DateTime> value);
partial void OnDateZChanged();
partial void OnCreateDateChanging(System.Nullable<System.DateTime> value);
partial void OnCreateDateChanged();
partial void OnCreateManChanging(string value);
partial void OnCreateManChanged();
partial void OnRemarkChanging(string value);
partial void OnRemarkChanged();
#endregion
public SitePerson_AskForLeave()
{
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LeaveId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string LeaveId
{
get
{
return this._LeaveId;
}
set
{
if ((this._LeaveId != value))
{
this.OnLeaveIdChanging(value);
this.SendPropertyChanging();
this._LeaveId = value;
this.SendPropertyChanged("LeaveId");
this.OnLeaveIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonId", DbType="NVarChar(50)")]
public string PersonId
{
get
{
return this._PersonId;
}
set
{
if ((this._PersonId != value))
{
this.OnPersonIdChanging(value);
this.SendPropertyChanging();
this._PersonId = value;
this.SendPropertyChanged("PersonId");
this.OnPersonIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonName", DbType="NVarChar(50)")]
public string PersonName
{
get
{
return this._PersonName;
}
set
{
if ((this._PersonName != value))
{
this.OnPersonNameChanging(value);
this.SendPropertyChanging();
this._PersonName = value;
this.SendPropertyChanged("PersonName");
this.OnPersonNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
public string UnitId
{
get
{
return this._UnitId;
}
set
{
if ((this._UnitId != value))
{
this.OnUnitIdChanging(value);
this.SendPropertyChanging();
this._UnitId = value;
this.SendPropertyChanged("UnitId");
this.OnUnitIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Reason", DbType="NVarChar(500)")]
public string Reason
{
get
{
return this._Reason;
}
set
{
if ((this._Reason != value))
{
this.OnReasonChanging(value);
this.SendPropertyChanging();
this._Reason = value;
this.SendPropertyChanged("Reason");
this.OnReasonChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateA", DbType="DateTime")]
public System.Nullable<System.DateTime> DateA
{
get
{
return this._DateA;
}
set
{
if ((this._DateA != value))
{
this.OnDateAChanging(value);
this.SendPropertyChanging();
this._DateA = value;
this.SendPropertyChanged("DateA");
this.OnDateAChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateZ", DbType="DateTime")]
public System.Nullable<System.DateTime> DateZ
{
get
{
return this._DateZ;
}
set
{
if ((this._DateZ != value))
{
this.OnDateZChanging(value);
this.SendPropertyChanging();
this._DateZ = value;
this.SendPropertyChanged("DateZ");
this.OnDateZChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateDate", DbType="DateTime")]
public System.Nullable<System.DateTime> CreateDate
{
get
{
return this._CreateDate;
}
set
{
if ((this._CreateDate != value))
{
this.OnCreateDateChanging(value);
this.SendPropertyChanging();
this._CreateDate = value;
this.SendPropertyChanged("CreateDate");
this.OnCreateDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateMan", DbType="NVarChar(50)")]
public string CreateMan
{
get
{
return this._CreateMan;
}
set
{
if ((this._CreateMan != value))
{
this.OnCreateManChanging(value);
this.SendPropertyChanging();
this._CreateMan = value;
this.SendPropertyChanged("CreateMan");
this.OnCreateManChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
public string Remark
{
get
{
return this._Remark;
}
set
{
if ((this._Remark != value))
{
this.OnRemarkChanging(value);
this.SendPropertyChanging();
this._Remark = value;
this.SendPropertyChanged("Remark");
this.OnRemarkChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SitePerson_Checking")]
public partial class SitePerson_Checking : INotifyPropertyChanging, INotifyPropertyChanged
{

View File

@ -583,12 +583,30 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in Funs.DB.SitePerson_Person_Bak
DateTime dateTime = DateTime.Now;
if (dateTime != null)
{
if (DateTime.Now.Hour < 12)
{
dateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
dateTime= dateTime.AddHours(10);
}
else
{
dateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
dateTime = dateTime.AddHours(15);
}
}
responeData.data = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId
&& !x.ExchangeTime.HasValue
&& (!x.OutTime.HasValue || x.OutTime > DateTime.Now) && x.InTime.HasValue && x.InTime < DateTime.Now
&& x.IsUsed == true
&& x.InTime.HasValue && x.InTime < DateTime.Now
&& x.IsUsed == 1
&& x.PhotoUrl != null
select new
{
@ -600,6 +618,7 @@ namespace WebAPI.Controllers
y.UnitCode,
y.UnitName,
y.ShortUnitName,
askForLeave = Funs.DB.SitePerson_AskForLeave.FirstOrDefault(z=>z.PersonId==x.PersonId && x.ProjectId==z.ProjectId&&z.DateA<= dateTime && z.DateZ>= dateTime) ==null?true:false,
Funs.DB.ProjectData_TeamGroup.First(z => z.TeamGroupId == x.TeamGroupId).TeamGroupName,
x.Sex,
Funs.DB.Base_WorkPost.First(z => z.WorkPostId == x.WorkPostId).WorkPostName,
@ -610,6 +629,7 @@ namespace WebAPI.Controllers
x.ExchangeTime,
x.ExchangeTime2,
x.PhotoUrl,
x.OutTime
};
}
catch (Exception ex)