提交试车代码
This commit is contained in:
@@ -76,7 +76,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
public void BindGrid(int isPass = -1)
|
||||
{
|
||||
//获取子系统
|
||||
var data = new List<ConfirmIsPass>();
|
||||
@@ -96,22 +96,22 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
//1=分包商2=承包商3=监理4=业主
|
||||
if (this.ConfirmType == 1)
|
||||
{
|
||||
model.IsPass = item.SubcontractorIsPass;
|
||||
model.IsPass = isPass != -1 ? isPass : item.SubcontractorIsPass;
|
||||
model.Remark = item.SubcontractorRemark;
|
||||
}
|
||||
if (this.ConfirmType == 2)
|
||||
{
|
||||
model.IsPass = item.ContractorIsPass;
|
||||
model.IsPass = isPass != -1 ? isPass : item.ContractorIsPass;
|
||||
model.Remark = item.ContractorRemark;
|
||||
}
|
||||
if (this.ConfirmType == 3)
|
||||
{
|
||||
model.IsPass = item.SupervisionIsPass;
|
||||
model.IsPass = isPass != -1 ? isPass : item.SupervisionIsPass;
|
||||
model.Remark = item.SupervisionRemark;
|
||||
}
|
||||
if (this.ConfirmType == 4)
|
||||
{
|
||||
model.IsPass = item.OwnerIsPass;
|
||||
model.IsPass = isPass != -1 ? isPass : item.OwnerIsPass;
|
||||
model.Remark = item.OwnerRemark;
|
||||
}
|
||||
data.Add(model);
|
||||
@@ -134,7 +134,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
#region 按钮和事件
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
@@ -149,32 +149,35 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
string status = mergedRow.Value<string>("status");
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int i = mergedRow.Value<int>("index");
|
||||
|
||||
GridRow row = Grid1.Rows[i];
|
||||
System.Web.UI.WebControls.RadioButtonList rblIsPass = (System.Web.UI.WebControls.RadioButtonList)row.FindControl("rblIsPass");
|
||||
var termItemId = this.Grid1.Rows[i].DataKeys[0].ToString();
|
||||
//获取子系统信息
|
||||
var model = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.TermItemId == termItemId);
|
||||
if (model != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(values.Value<string>("IsPass")))
|
||||
if (!string.IsNullOrWhiteSpace(rblIsPass.SelectedValue))
|
||||
{
|
||||
//1=分包商2=承包商3=监理4=业主
|
||||
if (this.ConfirmType == 1)
|
||||
{
|
||||
model.SubcontractorIsPass = int.Parse(values.Value<string>("IsPass"));
|
||||
model.SubcontractorIsPass = int.Parse(rblIsPass.SelectedValue);
|
||||
model.SubcontractorRemark = values.Value<string>("Remark");
|
||||
}
|
||||
else if (this.ConfirmType == 2)
|
||||
{
|
||||
model.ContractorIsPass = int.Parse(values.Value<string>("IsPass"));
|
||||
model.ContractorIsPass = int.Parse(rblIsPass.SelectedValue);
|
||||
model.ContractorRemark = values.Value<string>("Remark");
|
||||
}
|
||||
else if (this.ConfirmType == 3)
|
||||
{
|
||||
model.SupervisionIsPass = int.Parse(values.Value<string>("IsPass"));
|
||||
model.SupervisionIsPass = int.Parse(rblIsPass.SelectedValue);
|
||||
model.SupervisionRemark = values.Value<string>("Remark");
|
||||
}
|
||||
else if (this.ConfirmType == 4)
|
||||
{
|
||||
model.OwnerIsPass = int.Parse(values.Value<string>("IsPass"));
|
||||
model.OwnerIsPass = int.Parse(rblIsPass.SelectedValue);
|
||||
model.OwnerRemark = values.Value<string>("Remark");
|
||||
}
|
||||
}
|
||||
@@ -241,59 +244,13 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 实体绑定
|
||||
/// </summary>
|
||||
public class ConfirmIsPass
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string TermItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 检查项主键
|
||||
/// </summary>
|
||||
public string SubItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 检查表主键
|
||||
/// </summary>
|
||||
public string SubInspectId { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string WorkInspectName { get; set; }
|
||||
/// <summary>
|
||||
/// 检查说明
|
||||
/// </summary>
|
||||
public string InspectionIllustrate { get; set; }
|
||||
/// <summary>
|
||||
/// 确认类型1=分包商2=承包商3=监理4=业主
|
||||
/// </summary>
|
||||
public int ConfirmType { get; set; }
|
||||
/// <summary>
|
||||
/// 确认类型名称
|
||||
/// </summary>
|
||||
public string ConfirmTypeName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否通过
|
||||
/// </summary>
|
||||
public int? IsPass { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭
|
||||
/// </summary>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
///// <summary>
|
||||
///// 窗口关闭
|
||||
///// </summary>
|
||||
//protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
//{
|
||||
// BindGrid();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
@@ -734,6 +691,98 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 行加载事件
|
||||
/// </summary>
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
System.Web.UI.WebControls.RadioButtonList rblIsPass = (System.Web.UI.WebControls.RadioButtonList)Grid1.Rows[e.RowIndex].FindControl("rblIsPass");
|
||||
int isPass = 1;
|
||||
if (Grid1.DataKeys[e.RowIndex][4] != null) isPass = int.Parse(Grid1.DataKeys[e.RowIndex][4].ToString());
|
||||
rblIsPass.SelectedValue = isPass.ToString();
|
||||
if (rblIsPass.SelectedValue != "1")
|
||||
{
|
||||
rblIsAllPass.SelectedValue = "0";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体绑定
|
||||
/// </summary>
|
||||
public class ConfirmIsPass
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string TermItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 检查项主键
|
||||
/// </summary>
|
||||
public string SubItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 检查表主键
|
||||
/// </summary>
|
||||
public string SubInspectId { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string WorkInspectName { get; set; }
|
||||
/// <summary>
|
||||
/// 检查说明
|
||||
/// </summary>
|
||||
public string InspectionIllustrate { get; set; }
|
||||
/// <summary>
|
||||
/// 确认类型1=分包商2=承包商3=监理4=业主
|
||||
/// </summary>
|
||||
public int ConfirmType { get; set; }
|
||||
/// <summary>
|
||||
/// 确认类型名称
|
||||
/// </summary>
|
||||
public string ConfirmTypeName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否通过
|
||||
/// </summary>
|
||||
public int? IsPass { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查项确认事件
|
||||
/// </summary>
|
||||
protected void rblIsPass_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
{
|
||||
System.Web.UI.WebControls.RadioButtonList rblIsPass = (System.Web.UI.WebControls.RadioButtonList)Grid1.Rows[i].FindControl("rblIsPass");
|
||||
if (rblIsPass.SelectedValue != "1")
|
||||
{
|
||||
rblIsAllPass.SelectedValue = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否同意进行预试车活动事件
|
||||
/// </summary>
|
||||
protected void rblIsAllPass_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid(int.Parse(rblIsAllPass.SelectedValue));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 附件上传
|
||||
/// </summary>
|
||||
protected void btnAttach_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CheckControl&menuId={1}", $"{this.SubInspectId}_{this.ConfirmType}", Const.TestRunMenuId)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private bool VerifyFile(DataSet ds)
|
||||
@@ -817,5 +866,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user