提交试车代码
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.TestRun.TestRunManage
|
||||
{
|
||||
public partial class SubInspectTermEdit : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string TermItemId
|
||||
{
|
||||
get { return (string)ViewState["TermItemId"]; }
|
||||
set { ViewState["TermItemId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工作包主键
|
||||
/// </summary>
|
||||
public string WorkPackId
|
||||
{
|
||||
get { return (string)ViewState["WorkPackId"]; }
|
||||
set { ViewState["WorkPackId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 系统主键
|
||||
/// </summary>
|
||||
public string SystemId
|
||||
{
|
||||
get { return (string)ViewState["SystemId"]; }
|
||||
set { ViewState["SystemId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分组主键
|
||||
/// </summary>
|
||||
public string GroupId
|
||||
{
|
||||
get { return (string)ViewState["GroupId"]; }
|
||||
set { ViewState["GroupId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查项名称
|
||||
/// </summary>
|
||||
public string WorkInspectName
|
||||
{
|
||||
get { return (string)ViewState["WorkInspectName"]; }
|
||||
set { ViewState["WorkInspectName"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.TermItemId = Request.Params["TermItemId"];
|
||||
this.WorkPackId = Request.Params["WorkPackId"];
|
||||
this.SystemId = Request.Params["SystemId"];
|
||||
this.GroupId = Request.Params["GroupId"];
|
||||
this.WorkInspectName = Request.Params["WorkInspectName"];
|
||||
PageInit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认绑定
|
||||
/// </summary>
|
||||
public void PageInit()
|
||||
{
|
||||
//绑定分组
|
||||
var groups = Funs.DB.TestRun_TemplateItemGroup.OrderBy(x => x.Sort).ToList();
|
||||
ddlGroup.DataTextField = "GroupName";
|
||||
ddlGroup.DataValueField = "GroupId";
|
||||
ddlGroup.DataSource = groups;
|
||||
ddlGroup.DataBind();
|
||||
if (!string.IsNullOrWhiteSpace(this.TermItemId))
|
||||
{
|
||||
txtWorkInspectName.Text = this.WorkInspectName;
|
||||
ddlGroup.SelectedValue = this.GroupId;
|
||||
}
|
||||
var model = Funs.DB.TestRun_WorkPackage.FirstOrDefault(x => x.WorkPackId == this.WorkPackId);
|
||||
if (model != null)
|
||||
{
|
||||
lblgzbmc.Text = model.WorkPackName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var groupmodel = Funs.DB.TestRun_TemplateItemGroup.FirstOrDefault(x => x.GroupId == ddlGroup.SelectedValue);
|
||||
var requestStr = this.TermItemId + "|" + this.WorkPackId + "|" + this.SystemId + "|" + this.txtWorkInspectName.Text + "|" + this.ddlGroup.SelectedValue + "|" + this.ddlGroup.SelectedText + "|" + groupmodel.Sort;
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(requestStr) + ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowNotify(ex.Message, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user