示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            ServiceRefHealth.ServiceHealthClient web = new ServiceHealthClient();

            Patient p = new ServiceRefHealth.Patient();

            try
            {
                p.FirstName = textBox2.Text;
                p.LastName  = textBox3.Text;
                p.SNS       = Int32.Parse(textBox6.Text);
                p.oldSNS    = oldSNS;
                p.Birthdate = DateTime.Parse(dateTimePicker1.Text);
                p.Activo    = checkBox1.Checked;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception Message: " + ex.Message);
            }

            bool result = web.AlterPatient(p);

            if (result == true)
            {
                MessageBox.Show("Registado com sucesso!");
                Close();
            }
        }