0110-gaofei
This commit is contained in:
@@ -29,25 +29,31 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="unitProjectId">专业Id</param>
|
||||
/// <returns></returns>
|
||||
public static string GetCnProfessionIdByInstallationIdAndOldId(string installationId, string oldId)
|
||||
public static List<string> GetCnProfessionIdsByInstallationIdAndOldId(string installationId, string oldId)
|
||||
{
|
||||
string cnProfessionId = string.Empty;
|
||||
List<string> cnProfessionIds = new List<string>();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
|
||||
if (ins.IsEnd == true)
|
||||
var childInss = from x in db.Project_Installation where x.SuperInstallationId == installationId select x;
|
||||
if (childInss.Count() == 0)
|
||||
{
|
||||
var cn = db.WBS_CnProfession.FirstOrDefault(x => x.InstallationId == ins.InstallationId && x.OldId.ToString() == oldId);
|
||||
cnProfessionId = cn.CnProfessionId;
|
||||
if (cn != null)
|
||||
{
|
||||
cnProfessionIds.Add(cn.CnProfessionId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var childIns = db.Project_Installation.FirstOrDefault(x => x.SuperInstallationId == installationId);
|
||||
cnProfessionId = GetCnProfessionIdByInstallationIdAndOldId(childIns.InstallationId, oldId);
|
||||
var childIns = from x in db.Project_Installation where x.SuperInstallationId == installationId select x;
|
||||
foreach (var childIn in childIns)
|
||||
{
|
||||
cnProfessionIds.AddRange(GetCnProfessionIdsByInstallationIdAndOldId(childIn.InstallationId,oldId));
|
||||
}
|
||||
}
|
||||
return cnProfessionId;
|
||||
return cnProfessionIds;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加专业
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user