diff --git a/EProject/BLL/bin/Debug/Newtonsoft.Json.pdb b/EProject/BLL/bin/Debug/Newtonsoft.Json.pdb new file mode 100644 index 0000000..acfc3fe Binary files /dev/null and b/EProject/BLL/bin/Debug/Newtonsoft.Json.pdb differ diff --git a/EProject/BLL/bin/Release/Newtonsoft.Json.pdb b/EProject/BLL/bin/Release/Newtonsoft.Json.pdb new file mode 100644 index 0000000..acfc3fe Binary files /dev/null and b/EProject/BLL/bin/Release/Newtonsoft.Json.pdb differ diff --git a/EProject/FineUIPro.Web/FineUIPro.Web.csproj b/EProject/FineUIPro.Web/FineUIPro.Web.csproj index 4c345a2..ab134bf 100644 --- a/EProject/FineUIPro.Web/FineUIPro.Web.csproj +++ b/EProject/FineUIPro.Web/FineUIPro.Web.csproj @@ -2014,7 +2014,7 @@ - + diff --git a/EProject/FineUIPro.Web/FineUIPro.Web.csproj.user b/EProject/FineUIPro.Web/FineUIPro.Web.csproj.user index 4a14eae..a8f43b7 100644 --- a/EProject/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/EProject/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ ProjectFiles - Debug|Any CPU + Release|Any CPU true true diff --git a/EProject/FineUIPro.Web/Global.asax.cs b/EProject/FineUIPro.Web/Global.asax.cs index 833ef1a..7f3ad4f 100644 --- a/EProject/FineUIPro.Web/Global.asax.cs +++ b/EProject/FineUIPro.Web/Global.asax.cs @@ -330,6 +330,7 @@ #region 1、填写第二张资源时,第一张资源预留一个月的时候填写人工时 2、Cancelled或Hold也预留一个月 /// /// 填写第二张资源时,第一张资源预留一个月的时候填写人工时 + /// MOC和Projects项目 /// /// /// @@ -340,12 +341,16 @@ { foreach (var epr in eprojects) { - var planLists = (from x in Funs.DB.Resource_Plan where x.EProjectId == epr.Key orderby x.CreateDate descending select x).ToList(); + var planLists = (from x in Funs.DB.Resource_Plan + join y in Funs.DB.Editor_EProject on x.EProjectId equals y.EProjectId + where x.EProjectId == epr.Key && (y.ProjectControl_JobType == "Projects" || y.ProjectControl_JobType == "MOC") + orderby x.CreateDate ascending + select new { x.ResourcePlanId, y.PM_MA_ProjectApproval }).ToList(); if (planLists.Count() == 2) { - if (planLists[0].CreateDate.Value.AddMonths(1).ToShortDateString() == DateTime.Now.ToShortDateString()) + if (planLists[0].PM_MA_ProjectApproval.HasValue && planLists[0].PM_MA_ProjectApproval.Value.AddMonths(1) <= DateTime.Now) { - var manHours_Plan = Funs.DB.ManHours_Plan.FirstOrDefault(x => x.ResourcePlanId == planLists[1].ResourcePlanId); + var manHours_Plan = Funs.DB.ManHours_Plan.FirstOrDefault(x => x.ResourcePlanId == planLists[0].ResourcePlanId); if (manHours_Plan != null) { manHours_Plan.AccountDisabled = 1; diff --git a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlan.aspx.cs b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlan.aspx.cs index 39ecb71..d41f8d4 100644 --- a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlan.aspx.cs +++ b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlan.aspx.cs @@ -369,26 +369,35 @@ namespace FineUIPro.Web.ResourcePlan var role = BLL.Sys_RoleService.GetRole(user.RoleId); string projectManager = epro.ProjectControl_ProjectManager; string leadByName = epro.ProjectControl_LeadByName; - // 权限已特殊处理 - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "编辑 - "))); - //if (!string.IsNullOrEmpty(projectManager) && !string.IsNullOrEmpty(leadByName) && epro.ProjectControl_LeadByName.Contains("CTE") && (epro.ProjectControl_ProjectManager == this.CurrUser.UserName || user.DepartId != BLL.Const.CTEM_DepartId)) - //{ - // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); - //} - ////lead by不是CTE的项目,需CTE做设计支持的项目的RP授权给Project Control - //else if (!string.IsNullOrEmpty(leadByName) && !epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName == "PPE") - //{ - // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); - //} - //else if (this.CurrUser.UserId == BLL.Const.GlyId) - //{ - // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); - //} - //else - //{ - // Alert.Show("您不是PM、非CTE/M用户或PPE,不能填报资源", MessageBoxIcon.Warning); - //} + var manHours = (from x in Funs.DB.ManHours_Plan where x.ResourcePlanId == Id select x).FirstOrDefault(); + if (manHours.AccountDisabled == 0) + { + // 权限已特殊处理 + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "编辑 - "))); + + //if (!string.IsNullOrEmpty(projectManager) && !string.IsNullOrEmpty(leadByName) && epro.ProjectControl_LeadByName.Contains("CTE") && (epro.ProjectControl_ProjectManager == this.CurrUser.UserName || user.DepartId != BLL.Const.CTEM_DepartId)) + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); + //} + ////lead by不是CTE的项目,需CTE做设计支持的项目的RP授权给Project Control + //else if (!string.IsNullOrEmpty(leadByName) && !epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName == "PPE") + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); + //} + //else if (this.CurrUser.UserId == BLL.Const.GlyId) + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&&eProjectId={1}", Id, eProjectId, "新增 - "))); + //} + //else + //{ + // Alert.Show("您不是PM、非CTE/M用户或PPE,不能填报资源", MessageBoxIcon.Warning); + //} + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanView.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); + } } } } @@ -426,45 +435,53 @@ namespace FineUIPro.Web.ResourcePlan object[] keys = Grid2.DataKeys[e.RowIndex]; string eProjectId = keys[1].ToString(); - //var epro = BLL.EProjectService.GeteProjectById(eProjectId); - //if (epro != null) - //{ - // var user = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); - // if (user != null) - // { - //if (!string.IsNullOrEmpty(user.RoleId)) - //{ - //var role = BLL.Sys_RoleService.GetRole(user.RoleId); - //if (role != null) - //{ - //if (epro.ProjectControl_LeadByName.Contains("CTE") && user.DepartId == BLL.Const.CTEM_DepartId) - //{ - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); - //} - //else if (epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName != "PM") - //{ - // ShowAlert("您不是PM,不能填报Lead by是CTE的项目资源", MessageBoxIcon.Warning); - //} - //else if (!epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName == "PPE") - //{ - // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); - //} - //else if (!epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName != "PPE") - //{ - // ShowAlert("您不是PPE,不能填报Lead by不是CTE的项目资源", MessageBoxIcon.Warning); - //} - //else - //{ - // Alert.Show("您不是PM或PPE,不能填报资源", MessageBoxIcon.Warning); - //} - //} - //} - //else if (this.CurrUser.UserId == BLL.Const.GlyId) - //{ - // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); - //} - // } - //} + var manHours = (from x in Funs.DB.ManHours_Plan where x.ResourcePlanId == Id select x).FirstOrDefault(); + if (manHours.AccountDisabled == 0) + { + //var epro = BLL.EProjectService.GeteProjectById(eProjectId); + //if (epro != null) + //{ + // var user = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId); + // if (user != null) + // { + //if (!string.IsNullOrEmpty(user.RoleId)) + //{ + //var role = BLL.Sys_RoleService.GetRole(user.RoleId); + //if (role != null) + //{ + //if (epro.ProjectControl_LeadByName.Contains("CTE") && user.DepartId == BLL.Const.CTEM_DepartId) + //{ + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); + //} + //else if (epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName != "PM") + //{ + // ShowAlert("您不是PM,不能填报Lead by是CTE的项目资源", MessageBoxIcon.Warning); + //} + //else if (!epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName == "PPE") + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); + //} + //else if (!epro.ProjectControl_LeadByName.Contains("CTE") && role.RoleName != "PPE") + //{ + // ShowAlert("您不是PPE,不能填报Lead by不是CTE的项目资源", MessageBoxIcon.Warning); + //} + //else + //{ + // Alert.Show("您不是PM或PPE,不能填报资源", MessageBoxIcon.Warning); + //} + //} + //} + //else if (this.CurrUser.UserId == BLL.Const.GlyId) + //{ + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanEdit.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); + //} + // } + //} + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ResourcePlanView.aspx?ResourcePlanId={0}&eProjectId={1}", Id, eProjectId, "编辑 - "))); + } } protected void Grid2_RowCommand(object sender, GridCommandEventArgs e) diff --git a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanAdd.aspx.cs b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanAdd.aspx.cs index 644402f..82ccae0 100644 --- a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanAdd.aspx.cs +++ b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanAdd.aspx.cs @@ -2,13 +2,9 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Data; using System.Data.SqlClient; using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; namespace FineUIPro.Web.ResourcePlan { @@ -144,6 +140,8 @@ namespace FineUIPro.Web.ResourcePlan } //绑定 BindGrid(); + + } } } diff --git a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanEdit.aspx.cs b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanEdit.aspx.cs index 5cdd393..a214084 100644 --- a/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanEdit.aspx.cs +++ b/EProject/FineUIPro.Web/ResourcePlan/ResourcePlanEdit.aspx.cs @@ -62,51 +62,54 @@ namespace FineUIPro.Web.ResourcePlan if (!string.IsNullOrEmpty(resourcePlanId)) { var rp = BLL.ResourcePlanService.GetModelsResourcePlans(resourcePlanId); - var eProject = BLL.EProjectService.GeteProjectById(rp.EProjectId); - if (eProject != null) + if (rp != null) { - this.txtJobNo.Text = eProject.ProjectControl_JobNo; - this.txtJobTitle.Text = eProject.ProjectControl_JobTitle; - this.txtMOCNo.Text = eProject.ProjectControl_MOCFormNo; + + var eProject = BLL.EProjectService.GeteProjectById(rp.EProjectId); + if (eProject != null) + { + this.txtJobNo.Text = eProject.ProjectControl_JobNo; + this.txtJobTitle.Text = eProject.ProjectControl_JobTitle; + this.txtMOCNo.Text = eProject.ProjectControl_MOCFormNo; - foreach (CheckItem lst in this.checkJobType.Items)//项目类型 - { - if (!string.IsNullOrEmpty(eProject.ProjectControl_JobType)) + foreach (CheckItem lst in this.checkJobType.Items)//项目类型 { - if (eProject.ProjectControl_JobType.Equals(lst.Value)) - lst.Selected = true; + if (!string.IsNullOrEmpty(eProject.ProjectControl_JobType)) + { + if (eProject.ProjectControl_JobType.Equals(lst.Value)) + lst.Selected = true; + } } - } - //foreach (CheckItem lsts in this.checkPriority.Items)//优先级 - //{ - // if (!string.IsNullOrEmpty(eProject.PM_General_Priority)) - // { - // if (eProject.PM_General_Priority.Equals(lsts.Value)) - // lsts.Selected = true; - // } - //} - var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSListByType("4"); //"4"表示项目经理 - if (wbs != null) - { - Model.ManHours_Plan p = BLL.PlanService.GetPlanByIds(resourcePlanId, wbs.FirstOrDefault().DisciplinesWBSId); - if (p != null) + //foreach (CheckItem lsts in this.checkPriority.Items)//优先级 + //{ + // if (!string.IsNullOrEmpty(eProject.PM_General_Priority)) + // { + // if (eProject.PM_General_Priority.Equals(lsts.Value)) + // lsts.Selected = true; + // } + //} + var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSListByType("4"); //"4"表示项目经理 + if (wbs != null) { - this.DropDownList7.SelectedValue = p.EngineerId; - this.NumberBox15.Text = p.ManHours.ToString(); + Model.ManHours_Plan p = BLL.PlanService.GetPlanByIds(resourcePlanId, wbs.FirstOrDefault().DisciplinesWBSId); + if (p != null) + { + this.DropDownList7.SelectedValue = p.EngineerId; + this.NumberBox15.Text = p.ManHours.ToString(); + } + else if (!string.IsNullOrEmpty(eProject.ProjectControl_ProjectManagerId)) + { + this.DropDownList7.SelectedValue = eProject.ProjectControl_ProjectManagerId; + } } - else if (!string.IsNullOrEmpty(eProject.ProjectControl_ProjectManagerId)) + if (!string.IsNullOrEmpty(rp.Phase)) { - this.DropDownList7.SelectedValue = eProject.ProjectControl_ProjectManagerId; + checkPhase.SelectedValueArray = rp.Phase.Split(','); } + //绑定 + BindGrid(); } - if (!string.IsNullOrEmpty(rp.Phase)) - { - checkPhase.SelectedValueArray = rp.Phase.Split(','); - } - //绑定 - BindGrid(); } - //foreach (CheckItem item in checkPhase.Items) //{ // if (!string.IsNullOrEmpty(rp.Phase)) diff --git a/EProject/FineUIPro.Web/SysManage/LogList.aspx b/EProject/FineUIPro.Web/SysManage/LogList.aspx index 418f4e8..be528b2 100644 --- a/EProject/FineUIPro.Web/SysManage/LogList.aspx +++ b/EProject/FineUIPro.Web/SysManage/LogList.aspx @@ -59,7 +59,7 @@ - diff --git a/EProject/FineUIPro.Web/Web.config b/EProject/FineUIPro.Web/Web.config index 20e8c89..7df8014 100644 --- a/EProject/FineUIPro.Web/Web.config +++ b/EProject/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + @@ -53,7 +53,7 @@ - + diff --git a/EProject/Model/bin/Debug/Newtonsoft.Json.pdb b/EProject/Model/bin/Debug/Newtonsoft.Json.pdb new file mode 100644 index 0000000..acfc3fe Binary files /dev/null and b/EProject/Model/bin/Debug/Newtonsoft.Json.pdb differ diff --git a/EProject/Model/bin/Release/Newtonsoft.Json.pdb b/EProject/Model/bin/Release/Newtonsoft.Json.pdb new file mode 100644 index 0000000..acfc3fe Binary files /dev/null and b/EProject/Model/bin/Release/Newtonsoft.Json.pdb differ diff --git a/EProject/WebApi/WebApi.csproj.user b/EProject/WebApi/WebApi.csproj.user index ca0d73e..643f3e5 100644 --- a/EProject/WebApi/WebApi.csproj.user +++ b/EProject/WebApi/WebApi.csproj.user @@ -8,7 +8,7 @@ - Debug|Any CPU + Release|Any CPU