11
This commit is contained in:
@@ -63,13 +63,38 @@ namespace BLL
|
||||
public static Model.Editor_TDC GetTDCByEprojectId(string eProjectId, string type)
|
||||
{
|
||||
var q = (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type select x).ToList();
|
||||
if (q.Count > 1)
|
||||
if (q.Count > 0)
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type && x.Disc == "00_ALL" orderby x.ReceiveHC descending select x).FirstOrDefault();
|
||||
if (type == "D02_AS-BUILT" || type == "D03_MD")
|
||||
{
|
||||
var qq = (from x in Funs.DB.Editor_TDC
|
||||
where x.EProjectId == eProjectId && x.Type == type && !x.Disc.Contains("00_ALL")
|
||||
select x).ToList();
|
||||
if (qq.Count > 0)
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type && !x.Disc.Contains("00_ALL") orderby x.ReceivePDF descending select x).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type select x).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else if (type == "D11_MC" || type == "D30_FC")
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type && x.Disc == "00_ALL" orderby x.ReceiveHC descending select x).FirstOrDefault();
|
||||
}
|
||||
else if (type == "D12_RFSU")
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type && !x.Disc.Contains("00_ALL") orderby x.ReceiveHC descending select x).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return (from x in Funs.DB.Editor_TDC where x.EProjectId == eProjectId && x.Type == type orderby x.ReceiveHC descending select x).FirstOrDefault();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user