예제 #1
0
 //Activation
 private void GetParameters(object sender, ExternalDataEventArgs e)
 {
     try
     {
         TraceEvent("Entering CloseManyAccounts.GetParameters: ", 47, TraceSeverity.Verbose);
         m_InitializationData = JsonSerializer.Deserialize <InitializationFormData>(workflowProperties.InitiationData);
     }
     catch (Exception _ex)
     {
         TraceEvent(_ex.ExceptionDiagnosticMessage("CloseManyAccounts.GetParameters"), 51, TraceSeverity.High);
         string _tmp = "Workflow aborted at GetParameters because of the error: {0}";
         throw new ApplicationException(String.Format(_tmp, _ex.Message));
     }
 }
예제 #2
0
        /// <summary>
        /// Gets the initiation data. This method is called when the user clicks the button to start the workflow.
        /// </summary>
        /// <returns>System.String.</returns>
        private string GetInitiationData()
        {
            List <int> _selected = new List <int>();

            for (int i = 0; i < m_AvailableGridView.Rows.Count; i++)
            {
                GridViewRow _row = m_AvailableGridView.Rows[i];
                CheckBox    _cb  = FindControlRecursive(_row, "x_IsSelected") as CheckBox;
                if (_cb == null)
                {
                    throw new ArgumentException("Cannot find CheckBox on the page");
                }
                if (_cb.Checked)
                {
                    _selected.Add(m_DataSource[i].Id);
                }
            }
            InitializationFormData _initializationFormData = new InitializationFormData()
            {
                AccountsArray = _selected.ToArray()
            };

            return(JsonSerializer.Serialize <InitializationFormData>(_initializationFormData));
        }