private Registration TranslatetoRegistration(Account account)
 {
    Registration registeration = new Registration();
    registeration.userid = account.userID;
    registeration.password = account.password;
    return registeration;
 }
 public Registration CreateAccount(Registration registration)
 {
     Patient patient = TranslatetoPatient(registration);
     CreateUserRequestMessage request = new CreateUserRequestMessage();
     request.patient = patient;
     request.transactiondate = DateTime.Now;
     Service1Client svcclient = new ServiceReference1.Service1Client("BasicHttpBinding_IService1");
     CreateUserResponse response = svcclient.CreateAccount(request);
     registration = TranslatetoRegistration(response.account);
     return registration;
 }
 private Patient TranslatetoPatient(Registration registration)
 {
     Patient patient = new Patient();
     patient.familyName = registration.familyName;
     patient.firstName = registration.firstName;
     patient.lastName = registration.lastName;
     patient.phone =registration.phone;
     patient.address = registration.address;
     patient.sex = registration.sex;
     patient.dob = registration.dob;
     patient.email = registration.email;
     patient.city = registration.city;
     patient.state = registration.state;
     patient.age = registration.age;
     return patient;
 }
 private Registration populateDataObject()
 {
     Registration registration = new Registration();
     registration.familyName = txtfamilyname.Text;
     registration.firstName = txtfirstname.Text;
     registration.lastName = txtlastname.Text;
     registration.phone = txtphone.Text;
     registration.address = txtpermanemtaddress.Text;
     registration.sex = radiobtnfemale.Checked? "F":"M";
     registration.dob = dateTimePickerdob.Value;
     registration.email = txtemail.Text;
     registration.city = txtcity.Text;
     registration.age = numericUpDownage.Value.ToString();
     registration.state = (!txtother.Enabled)?cbostate.SelectedItem.ToString():txtother.Text;
     return registration;
 }