From 6533db1bfc19f04f82b06f44799242d339c59e35 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Sun, 9 Oct 2022 10:41:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?20221009=E9=83=A8=E9=97=A8=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=BD=93=E5=89=8D=E9=A1=B9=E7=9B=AE=E5=8F=96=E5=80=BC?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E5=B7=A5=E4=BD=9C=E7=BB=8F=E5=8E=86=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=A8=E8=81=8C=E7=A6=BB=E8=81=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/DropListService.cs | 4 +- SGGL/BLL/Person/Person_PersonsService.cs | 46 ++++++++++++++++++-- SGGL/FineUIPro.Web/Person/DepartPerson.aspx | 4 +- SGGL/FineUIPro.Web/Person/PersonLib.aspx | 2 +- SGGL/FineUIPro.Web/Person/ProjectPerson.aspx | 2 +- SGGL/FineUIPro.Web/common/PageBase.cs | 24 ++++++++++ 6 files changed, 73 insertions(+), 9 deletions(-) diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs index 58e2f0dc..6911bff9 100644 --- a/SGGL/BLL/DropListService.cs +++ b/SGGL/BLL/DropListService.cs @@ -138,8 +138,8 @@ public static ListItem[] IsPostDropList() { ListItem[] lis = new ListItem[2]; - lis[0] = new ListItem("在岗", BLL.Const._True); - lis[1] = new ListItem("离岗", BLL.Const._False); + lis[0] = new ListItem("在职", BLL.Const._True); + lis[1] = new ListItem("离职", BLL.Const._False); return lis; } #endregion diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index d042a35c..5d1e45ca 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -112,9 +112,9 @@ namespace BLL x.RoleIds, RoleName = RoleService.getRoleNamesRoleIds(x.RoleIds), x.CurrentProjectId, - CurrentProjectName = db.Base_Project.First(u => u.ProjectId == x.CurrentProjectId).ShortName, + CurrentProjectName = getCurrentProjectName(x.PersonId), x.CurrentProjectWorkPostId, - CurrentProjectWorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(x.CurrentProjectWorkPostId), + CurrentProjectWorkPostName = getCurrentProjectWorkPostName(x.PersonId), IsPost = x.IsPost ?? true, x.SignatureUrl, x.Address, @@ -139,7 +139,47 @@ namespace BLL }; } #endregion - + + #region 获取当前项目及岗位 + /// + /// + /// + /// + /// + /// + public static string getCurrentProjectName(string PersonId) + { + var getItem = Funs.DB.SitePerson_PersonItem.FirstOrDefault(u => u.PersonId == PersonId && !u.OutTime.HasValue); + if (getItem != null) + { + return ProjectService.GetShortNameByProjectId(getItem.ProjectId); + } + else + { + return null; + } + } + + /// + /// + /// + /// + /// + /// + public static string getCurrentProjectWorkPostName( string PersonId) + { + var getItem = Funs.DB.SitePerson_PersonItem.FirstOrDefault(u => u.PersonId == PersonId && !u.OutTime.HasValue); + if (getItem != null) + { + return WorkPostService.getWorkPostNamesWorkPostIds(getItem.WorkPostId); + } + else + { + return null; + } + } + #endregion + #region 根据主键获取人员信息 /// /// 根据主键获取人员信息 diff --git a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx index 2cd9fee5..426a1ffa 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx +++ b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx @@ -95,9 +95,9 @@ - + - + - + diff --git a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx index 1dfbca62..2df3936c 100644 --- a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx +++ b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx @@ -50,7 +50,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs index df1a876c..ac41d93a 100644 --- a/SGGL/FineUIPro.Web/common/PageBase.cs +++ b/SGGL/FineUIPro.Web/common/PageBase.cs @@ -786,6 +786,30 @@ namespace FineUIPro.Web } #endregion + #region 获取是否字面值,在 ASPX 中调用 + /// + /// + /// + /// + /// + protected string GetIsPost(object bitValue) + { + string value = string.Empty; + if (bitValue != null) + { + if (bitValue.ToString() == "1" || Convert.ToBoolean(bitValue.ToString())) + { + value = "在职"; + } + else + { + value = "离职"; + } + } + return value; + } + #endregion + #region 获取项目状态的字面值,在 ASPX 中调用 /// /// 获取项目状态的字面值,在 ASPX 中调用 From c9f78bfbaa31df2d7825ce42dd853c5908196f14 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Sun, 9 Oct 2022 12:09:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?20221009=E5=88=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=86=85=E5=AE=B9=E5=90=8E=E9=A1=B5=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=8D=E5=88=B7=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/FineUIPro.Web/Person/DepartPerson.aspx | 2 +- .../FineUIPro.Web/Person/DepartPerson.aspx.cs | 26 +++++++++++++++++++ SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs | 2 +- SGGL/FineUIPro.Web/Person/ProjectPerson.aspx | 2 +- .../Person/ProjectPerson.aspx.cs | 5 ++++ .../Person/ProjectPersonEdit.aspx.cs | 2 +- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx index 426a1ffa..f996ce72 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx +++ b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx @@ -175,7 +175,7 @@ + //public int? PageSize + //{ + // get + // { + // return (int?)ViewState["PageSize"]; + // } + // set + // { + // ViewState["PageSize"] = value; + // } + //} + /// /// 加载页面 /// @@ -93,6 +108,10 @@ namespace FineUIPro.Web.Person protected void btSearch_Click(object sender, EventArgs e) { this.BindGrid(); + //if (this.PageSize.HasValue) + //{ + // this.ddlPageSize.SelectedValue = this.PageSize.ToString(); + //} } #endregion @@ -132,6 +151,7 @@ namespace FineUIPro.Web.Person /// protected void btnMenuDelete_Click(object sender, EventArgs e) { + // this.PageSize = this.Grid1.PageIndex; this.DeleteData(); } @@ -214,6 +234,7 @@ namespace FineUIPro.Web.Person /// private void EditData() { + //this.PageSize = this.Grid1.PageIndex; if (Grid1.SelectedRowIndexArray.Length == 0) { Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning); @@ -276,5 +297,10 @@ namespace FineUIPro.Web.Person Response.End(); } #endregion + + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs index 4e0ec9dc..e4ccea2a 100644 --- a/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs @@ -566,7 +566,7 @@ namespace FineUIPro.Web.Person LogService.AddSys_Log(this.CurrUser, newPerson.PersonName, newPerson.PersonId, BLL.Const.PersonLibMenuId, BLL.Const.BtnAdd); } Alert.ShowInParent("保存成功!", MessageBoxIcon.Success); - PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { diff --git a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx index 2df3936c..7aa6aab7 100644 --- a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx +++ b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx @@ -138,7 +138,7 @@