void Add() { //create an instance of TNovation clsCompanyCollection TNovation = new clsCompanyCollection(); //validate the data on the webform Boolean OK = TNovation.ThisCompany.Valid(textBoxCompanyAddress.Text, textBoxCompanyEmailAddress.Text, textBoxInvolvedClient.Text, textBoxInvolvedProject.Text, textBoxMobileNumber.Text, textBoxPhoneNumber.Text); //if the data is OK then add it to the object if (OK == true) { //get the data entered by the user TNovation.ThisCompany.CompanyCode = Convert.ToInt32(textBoxCompanyCode.Text); TNovation.ThisCompany.CompanyAddress = textBoxCompanyAddress.Text; TNovation.ThisCompany.CompanyEmailAddress = textBoxCompanyEmailAddress.Text; TNovation.ThisCompany.InvolvedClient = textBoxInvolvedClient.Text; TNovation.ThisCompany.InvolvedProject = textBoxInvolvedProject.Text; TNovation.ThisCompany.MobileNumber = textBoxMobileNumber.Text; TNovation.ThisCompany.PhoneNumber = textBoxPhoneNumber.Text; //add the record TNovation.Add(); } }