/** * Create Program Account Request. * Initial XML message sent to the Hub requesting a new program account when a new cannabis licence is issued. * The purpose is to receive a Program Account Reference Number required by the Program Account Details Broadcast */ public string CreateXML(MicrosoftDynamicsCRMadoxioLicences licence, string suffix) { if (licence == null) { throw new Exception("licence can not be null"); } if (licence.AdoxioLicencee == null) { throw new Exception("The licence must have an AdoxioLicencee"); } var programAccountRequest = new SBNCreateProgramAccountRequest1(); programAccountRequest.header = GetProgramAccountRequestHeader(licence, suffix); programAccountRequest.body = GetProgramAccountRequestBody(licence, suffix); var serializer = new XmlSerializer(typeof(SBNCreateProgramAccountRequest1)); using (StringWriter textWriter = new StringWriter()) { serializer.Serialize(textWriter, programAccountRequest); return(textWriter.ToString()); } }
/** * Create Program Account Request. * Initial XML message sent to the Hub requesting a new program account when a new cannabis licence is issued. * The purpose is to receive a Program Account Reference Number required by the Program Account Details Broadcast */ public string CreateXML(string guid) { var programAccountRequest = new SBNCreateProgramAccountRequest1(); programAccountRequest.header = GetProgramAccountRequestHeader(); programAccountRequest.body = GetProgramAccountRequestBody(); var serializer = new XmlSerializer(typeof(SBNCreateProgramAccountRequest1)); using (StringWriter textWriter = new StringWriter()) { serializer.Serialize(textWriter, programAccountRequest); return(textWriter.ToString()); } }