コード例 #1
0
        private void SavePatient()
        {
            // string paths = @"c:\amHealth\images";
            string filePath = @"c:\amHealth\\images\" +fname.Text+"-"+lname.Text +".jpg";
            var encoder = new PngBitmapEncoder();
            encoder.Frames.Add(BitmapFrame.Create((BitmapSource)imgCapture.Source));

            using (FileStream stream = new FileStream(filePath, FileMode.Create))
                encoder.Save(stream);

            _patient = App.amApp.Patients.Add();
            _patient.Lname = lname.Text;
            _patient.Fname = fname.Text;
            _patient.Gender = gender.Text;
            _patient.Dob = dob.Text;
            _patient.Height = height.Text;
            _patient.Weight = weight.Text;
            _patient.Phone = phone.Text;
            _patient.Region = region.Text;
            _patient.Sync = "F";
            _patient.Email = email.Text;
            _patient.Org = "test";
            _patient.Image = fname.Text + "-" + lname.Text + ".jpg";


            _patient.Save();
            System.Windows.MessageBox.Show("Patient saved ");
            this.DialogResult = true;

        }
コード例 #2
0
 private void btnDialogOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         _patient = App.amApp.Patients.Add();               
         _patient.Update(Id, fname.Text,lname.Text,gender.Text,dob.Text, height.Text,weight.Text,phone.Text,email.Text,region.Text);
         this.DialogResult = true;
     }
     catch 
     {
        
     }
 }