20221008 人员当前项目刷新信息按钮事件修改

This commit is contained in:
2022-10-08 16:25:50 +08:00
parent 4ad6950292
commit f32b61f13e
2 changed files with 23 additions and 383 deletions
+23 -2
View File
@@ -270,7 +270,7 @@ namespace FineUIPro.Web.Person
var getPPersons = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null
where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null
select x).Take(1000);
foreach (var pitem in getPPersons)
{
@@ -278,7 +278,28 @@ namespace FineUIPro.Web.Person
pCountRecod++;
}
info+= "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。";
if (pCountRecod == 0)
{
var getPPersons2 = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
where x.States == Const.ProjectPersonStates_0 && y.CurrentProjectId == null
select x).Take(1000);
foreach (var pitem2 in getPPersons2)
{
var getPersons = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == pitem2.PersonId);
if (getPersons != null)
{
getPersons.CurrentProjectId = pitem2.ProjectId;
getPersons.CurrentProjectRoleId = pitem2.RoleIds;
getPersons.CurrentProjectWorkPostId = pitem2.WorkPostId;
Funs.DB.SubmitChanges();
}
pCountRecod++;
}
}
info += "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。";
Alert.ShowInParent(info, MessageBoxIcon.Information);
}
}
}