diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 362312ab..4a1d0a83 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -2315,6 +2315,11 @@ namespace BLL
/// 人员信息
///
public const string PersonListMenuId = "AD6FC259-CF40-41C7-BA3F-15AC50C1DD20";
+ ///
+ /// 人员请假信息
+ ///
+ public const string PersonAskForLeaveListMenuId = "1D9BC5A9-6CFF-4C38-BA69-D48BFAE6DDB3";
+
///
/// 人员项目转换
///
diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt
index d147d748..76bba262 100644
--- a/SGGL/FineUIPro.Web/ErrLog.txt
+++ b/SGGL/FineUIPro.Web/ErrLog.txt
@@ -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
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index c6bf7486..32768de5 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1150,10 +1150,12 @@
+
+
@@ -12402,6 +12404,13 @@
MonthReportView.aspx
+
+ PersonAskForLeaveList.aspx
+ ASPXCodeBehind
+
+
+ PersonAskForLeaveList.aspx
+
PersonAutoDetail.aspx
ASPXCodeBehind
@@ -12430,6 +12439,13 @@
PersonInfoClock.aspx
+
+ PersonAskForLeaveEdit.aspx
+ ASPXCodeBehind
+
+
+ PersonAskForLeaveEdit.aspx
+
PersonInfoEdit.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx
new file mode 100644
index 00000000..197a393d
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx
@@ -0,0 +1,108 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonAskForLeaveEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.PersonAskForLeaveEdit" %>
+
+
+
+
+
+ 编辑现场考勤人员考勤信息
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.cs
new file mode 100644
index 00000000..02b35d03
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.cs
@@ -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 定义项
+ ///
+ /// 项目主键
+ ///
+ 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 加载
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ 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下拉选择事件
+ ///
+ /// 人员下拉框选择
+ ///
+ ///
+ ///
+ 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 绑定数据
+ ///
+ /// 下拉框查询
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ this.BindGrid(string.Empty);
+ }
+
+ ///
+ /// 绑定数据
+ ///
+ 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 listStr = new List();
+ //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 保存
+ ///
+ /// 保存按钮
+ ///
+ ///
+ ///
+ 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
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.designer.cs
new file mode 100644
index 00000000..9dadba2e
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveEdit.aspx.designer.cs
@@ -0,0 +1,161 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.SitePerson
+{
+
+
+ public partial class PersonAskForLeaveEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// drpPersonId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownBox drpPersonId;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// drpUnit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpUnit;
+
+ ///
+ /// txtPersonName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtPersonName;
+
+ ///
+ /// txtIdentityCard 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtIdentityCard;
+
+ ///
+ /// dpDateA 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker dpDateA;
+
+ ///
+ /// dpDateZ 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker dpDateZ;
+
+ ///
+ /// txtReason 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtReason;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRemark;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx
new file mode 100644
index 00000000..10957bda
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx
@@ -0,0 +1,116 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonAskForLeaveList.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.PersonAskForLeaveList" %>
+
+
+
+
+ 人员信息
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.cs
new file mode 100644
index 00000000..86ab60f7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.cs
@@ -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 定义项
+ ///
+ /// 人员主键
+ ///
+ public string PersonId
+ {
+ get
+ {
+ return (string)ViewState["PersonId"];
+ }
+ set
+ {
+ ViewState["PersonId"] = value;
+ }
+ }
+
+
+ #endregion
+
+ #region 加载页面
+ ///
+ /// 加载页面
+ ///
+ ///
+ ///
+ 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("你确定要删除选中的 行数据吗?", Grid1.GetSelectedCountReference());
+ this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
+ BindGrid();
+ }
+ }
+
+
+ ///
+ /// 绑定数据
+ ///
+ 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 listStr = new List
+ {
+ 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 页索引改变事件
+ ///
+ /// 页索引改变事件
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+ #endregion
+
+ #region 排序
+ ///
+ /// 排序
+ ///
+ ///
+ ///
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+ Grid1.SortDirection = e.SortDirection;
+ Grid1.SortField = e.SortField;
+ BindGrid();
+ }
+ #endregion
+
+ #region 分页选择下拉改变事件
+ ///
+ /// 分页选择下拉改变事件
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+ #endregion
+
+ #region 增加按钮
+ ///
+ /// 增加按钮
+ ///
+ ///
+ ///
+ protected void btnNew_Click(object sender, EventArgs e)
+ {
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonAskForLeaveEdit.aspx")));
+ }
+ #endregion
+
+ #region 编辑
+ ///
+ /// 右键编辑事件
+ ///
+ ///
+ ///
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ this.EditData();
+ }
+
+ ///
+ /// 编辑
+ ///
+ 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, "编辑 - ")));
+
+ }
+
+ ///
+ /// Grid双击事件
+ ///
+ ///
+ ///
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ this.EditData();
+ }
+ #endregion
+
+ #region 删除
+ ///
+ /// 右键删除事件
+ ///
+ ///
+ ///
+ 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 关闭弹出窗口
+ ///
+ /// 关闭弹出窗口
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+ #endregion
+
+ #region 判断按钮权限
+ ///
+ /// 判断按钮权限
+ ///
+ 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 导出按钮
+ /// 导出按钮
+ ///
+ ///
+ ///
+ 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();
+ }
+
+ ///
+ /// 导出方法
+ ///
+ ///
+ ///
+ private string GetGridTableHtml(Grid grid)
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("");
+ sb.Append("");
+ sb.Append("");
+ foreach (GridColumn column in grid.Columns)
+ {
+ sb.AppendFormat("{0} | ", column.HeaderText);
+ }
+ sb.Append("
");
+ foreach (GridRow row in grid.Rows)
+ {
+ sb.Append("");
+ 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("{0} | ", html);
+ sb.AppendFormat("{0} | ", html);
+ }
+
+ sb.Append("
");
+ }
+
+ sb.Append("
");
+
+ return sb.ToString();
+ }
+ #endregion
+
+
+
+ #region 查询
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ protected void btnSearch_Click(object sender, EventArgs e)
+ {
+ this.BindGrid();
+ }
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.designer.cs
new file mode 100644
index 00000000..2c2dce84
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonAskForLeaveList.aspx.designer.cs
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.SitePerson
+{
+
+
+ public partial class PersonAskForLeaveList
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel1;
+
+ ///
+ /// panelCenterRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelCenterRegion;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// txtPersonName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtPersonName;
+
+ ///
+ /// drpUnit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpUnit;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btSearch;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+
+ ///
+ /// btnMenuEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuEdit;
+
+ ///
+ /// btnMenuDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDelete;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
index df7089ab..8e6192c9 100644
--- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
@@ -328,6 +328,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
+
#region 保存
///
/// 保存按钮
diff --git a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs
index 2097a054..05b41163 100644
--- a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs
+++ b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs
@@ -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;
diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
index 46fe15c8..3971c608 100644
--- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
@@ -23,8 +23,7 @@
-
-
+
@@ -32,6 +31,8 @@
+
+
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index e1c5554f..25c45812 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -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
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
public System.Data.Linq.Table 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 _DateA;
+
+ private System.Nullable _DateZ;
+
+ private System.Nullable _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 value);
+ partial void OnDateAChanged();
+ partial void OnDateZChanging(System.Nullable value);
+ partial void OnDateZChanged();
+ partial void OnCreateDateChanging(System.Nullable 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 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 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 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
{
diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs
index 4ab2a709..65be7502 100644
--- a/SGGL/WebAPI/Controllers/PersonController.cs
+++ b/SGGL/WebAPI/Controllers/PersonController.cs
@@ -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)