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 Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { int id = -1; id = MiscUtility.ParseInt32(Request["id"], -1); if (id == -1) { m_labelId.Text = id.ToString(); m_textEmailAddress.Text = ""; m_textFirstName.Text = ""; m_textLastName.Text = ""; m_textPhone.Text = ""; m_chkIsActive.Checked = true; } else { WebTestingDataSet.PersonRow person = DatasetUtility.GetPerson(id); m_labelId.Text = person.Id.ToString(); m_textEmailAddress.Text = person.EmailAddress; m_textFirstName.Text = person.FirstName; m_textLastName.Text = person.LastName; m_textPhone.Text = person.PhoneNumber; if (person.Status == "ACTIVE") { m_chkIsActive.Checked = true; } else { m_chkIsActive.Checked = false; } } } }