private void createButton_Click(object sender, System.EventArgs e) { Page.Validate(); if (Page.IsValid) { try { // Create toolkit instance SupportToolkit toolkit = new SupportToolkit(session); // Create setup parameter object with min required parameters. CreateCaseSetup setup = new CreateCaseSetup(this.siteID.Text, this.firstName.Text, this.lastName.Text, this.phone.Text); // Set any additional information for creating the case setup.Title = this.title.Text; setup.PhoneLogNotes = this.notes.Text; // Set any additional fields using the AdditionalFields property of the setup object setup.AdditionalFields.Append("alt_address", AdditionalFieldType.String, "Test"); // Actually create the case ToolkitResult result = toolkit.CreateCase(setup); ResetFormData(); message.Text = "Case created successfully with IDNum '" + result.IDNum + "'."; } catch (Exception ex) { message.Text = ex.Message; } } }
private void createButton_Click(object sender, System.EventArgs e) { Page.Validate(); if (Page.IsValid) { try { // Create toolkit instance InterfacesToolkit toolkit = new InterfacesToolkit(session); ToolkitResult addressResult = toolkit.CreateAddress(address1.Text, city.Text, state.SelectedValue, zip.Text, country.SelectedValue, timeZone.SelectedValue); // Create setup parameter object with min required parameters. CreateSiteSetup setup = new CreateSiteSetup(SiteType.Customer, SiteStatus.Active, addressResult.Objid); // Set any additional information for creating the site setup.SiteName = siteName.Text; setup.SiteIDNum = session.GetNextNumScheme("Site ID"); // Actually create the site ToolkitResult result = toolkit.CreateSite(setup); ResetFormData(); message.Text = "Site created successfully with IDNum '" + result.IDNum + "'."; } catch (Exception ex) { message.Text = ex.Message; } } }