private void displayPInfo(Participant p)
        {
            txtFirstName.Text     = p.fname;
            this.txtLastName.Text = p.lname;
            this.txtCode.Text     = p.code;
            this.txtCity.Text     = p.city;
            this.txtEmail.Text    = p.email;
            this.txtPhone.Text    = p.pnum;
            this.txtState.Text    = p.state;
            this.txtZip.Text      = p.zip;
            this.txtAddress1.Text = p.add_line_1;
            this.txtAddress2.Text = p.add_line_2;
            List <Participant_Condition> pc = p.Participant_Condition.Where(r =>
                                                                            r.participant_id == p.participant_id).ToList <Participant_Condition>();
            Participant_Condition pc1 = pc.First <Participant_Condition>();
            Condition             con = pc1.Condition;

            if (con != null)
            {
                this.conditionName.SelectedItem = con;
            }
            else
            {
                Console.WriteLine("The con was null");
            }
        }
        /// <summary>
        /// Initializes a new instance of the MainWindow class.
        /// </summary>
        public MainWindow(Participant_Condition pc, PartWindow p)
        {
            this.part_window         = p;
            this.pc                  = pc;
            this.KinectSensorManager = new KinectSensorManager();
            this.KinectSensorManager.KinectSensorChanged += this.KinectSensorChanged;
            //this.DataContext = this.KinectSensorManager;

            this.viewModel = new KinectWindowViewModel();

            // The KinectSensorManager class is a wrapper for a KinectSensor that adds
            // state logic and property change/binding/etc support, and is the data model
            // for KinectDiagnosticViewer.
            this.viewModel.KinectSensorManager = this.KinectSensorManager;

            Binding sensorBinding = new Binding("KinectSensor");

            sensorBinding.Source = this;
            BindingOperations.SetBinding(this.viewModel.KinectSensorManager, KinectSensorManager.KinectSensorProperty, sensorBinding);

            this.DataContext = this.viewModel;

            InitializeComponent();

            foreach (Tag t in db.Tags)
            {
                this.lstTags.Items.Add(t);
            }

            this.SensorChooserUI.KinectSensorChooser = sensorChooser;
        }
Пример #3
0
        public void saveToDatabase(Participant_Condition pc)
        {
            DeceptionDBEntities ent = new DeceptionDBEntities();

            foreach (Raw_Data rawdata in raw.Local)
            {
                rawdata.pc_id = pc.pc_id;
                ent.Raw_Data.Add(rawdata);
            }
            ent.SaveChanges();
        }