115 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			115 lines
		
	
	
		
			4.9 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.DriverSub | |||
|  | { | |||
|  |     public partial class DriverSubSetProgressEdit : PageBase | |||
|  |     { | |||
|  |         public string DriverSubPlanId | |||
|  |         { | |||
|  |             get { return (string)ViewState["DriverSubPlanId"]; } | |||
|  |             set { ViewState["DriverSubPlanId"] = value; } | |||
|  |         } | |||
|  | 
 | |||
|  |         protected void Page_Load(object sender, EventArgs e) | |||
|  |         { | |||
|  |             if (!IsPostBack) | |||
|  |             { | |||
|  |                 this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); | |||
|  |                 DriverSubPlanId = Request.Params["DriverSubPlanId"]; | |||
|  |                 Bind(); | |||
|  |             } | |||
|  | 
 | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         void Save() | |||
|  |         { | |||
|  |             DriverSubContactService.SetState(DriverSubPlanId, drpCatalystLoading.SelectedValue,drpCatalystLoadingState.SelectedValue ); | |||
|  |             DriverSubContactService.SetState(DriverSubPlanId, drpOven.SelectedValue, drpOvenState.SelectedValue); | |||
|  |             DriverSubContactService.SetState(DriverSubPlanId, drpChemicalCleaning.SelectedValue, drpChemicalCleaningState.SelectedValue); | |||
|  |             DriverSubContactService.SetState(DriverSubPlanId, drpDrivingTeam.SelectedValue, drpDrivingTeamState.SelectedValue); | |||
|  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | |||
|  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | |||
|  |         } | |||
|  | 
 | |||
|  |         void Bind() | |||
|  |         { | |||
|  | 
 | |||
|  |             var model = BLL.DriverSubPlanService.GetDriverSubPlanById(DriverSubPlanId); | |||
|  |             if (model != null) | |||
|  |             { | |||
|  | 
 | |||
|  |                 var subcontractingtypeList = model.SubcontractingTypes.Split(','); | |||
|  | 
 | |||
|  | 
 | |||
|  |                 foreach (string item in subcontractingtypeList) | |||
|  |                 { | |||
|  |                     if (item.Contains("1")) | |||
|  |                     { | |||
|  |                         drpCatalystLoading.Hidden = false; | |||
|  |                         DriverSubContactService.InitDropListByDriverSubPlanId(DriverSubPlanId, item, drpCatalystLoading); | |||
|  |                         drpCatalystLoading.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "1")?.DriverSubContractorsId; | |||
|  | 
 | |||
|  |                         drpCatalystLoadingState.Hidden=false; | |||
|  |                         DriverSubContactService.InitDriverSubPlanState(drpCatalystLoadingState); | |||
|  |                         drpCatalystLoadingState.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "1")?.State.ToString(); | |||
|  |                     } | |||
|  |                     else if (item.Contains("2")) | |||
|  |                     { | |||
|  |                         drpOven.Hidden = false; | |||
|  |                         DriverSubContactService.InitDropListByDriverSubPlanId(DriverSubPlanId, item, drpOven); | |||
|  |                         drpOven.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "2")?.DriverSubContractorsId; | |||
|  | 
 | |||
|  |                         drpOvenState.Hidden = false; | |||
|  |                         DriverSubContactService.InitDriverSubPlanState(drpOvenState); | |||
|  |                         drpOvenState.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "2")?.State.ToString(); | |||
|  |                     } | |||
|  |                     else if (item.Contains("3")) | |||
|  |                     { | |||
|  |                         drpChemicalCleaning.Hidden = false; | |||
|  |                         DriverSubContactService.InitDropListByDriverSubPlanId(DriverSubPlanId, item, drpChemicalCleaning); | |||
|  |                         drpChemicalCleaning.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "3")?.DriverSubContractorsId; | |||
|  | 
 | |||
|  |                         drpChemicalCleaningState.Hidden = false; | |||
|  |                         DriverSubContactService.InitDriverSubPlanState(drpChemicalCleaningState); | |||
|  |                         drpChemicalCleaningState.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "3")?.State.ToString(); | |||
|  |                     } | |||
|  |                     else if (item.Contains("4")) | |||
|  |                     { | |||
|  |                         drpDrivingTeam.Hidden = false; | |||
|  |                         DriverSubContactService.InitDropListByDriverSubPlanId(DriverSubPlanId, item, drpDrivingTeam); | |||
|  |                         drpDrivingTeam.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "4")?.DriverSubContractorsId; | |||
|  | 
 | |||
|  |                         drpDrivingTeamState.Hidden = false; | |||
|  |                         DriverSubContactService.InitDriverSubPlanState(drpDrivingTeamState); | |||
|  |                         drpDrivingTeamState.SelectedValue = DriverSubContactService | |||
|  |                             .GetBidirectional(DriverSubPlanId, "4")?.State.ToString(); | |||
|  |                     } | |||
|  | 
 | |||
|  |                 } | |||
|  | 
 | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         protected void btnSave_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             Save(); | |||
|  |         } | |||
|  |     } | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | } |