protected void enroll_click(object sender, EventArgs e) { string _simulatorId = simulatorId.Text.ToLower(); string _custGuid = custGuid.Text; string _membId = membId.Text; string _membFirstName = membFirstName.Text; string _membLastName = membLastName.Text; string _membEmail = membEmail.Text; string _membMemo = membMemo.Text; string _membPrograms = membPrograms.Text; bool _membActive = true; bool OK = true; // do basic form checking if (OK && _simulatorId != _profile.ToLower() + "-backdoor") { OK = false; status.Text = "'simulatorId' is missing or invalid"; } if (OK && _custGuid.Length == 0) { OK = false; status.Text = "'custGuid' is missing"; } if (OK && !function.isGuid(_custGuid)) { OK = false; status.Text = "'custGuid' is invalid"; } if (OK && _membId.Length == 0) { OK = false; status.Text = "'membId' is missing"; } if (OK && _membFirstName.Length == 0) { OK = false; status.Text = "'membFirstName' is missing"; } if (OK && _membLastName.Length == 0) { OK = false; status.Text = "'membLastName' is missing"; } if (OK && _membEmail.Length == 0) { OK = false; status.Text = "'membEmail' is missing"; } if (OK && _membPrograms.Length == 0) { OK = false; status.Text = "'membPrograms' is missing"; } if (OK) { if (membActive.Text == "0") { _membActive = false; } else if (membActive.Text == "1") { _membActive = true; } else { OK = false; status.Text = "'membActive' is missing"; } } if (OK) { // pass the custGuid and the membId to autoEnroll WebService string JSON = v8server.autoEnrollWs( _custGuid, _membId, _membFirstName, _membLastName, _membEmail, _membMemo, _membPrograms, _membActive ); AutoEnrollWs autoEnrollWs = serializer.Deserialize <AutoEnrollWs>(JSON); if (autoEnrollWs.msgId.Substring(0, 3) == "inv") { // change alignment for errors panel.HorizontalAlign = HorizontalAlign.Left; status.Text = "" + "An errors has occurred ('" + autoEnrollWs.msgId + "'). Possible reasons : <br /><br />" + "   - custGuid is invalid;<br />" + "   - custGuid has been inactived;<br />" + "   - membId is invalid;<br />" + "   - membPrograms are invalid;<br /><br />" + ""; } else // pass the profile and membGuid into V8 { string _membGuid = autoEnrollWs.membGuid; string url = "/vubizApps/Default.aspx?appId=vubiz.8&profile=" + _profile + "&membGuid=" + _membGuid; Response.Redirect(url, false); } } }