This commit is contained in:
2024-05-12 19:06:28 +08:00
parent 8e6eedf614
commit 11bd257838
3 changed files with 148 additions and 29 deletions
@@ -9,6 +9,7 @@ using System.Collections;
using Model;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using FineUIPro.Web.common.ProjectSet;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.WeldingProcess.PMI
{
@@ -105,7 +106,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
where x.UnitId == unitId
&& x.ProjectId == this.CurrUser.LoginProjectId
&& x.DelegationDate >= startTime && x.DelegationDate <= endTime
&&( x.DelegationNo.Contains(searchCode)|| searchCode=="")
&& (x.DelegationNo.Contains(searchCode) || searchCode == "")
select x;
//if (!string.IsNullOrWhiteSpace(searchCode))
// ndt = ndt.Where(q => q.DelegationNo.Contains(searchCode));
@@ -120,7 +121,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
node.Nodes.Add(newNode);
BindNodes(newNode);
}
}
}
}
#endregion
@@ -189,13 +190,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI
}
}
private string StatusText(int status) {
if (status == 0)
return "合格";
else
return "不合格";
}
#region
/// <summary>
/// 加载页面输入提交信息
@@ -208,17 +202,19 @@ namespace FineUIPro.Web.WeldingProcess.PMI
join n in Funs.DB.Project_Installation on x.InstallationId equals n.InstallationId
join u in Funs.DB.Sys_User on x.DetectionStandard equals u.UserId into u1 //左连接查询
from u in u1.DefaultIfEmpty()
where x.Id==hdPMIId.Text
select new { DelegationNo=x.DelegationNo,
DelegationDate=x.DelegationDate,
InstallationName=n.InstallationName,
UnitName=y.UnitName,
DetectionMethod="PMI光谱分析",
Tabler=x.Tabler,
Remark=x.Remark,
DetectionStandard=x.DetectionStandard,
where x.Id == hdPMIId.Text
select new
{
DelegationNo = x.DelegationNo,
DelegationDate = x.DelegationDate,
InstallationName = n.InstallationName,
UnitName = y.UnitName,
DetectionMethod = "PMI光谱分析",
Tabler = x.Tabler,
Remark = x.Remark,
DetectionStandard = x.DetectionStandard,
}).ToList();
if (pageInfo.Count>0)
if (pageInfo.Count > 0)
{
this.txtDelegationNo.Text = pageInfo[0].DelegationNo;
this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString();
@@ -227,7 +223,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod;
this.txtTabler.Text = pageInfo[0].Tabler;
this.txtRemark.Text = pageInfo[0].Remark;
this.txtDetectionStandard.Text= pageInfo[0].DetectionStandard;
this.txtDetectionStandard.Text = pageInfo[0].DetectionStandard;
}
}
#endregion
@@ -325,5 +321,60 @@ namespace FineUIPro.Web.WeldingProcess.PMI
return str;
}
#endregion
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
//if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.BItemEndCheckMenuId, Const.BtnSave))
//{
// ShowNotify("您没有这个权限,请与管理员联系!");
// return;
//}
if (Grid1.GetModifiedData().Count > 0)
{
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
string status = teamGroupRow.Value<string>("status");
if (status == "modified")
{
JObject values = teamGroupRow.Value<JObject>("values");
string id = teamGroupRow.Value<string>("id");
Model.PMI_DelegationDetails onePMIDelegationDetails = Funs.DB.PMI_DelegationDetails.FirstOrDefault(p => p.Id == id);
if (onePMIDelegationDetails == null)
continue;
//检测日期(缺失)
string trustDate = values.Value<string>("TrustDate");
if (string.IsNullOrWhiteSpace(trustDate))
;
else
;
//报告日期
string createdTime = values.Value<string>("CreatedTime");
if (string.IsNullOrWhiteSpace(createdTime))
onePMIDelegationDetails.CreatedTime=null;
else
onePMIDelegationDetails.CreatedTime=Convert.ToDateTime(createdTime);
//报告编号
onePMIDelegationDetails.ReportNo = values.Value<string>("reportNo").ToString();
//是否合格 0合格 1不合格
string statusText = values.Value<string>("StatusText");
if (statusText == "合格")
onePMIDelegationDetails.Status = 0;
else
onePMIDelegationDetails.Status = 1;
Funs.DB.SubmitChanges();
}
}
this.BindGrid();
}
ShowNotify("数据保存成功!(表格数据已重新绑定)");
}
}
}