/// <summary> /// convenience function reads CIMData file, calls createDER, returns all in one call /// </summary> /// <param name="DERGroupName">group to be created, must be in the config file</param> /// <param name="path">file name</param> /// <returns></returns> public static int CreateDERGroup(string path, String DERGroupName, String[] members, ref String SOAPMessage, ref String SOAPResponse) { CIM c = new CIM(); c._data = DERMSInterface.CIMData.read(path); int rc = c.createDERGroup(DERGroupName, null); SOAPMessage = c.LastMessageSent; SOAPResponse = c.LastMessageReceived; return(rc); }
private void createDERGroup_Click(object sender, System.EventArgs e) { // DERMSInterface.GetDERGroupHeader header = new DERMSInterface.GetDERGroupHeader(); DERMSInterface.CIM cim = new DERMSInterface.CIM(); // default endpoint from app config if not set if (this.getDERGroupEndPoint.Text != null && this.getDERGroupEndPoint.Text.Length > 0) { cim.EndPoint = this.getDERGroupEndPoint.Text; } List <String> derms = new List <string>(); foreach (Control c in DerMemberPanel.Controls.OfType <TextBox>()) { if (c.Text != null && c.Text.Length > 0) { derms.Add(c.Text); } } if (derms.Count > 0) { int reply = cim.createDERGroup(DERGroupText.Text, derms.ToArray <String>()); createDERGroupLogText.Text = ""; createDERGroupLogText.SelectionFont = new Font("Verdana", 12, FontStyle.Bold); createDERGroupLogText.AppendText("Sent:" + Environment.NewLine + Environment.NewLine); createDERGroupLogText.SelectionFont = new Font("Verdana", 10, FontStyle.Regular); createDERGroupLogText.AppendText(cim.LastMessageSent + Environment.NewLine + Environment.NewLine); createDERGroupLogText.SelectionFont = new Font("Verdana", 12, FontStyle.Bold); createDERGroupLogText.AppendText("Reply:" + Environment.NewLine + Environment.NewLine); createDERGroupLogText.SelectionFont = new Font("Verdana", 10, FontStyle.Regular); createDERGroupLogText.AppendText(cim.LastMessageReceived + Environment.NewLine + Environment.NewLine); } }