130 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			130 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			C#
		
	
	
	
| 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 WorkPackName
 | |
|         {
 | |
|             get { return (string)ViewState["WorkPackName"]; }
 | |
|             set { ViewState["WorkPackName"] = value; }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 系统主键
 | |
|         /// </summary>
 | |
|         public string SystemId
 | |
|         {
 | |
|             get { return (string)ViewState["SystemId"]; }
 | |
|             set { ViewState["SystemId"] = value; }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 分组主键
 | |
|         /// </summary>
 | |
|         public string GroupName
 | |
|         {
 | |
|             get { return (string)ViewState["GroupName"]; }
 | |
|             set { ViewState["GroupName"] = 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.GroupName = Request.Params["GroupName"];
 | |
|                 this.WorkInspectName = Request.Params["WorkInspectName"];
 | |
|                 PageInit();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 默认绑定
 | |
|         /// </summary>
 | |
|         public void PageInit()
 | |
|         {
 | |
|             if (!string.IsNullOrWhiteSpace(this.TermItemId))
 | |
|             {
 | |
|                 txtWorkInspectName.Text = this.WorkInspectName;
 | |
|                 ddlGroup.SelectedValue = this.GroupName;
 | |
|                 this.WorkPackName = this.GroupName;
 | |
|             }
 | |
|             var model = Funs.DB.TestRun_WorkPackage.FirstOrDefault(x => x.WorkPackId == this.WorkPackId);
 | |
|             if (model != null)
 | |
|             {
 | |
|                 this.WorkPackName = model.WorkPackName;
 | |
|                 lblgzbmc.Text = model.WorkPackName;
 | |
|             }
 | |
|             if (this.WorkPackName.Trim() == "联动试车")
 | |
|             {
 | |
|                 group.Hidden = false;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 保存
 | |
|         /// </summary>
 | |
|         protected void btnSave_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             try
 | |
|             {
 | |
|                 string groupName = string.Empty;
 | |
|                 if (this.WorkPackName.Trim() == "联动试车")
 | |
|                 {
 | |
|                     groupName = this.ddlGroup.SelectedValue;
 | |
|                 }
 | |
|                 else
 | |
|                 {
 | |
|                     groupName = this.WorkPackName;
 | |
|                 }
 | |
| 
 | |
|                 var requestStr = this.TermItemId + "|" + this.WorkPackId + "|" + this.SystemId + "|" + this.txtWorkInspectName.Text + "|" + groupName;
 | |
|                 PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(requestStr) + ActiveWindow.GetHidePostBackReference());
 | |
|             }
 | |
|             catch (Exception ex)
 | |
|             {
 | |
|                 ShowNotify(ex.Message, MessageBoxIcon.Error);
 | |
|             }
 | |
|         }
 | |
| 
 | |
|     }
 | |
| } |