예제 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ProjectMaster2016.projectmasterDataSet projectmasterDataSet = ((ProjectMaster2016.projectmasterDataSet)(this.FindResource("projectmasterDataSet")));
            // Load data into the table zipcodes. You can modify this code as needed.	
            ProjectMaster2016.projectmasterDataSetTableAdapters.zipcodesTableAdapter projectmasterDataSetzipcodesTableAdapter = new ProjectMaster2016.projectmasterDataSetTableAdapters.zipcodesTableAdapter();
            projectmasterDataSetzipcodesTableAdapter.Fill(projectmasterDataSet.zipcodes);
            System.Windows.Data.CollectionViewSource zipcodesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("zipcodesViewSource")));
            zipcodesViewSource.View.MoveCurrentToFirst();
            // Load data into the table userroles. You can modify this code as needed.	
            ProjectMaster2016.projectmasterDataSetTableAdapters.userrolesTableAdapter projectmasterDataSetuserrolesTableAdapter = new ProjectMaster2016.projectmasterDataSetTableAdapters.userrolesTableAdapter();
            projectmasterDataSetuserrolesTableAdapter.Fill(projectmasterDataSet.userroles);
            System.Windows.Data.CollectionViewSource userrolesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("userrolesViewSource")));
            userrolesViewSource.View.MoveCurrentToFirst();

            try
            {
                //Display default image	
                byte[] imgarray = File.ReadAllBytes("../../images/user.png");
                BitmapImage img = new BitmapImage();
                img.BeginInit();
                img.StreamSource = new System.IO.MemoryStream(imgarray);
                img.EndInit();
                imgImage.Source = img;

                //Save imagearray, because later it is inserted into the DB as App.Current.Properties	
                App.Current.Properties["image"] = imgarray;
            }
            catch (Exception)
            {
                
               
            }
 
        }
예제 #2
0
        private void UpdateWindow()
        {
            ProjectMaster2016.projectmasterDataSet projectmasterDataSet = ((ProjectMaster2016.projectmasterDataSet)(this.FindResource("projectmasterDataSet")));
            // Load data into the table employee. You can modify this code as needed.	
            ProjectMaster2016.projectmasterDataSetTableAdapters.employeeTableAdapter projectmasterDataSetemployeeTableAdapter = new ProjectMaster2016.projectmasterDataSetTableAdapters.employeeTableAdapter();
            projectmasterDataSetemployeeTableAdapter.Fill(projectmasterDataSet.employee);
            System.Windows.Data.CollectionViewSource employeeViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("employeeViewSource")));
            employeeViewSource.View.MoveCurrentToFirst();
            // Load data into the table zipcodes. You can modify this code as needed.	
            ProjectMaster2016.projectmasterDataSetTableAdapters.zipcodesTableAdapter projectmasterDataSetzipcodesTableAdapter = new ProjectMaster2016.projectmasterDataSetTableAdapters.zipcodesTableAdapter();
            projectmasterDataSetzipcodesTableAdapter.Fill(projectmasterDataSet.zipcodes);
            System.Windows.Data.CollectionViewSource zipcodesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("zipcodesViewSource")));
            zipcodesViewSource.View.MoveCurrentToFirst();
            // Load data into the table userroles. You can modify this code as needed.	
            ProjectMaster2016.projectmasterDataSetTableAdapters.userrolesTableAdapter projectmasterDataSetuserrolesTableAdapter = new ProjectMaster2016.projectmasterDataSetTableAdapters.userrolesTableAdapter();
            projectmasterDataSetuserrolesTableAdapter.Fill(projectmasterDataSet.userroles);
            System.Windows.Data.CollectionViewSource userrolesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("userrolesViewSource")));
            userrolesViewSource.View.MoveCurrentToFirst();

            // Setting the value of the hidden userrole id label for the first display	
            int urid = (int)lblurid.Content;
            userroleComboBox.SelectedValue = urid;
        }