修改施工日志
This commit is contained in:
@@ -146,6 +146,10 @@ namespace FineUIPro.Web.AttachFile
|
||||
Grid1.DataSource = SourceData();
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(Request.Params["ConstructionLog"]))
|
||||
{
|
||||
Grid1.DataSource = GetConstructionLogSourceData();
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid1.DataSource = GetSourceData();
|
||||
@@ -519,6 +523,50 @@ namespace FineUIPro.Web.AttachFile
|
||||
return (JArray)Session[sessionName];
|
||||
}
|
||||
|
||||
private JArray GetConstructionLogSourceData()
|
||||
{
|
||||
if (Session[sessionName] == null && !string.IsNullOrEmpty(ToKeyId))
|
||||
{
|
||||
Session[sessionName] = new JArray();
|
||||
List<Model.AttachFile> sours = new List<Model.AttachFile>();
|
||||
List<string> lists = Funs.GetStrListByStr(ToKeyId, ',');
|
||||
sours = (from x in Funs.DB.AttachFile where lists.Contains(x.ToKeyId) select x).ToList();
|
||||
string attachSource = string.Empty;
|
||||
if (sours.Count>0)
|
||||
{
|
||||
foreach (var sour in sours)
|
||||
{
|
||||
string url = sour.AttachUrl.Replace('\\', '/');
|
||||
List<string> list = Funs.GetStrListByStr(url, ',');
|
||||
if (list.Count() > 0)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var item in list)
|
||||
{
|
||||
string atturl = Funs.RootPath + item.Replace(';', ' ').Trim();
|
||||
if (File.Exists(atturl))
|
||||
{
|
||||
i += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
attachSource += sour.AttachSource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(attachSource))
|
||||
{
|
||||
attachSource = attachSource.Replace("][", ",");
|
||||
Session[sessionName] = JArray.Parse(attachSource);
|
||||
}
|
||||
}
|
||||
return (JArray)Session[sessionName];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user