修改质量月报、周报,报错问题

This commit is contained in:
2024-12-30 10:21:46 +08:00
parent 7083f10e59
commit 8a897b5df7
4 changed files with 85 additions and 77 deletions
@@ -244,63 +244,68 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
#region
var txtReportList = db.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList();
if (txtReportList.FirstOrDefault(x => x.ContentType == "0") != null)
if (txtReportList.Count>0)
{
txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "1") != null)
{
txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "2") != null)
{
txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "20") != null)
{
txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "21") != null)
{
txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "22") != null)
{
txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "8") != null)
{
txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null)
{
imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl;
txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null)
{
imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null)
{
imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null)
{
imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null)
{
imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null)
{
imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText;
if (txtReportList.FirstOrDefault(x => x.ContentType == "0") != null)
{
txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "1") != null)
{
txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "2") != null)
{
txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "20") != null)
{
txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "21") != null)
{
txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "22") != null)
{
txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "8") != null)
{
txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null)
{
imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl;
txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null)
{
imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null)
{
imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null)
{
imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null)
{
imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText;
}
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null)
{
imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText;
}
}
#endregion