private bool setUpParams() { String searchString = "Scripts/" + cmbUpdateType.Text + ".xml"; try { //Read in the xml System.IO.StreamReader objReader; objReader = new System.IO.StreamReader(searchString); scriptXmlText = objReader.ReadToEnd(); objReader.Close(); } catch { MessageBox.Show("Error reading: " + searchString); return(false); } //Convert scriptXmlText to dcrParams object TextReader txtReader = new StringReader(scriptXmlText); //This creates xml based on the QueryList object XmlSerializer serializer = new XmlSerializer(typeof(DCR_Script)); //Sets up the entire script dcrScript = (DCR_Script)serializer.Deserialize(txtReader); txtReader.Close(); //Set up the updateParam to be refreshed updateParam = dcrScript.updateParamList.First(); string displayMessage = ""; //Check up study and initialise if (validStudy(ref displayMessage, txtStudyID.Text)) { if (updateParam.inputParamList.Count == 0) { rtbStudyVerifications.Text = "Parameters: N/A"; btnVerify.Enabled = true; } else { FormGetParams frmGetParams = new FormGetParams(); if (frmGetParams.ShowDialog() == DialogResult.OK) { string paramText = "Parameters:\n========="; foreach (var x in updateParam.inputParamList) { paramText += "\n" + x.paramDesc + ": " + x.value; } rtbStudyVerifications.Text = paramText; btnVerify.Enabled = true; } } } else { MessageBox.Show(displayMessage); } return(true); }
private void initialiseQuery() { updateQueryObj = new Update_Queries(); dcrScript = new DCR_Script(); }