0110-gaofei
This commit is contained in:
@@ -74,20 +74,30 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<string> GetUnitProjectIdByInstallationIdAndCNCodeAndUnitProjectCode(string installationId, string cnCode, string unitProjectCode)
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string inId = string.Empty;
|
||||
Model.Project_Installation 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)
|
||||
{
|
||||
inId = installationId;
|
||||
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
|
||||
if (cn != null)
|
||||
{
|
||||
ids.AddRange((from x in db.Wbs_UnitProject where x.CnProfessionId == cn.CnProfessionId && x.UnitProjectCode == unitProjectCode select x.UnitProjectId).ToList());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inId = Project_InstallationService.GetEndInstallationId(installationId);
|
||||
var childIns = from x in db.Project_Installation where x.SuperInstallationId == installationId select x;
|
||||
foreach (var childIn in childIns)
|
||||
{
|
||||
ids.AddRange(GetUnitProjectIdByInstallationIdAndCNCodeAndUnitProjectCode(childIn.InstallationId, cnCode, unitProjectCode));
|
||||
}
|
||||
}
|
||||
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
|
||||
var list = (from x in db.Wbs_UnitProject where x.CnProfessionId == cn.CnProfessionId && x.UnitProjectCode == unitProjectCode select x.UnitProjectId).ToList();
|
||||
return list;
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user