public static void Save(WebTestingDataSet.PersonRow person)
		{
			if (person != null)
			{
				PersonTableAdapter adapter = new PersonTableAdapter();
				
				using (UpdateConnection(adapter))
				{
                    adapter.Update(person.Table as WebTestingDataSet.PersonDataTable);
				}
			}
		}
        protected void m_btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                WebTestingDataSet.PersonRow person;

                WebTestingDataSet ds = null;

                if (m_labelId.Text == "-1")
                {
                    // create new
                    ds     = new WebTestingDataSet();
                    person = ds.Person.NewPersonRow();
                }
                else
                {
                    person = DatasetUtility.GetPerson(MiscUtility.ParseInt32(m_labelId.Text, -1));

                    if (person == null)
                    {
                        throw new InvalidOperationException("Invalid id.");
                    }
                }

                person.EmailAddress = m_textEmailAddress.Text;
                person.FirstName    = m_textFirstName.Text;
                person.LastName     = m_textLastName.Text;
                person.PhoneNumber  = m_textPhone.Text;

                if (m_chkIsActive.Checked == true)
                {
                    person.Status = "ACTIVE";
                }
                else
                {
                    person.Status = "INACTIVE";
                }

                if (m_labelId.Text == "-1")
                {
                    ds.Person.AddPersonRow(person);
                }

                DatasetUtility.Save(person);

                m_labelId.Text = person.Id.ToString();
            }
            catch (Exception ex)
            {
                AddMessage(ex);
            }
        }
		protected void m_btnSave_Click(object sender, EventArgs e)
		{
			try
			{
                WebTestingDataSet.PersonRow person;

                WebTestingDataSet ds = null;
				
				if (m_labelId.Text == "-1")
				{
					// create new
                    ds = new WebTestingDataSet();
					person = ds.Person.NewPersonRow();					
				}
				else
				{
					person = DatasetUtility.GetPerson(MiscUtility.ParseInt32(m_labelId.Text, -1));

					if (person == null)
					{
						throw new InvalidOperationException("Invalid id.");
					}
				}

				person.EmailAddress = m_textEmailAddress.Text;
				person.FirstName = m_textFirstName.Text;
				person.LastName = m_textLastName.Text;
				person.PhoneNumber = m_textPhone.Text;

				if (m_chkIsActive.Checked == true)
				{
					person.Status = "ACTIVE";
				}
				else
				{
					person.Status = "INACTIVE";
				}

				if (m_labelId.Text == "-1")
				{
					ds.Person.AddPersonRow(person);
				}

				DatasetUtility.Save(person);				

				m_labelId.Text = person.Id.ToString();
			}
			catch (Exception ex)
			{
				AddMessage(ex);
			}
		}