private void btnSave_Click(object sender, EventArgs e) { BusinessClient bc = new BusinessClient(); bc.CompanyName = txtCompanyName.Text; bc.PointOfContact = txtPointOfContact.Text; bc.Address1 = txtAddressOne.Text; bc.Address2 = txtAddressTwo.Text; bc.City = txtCity.Text; bc.State = cbxState.Text; bc.Zip = txtZip.Text; bc.Phone = txtPhone.Text; bc.Email = txtEmail.Text; BusinessClientMgr bcMgr = new BusinessClientMgr(); bcMgr.StoreNewBusinessClient(bc); AssignmentForm assignForm = (AssignmentForm)Owner; assignForm.UpdateBusinessClientFromBusinessClientForm(txtCompanyName.Text, txtPointOfContact.Text, txtAddressOne.Text, txtAddressTwo.Text, txtCity.Text, cbxState.Text, txtZip.Text, txtPhone.Text, txtEmail.Text); AfterTheSave(); Close(); }
private void btnSave_Click(object sender, EventArgs e) { Interpreter terp = new Interpreter(); terp.Name = txtName.Text; terp.Address1 = txtAddressOne.Text; terp.Address2 = txtAddressTwo.Text; terp.City = txtCity.Text; terp.State = txtState.Text; terp.Zip = txtZip.Text; terp.Phone = txtPhone.Text; terp.Email = txtEmail.Text; terp.HighestLevelCertification = txtCertification.Text; int i = 0; bool isNumeric = int.TryParse(txtYears.Text, out i); if (isNumeric == true) { terp.YearsOfExperience = Int32.Parse(txtYears.Text); } else { MessageBox.Show("You have entered non-numerical character in Years of Experience textbox. Enter numeric character."); txtYears.Text = ""; return; } InterpreterMgr terpMgr = new InterpreterMgr(); terpMgr.StoreNewInterpreter(terp); AssignmentForm assign = (AssignmentForm)Owner; assign.UpdateInterpreterFromInterpreterForm(txtName.Text); AfterTheSave(); Close(); }