private void AuditParamResultForm_Load(object sender, EventArgs e)
        {
            int selectedQueryId = AuditQueriesSession.Instance.SelectedQueryId;

            //Get the query from storage
            QueryStorage qStore  = AuditQueriesSession.Instance.GetQueryStorage();
            var          qParams = qStore.GetQueryParams(selectedQueryId);

            //Setup the parameter objects
            if (CollectionUtilities.isNotEmpty(qParams))
            {
                int idx = 0;
                foreach (var curKey in qParams.Keys)
                {
                    if (string.IsNullOrEmpty(curKey))
                    {
                        continue;
                    }
                    auditParameters[idx] = new AuditParamObject();
                    var curQParam = qParams[curKey];
                    auditParameters[idx].SetParameterNameAndType(curKey, curQParam.Left);
                    auditParameters[idx].ParameterValue = curQParam.Right;
                    ++idx;
                }
            }

            //If any parameters exist, set them into param data grid view
            this.populateDataGridWithAuditParameters();

            //Disable the execute button
            this.executeQueryButton.Enabled = false;
            this.saveButton.Enabled         = false;
        }
        public AuditParamResultForm()
        {
            InitializeComponent();
            QueryStorage qStore = AuditQueriesSession.Instance.GetQueryStorage();
            //Get number of parameters
            var qParams = qStore.GetQueryParams(AuditQueriesSession.Instance.SelectedQueryId);

            if (qParams != null)
            {
                var numParams = qParams.Keys.Count;
                auditParameters = new AuditParamObject[numParams];
            }
            cellEditMutex       = new object();
            resultTable         = null;
            resultBindingSource = new BindingSource();
        }