//---------------------------------------------------------------------------- private void InitFromConfig(CTimosWebConfig config) { if (config == null) { return; } string strURL = config.URL; m_txtURL.Text = strURL; if (strURL != "") { try { InitClientSoap(strURL); m_actionEnCours = config.Action; m_cmbSelectAction.SelectedValue = config.Action; FillListeVariables(m_actionEnCours); } catch (Exception ex) { m_txtOutput.Text += ex.Message + Environment.NewLine; } } }
//---------------------------------------------------------------------------- private void m_cmbSelectAction_SelectionChangeCommitted(object sender, EventArgs e) { MajChamps(); CMemoryAction action = m_cmbSelectAction.SelectedValue as CMemoryAction; if (action != null) { m_actionEnCours = action; FillListeVariables(action); } }
//---------------------------------------------------------------------------- private void FillListeActions() { DataSet ds = m_client.GetActions(); if (ds != null) { m_txtOutput.Text += ds.DataSetName + Environment.NewLine; DataTable tableActions = ds.Tables[m_client.GetActionTableName()]; DataTable tableVariables = ds.Tables[m_client.GetVariablesTableNameName()]; if (tableActions != null) { List <CMemoryAction> listeActions = new List <CMemoryAction>(); foreach (DataRow row in tableActions.Rows) { CMemoryAction action = new CMemoryAction(); action.Id = (int)row[m_client.GetActionIdFieldName()]; action.Label = (string)row[m_client.GetActionLabelFieldName()]; action.TypeAction = (string)row[m_client.GetActionTypeFieldName()]; action.Description = (string)row[m_client.GetActionDescpritionFieldName()]; if (tableVariables != null) { List <CCoupleVariableValeur> listeVariables = new List <CCoupleVariableValeur>(); foreach (DataRow rowV in tableVariables.Rows) { int nIdAction = (int)rowV[m_client.GetActionIdFieldName()]; if (nIdAction == action.Id) { CMemoryVariable variable = new CMemoryVariable(); variable.Id = (int)rowV[m_client.GetVariableIdFieldName()]; variable.Name = (string)rowV[m_client.GetVariableNameFieldName()]; variable.TypeVariable = (int)rowV[m_client.GetVariableTypeFieldName()]; listeVariables.Add(new CCoupleVariableValeur(variable, "")); } } action.LiseVariables = listeVariables; } listeActions.Add(action); } m_cmbSelectAction.Fill(listeActions, "Label", true); } } }
//---------------------------------------------------------------------------- void FillListeVariables(CMemoryAction action) { m_panelVariables.SuspendDrawing(); m_panelVariables.ClearAndDisposeControls(); if (action != null) { foreach (CCoupleVariableValeur coupleVarVal in action.LiseVariables) { CControlVariableValeur ctrl = new CControlVariableValeur(); ctrl.Init(coupleVarVal); ctrl.Dock = DockStyle.Top; m_panelVariables.Controls.Add(ctrl); ctrl.BringToFront(); } } m_panelVariables.ResumeDrawing(); }