using System; using System.Windows; namespace SSWMS.Client { public partial class STATUS_FLOW_ACTION : AvalonDock.DocumentContent { private string FlowType = string.Empty; public STATUS_FLOW_ACTION(string sFlowType) { InitializeComponent(); this.FlowType = sFlowType; switch (sFlowType) { case "FLOW_PLAN": this.dgParentChild.U_ParentHeader = "计划信息"; this.dgParentChild.U_TableParent = "PLAN_MAIN"; this.dgParentChild.U_TableParentOrderBy = "PLAN_ID"; this.dgParentChild.U_TableParentID = "PLAN_ID"; this.dgParentChild.U_TableParentWhere = "PLAN_STATUS<>'Complete' and PLAN_STATUS<>'Delete'"; this.dgParentChild.U_ChildHeader = "计划物料"; this.dgParentChild.U_TableChild = "V_PLAN_LIST"; this.dgParentChild.U_TableChildOrderBy = "PLAN_LIST_ID"; break; case "FLOW_MANAGE": this.dgParentChild.U_ParentHeader = "任务信息"; this.dgParentChild.U_TableParent = "V_MANAGE_MAIN"; this.dgParentChild.U_TableParentOrderBy = "MANAGE_ID"; this.dgParentChild.U_TableParentID = "MANAGE_ID"; this.dgParentChild.U_ChildHeader = "任务物料"; this.dgParentChild.U_TableChild = "V_MANAGE_LIST"; this.dgParentChild.U_TableChildOrderBy = "MANAGE_LIST_ID"; break; } //(this.dgParentChild.Content as Grid).RowDefinitions[0].Height = new GridLength(2, GridUnitType.Star); DocumentContent_Loaded(null, null); } private void DocumentContent_Loaded(object sender, RoutedEventArgs e) { this.pStatusFlowActions.U_ExecuteUpdate += new UC.ucStatusFlowActionsPanel.DelegateExecuteUpdate(() => { this.dgParentChild.U_InitControlParent(); }); this.dgParentChild.U_ParentSelectedChanged += new UC.ucTopParentBottomChild.DelegateParentSelectedChanged((sParentID) => { if (String.IsNullOrEmpty(sParentID)) { this.pStatusFlowActions.U_Clear(); } else { this.pStatusFlowActions.U_FLOW_TYPE = this.FlowType; this.pStatusFlowActions.U_FLOW_ID = sParentID; this.pStatusFlowActions.U_InitControl(); } }); this.dgParentChild.U_InitControl(); } } }