Inheritance: System.Windows.DependencyObject, IDeferRefresh, ISupportInitialize
コード例 #1
0
 public ProductDropdownFilterViewModel()
 {
     var list = this.GetProducts();
     this.filteredProducts = new CollectionViewSource();
     this.filteredProducts.Source = list;
     this.filteredProducts.Filter += this.ProductFilter;
 }
コード例 #2
0
 public CalligrapherViewModel()
 {
     _viewSource = new CollectionViewSource();
     ObservableCollection<Calligraphyer> calligraphyers = CalligrapherDataHelper.Load();
     _viewSource.Source = calligraphyers;
     //_viewSource.View.CollectionChanged += View_CollectionChanged;
 }
コード例 #3
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            gameCollection = new CollectionViewSource {Source = DataLoader.Games};
            GameList.ItemsSource = gameCollection.View;
        }
コード例 #4
0
        public MyDayViewModel(
            [Import] IEventAggregator aggregator,
            [Import] ITasksService tasksService,
            [Import] IProjectsService projectsService,
            [Import] ITeamService teamService,
            [Import] IBackgroundExecutor executor,
            [Import] IAuthorizationService authorizator)
            : base(aggregator, tasksService, projectsService, teamService, executor, authorizator)
        {
            aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnSignedMemberChanged);

            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskAdded, t => { UpdateTasks(); });
            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskAssigneeChanged, t => { UpdateTasks(); });
            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskChanged, t => { UpdateTasks(); });

            aggregator.Subscribe<ICollection<ProjectInfo>>(ScrumFactoryEvent.RecentProjectChanged, prjs => {
                List<ProjectInfo> prjs2 = new List<ProjectInfo>(prjs);
                if (MemberEngagedProjects != null)
                    prjs2.RemoveAll(p => MemberEngagedProjects.Any(ep => ep.ProjectUId == p.ProjectUId));
                RecentProjects = prjs2.Take(8).ToList();
                OnPropertyChanged("RecentProjects");
            });

            OnLoadCommand = new DelegateCommand(OnLoad);
            RefreshCommand = new DelegateCommand(Load);
            ShowMemberDetailCommand = new DelegateCommand<MemberProfile>(ShowMemberDetail);
            CreateNewProjectCommand = new DelegateCommand(CreateNewProject);

            eventsViewSource = new System.Windows.Data.CollectionViewSource();
        }
コード例 #5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="AutoComplete"/> class.
		/// </summary>
		public AutoComplete( Control value )
		{
			InitializeComponent();

			this.controlUnderAutocomplete = ControlUnderAutoComplete.Create( value );

			this.viewSource = controlUnderAutocomplete.GetViewSource( ( Style )this[ this.controlUnderAutocomplete.StyleKey ] );
			this.viewSource.Filter += OnCollectionViewSourceFilter;

			this.controlUnderAutocomplete.Control.SetValue( Control.StyleProperty, this[ this.controlUnderAutocomplete.StyleKey ] );
			this.controlUnderAutocomplete.Control.ApplyTemplate();

			this.autoCompletePopup = ( Popup )this.controlUnderAutocomplete.Control.Template.FindName( "autoCompletePopup", this.controlUnderAutocomplete.Control );
			this._listBox = ( ListBox )this.controlUnderAutocomplete.Control.Template.FindName( "autoCompleteListBox", this.controlUnderAutocomplete.Control );

			var b = new Binding( "ActualWidth" )
			{
				UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
				Source = this.controlUnderAutocomplete.Control
			};

			this.ListBox.SetBinding( ListBox.MinWidthProperty, b );
			this.ListBox.PreviewMouseDown += OnListBoxPreviewMouseDown;

			this.controlUnderAutocomplete.Control.AddHandler( TextBox.TextChangedEvent, new TextChangedEventHandler( OnTextBoxTextChanged ) );
			this.controlUnderAutocomplete.Control.LostFocus += OnTextBoxLostFocus;
			this.controlUnderAutocomplete.Control.PreviewKeyUp += OnTextBoxPreviewKeyUp;
			this.controlUnderAutocomplete.Control.PreviewKeyDown += OnTextBoxPreviewKeyDown;
		}
コード例 #6
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     figuurViewSource = ((CollectionViewSource)(this.FindResource("figuurViewSource")));
     FiguurManager manager = new FiguurManager();
     figuren = manager.GetFiguren();
     figuurViewSource.Source = figuren;
 }
コード例 #7
0
ファイル: ListPage.xaml.cs プロジェクト: ogazitt/zaplify
        // Constructor
        public ListPage()
        {
            InitializeComponent();

            // trace data
            TraceHelper.AddMessage("ListPage: constructor");

            // set some data context information
            ConnectedIconImage.DataContext = App.ViewModel;
            LayoutRoot.DataContext = App.ViewModel;
            SpeechProgressBar.DataContext = App.ViewModel;
            QuickAddPopup.DataContext = App.ViewModel;

            // set some data context information for the speech UI
            SpeechPopup_SpeakButton.DataContext = this;
            SpeechPopup_CancelButton.DataContext = this;
            SpeechLabel.DataContext = this;

            ImportListViewSource = new CollectionViewSource();
            ImportListViewSource.Filter += new FilterEventHandler(ImportList_Filter);

            SortViewSource = new CollectionViewSource();
            SortViewSource.Filter += new FilterEventHandler(Sort_Filter);

            // add some event handlers
            Loaded += new RoutedEventHandler(ListPage_Loaded);
            BackKeyPress += new EventHandler<CancelEventArgs>(ListPage_BackKeyPress);

            // trace data
            TraceHelper.AddMessage("Exiting ListPage constructor");
        }
コード例 #8
0
ファイル: ImportWizard.xaml.cs プロジェクト: wenh123/PTVS
        public ImportWizard(IServiceProvider serviceProvider, string sourcePath, string projectPath) {
            var interpreterService = serviceProvider.GetComponentModel().GetService<IInterpreterOptionsService>();
            ImportSettings = new ImportSettings(interpreterService);

            _pageSequence = new CollectionViewSource {
                Source = new ObservableCollection<Page>(new Page[] {
                    new FileSourcePage { DataContext = ImportSettings },
                    new InterpreterPage { DataContext = ImportSettings },
                    new SaveProjectPage { DataContext = ImportSettings }
                })
            };
            PageCount = _pageSequence.View.OfType<object>().Count();

            PageSequence = _pageSequence.View;
            PageSequence.CurrentChanged += PageSequence_CurrentChanged;
            PageSequence.MoveCurrentToFirst();

            if (!string.IsNullOrEmpty(sourcePath)) {
                ImportSettings.SetInitialSourcePath(sourcePath);
                Loaded += ImportWizard_Loaded;
            }
            if (!string.IsNullOrEmpty(projectPath)) {
                ImportSettings.SetInitialProjectPath(projectPath);
            }
            ImportSettings.UpdateIsValid();

            DataContext = this;

            InitializeComponent();
        }
コード例 #9
0
 public TicketOrdersViewModel(ITicketService ticketService)
 {
     _ticketService = ticketService;
     _orders = new ObservableCollection<OrderViewModel>();
     _itemsViewSource = new CollectionViewSource { Source = _orders };
     _itemsViewSource.GroupDescriptions.Add(new PropertyGroupDescription("GroupObject"));
 }
コード例 #10
0
        public UserTasksSelectorViewModel(
            [Import]IBackgroundExecutor executor,
            [Import]IEventAggregator aggregator,
            [Import]ITasksService tasksService,
            [Import] IDialogService dialogs,
            [Import]IAuthorizationService authorizator)
        {
            this.executor = executor;
                this.aggregator = aggregator;
                this.tasksService = tasksService;
                this.dialogs = dialogs;

                this.authorizator = authorizator;

                tasksViewSource = new System.Windows.Data.CollectionViewSource();
                notMineTasksViewSource = new System.Windows.Data.CollectionViewSource();

                TrackingTaskInfo = null;

                aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, m => { OnPropertyChanged("SignedMemberUId"); });

                aggregator.Subscribe(ScrumFactoryEvent.ApplicationWhentForeground, () => { LoadTasks(true); });

                aggregator.Subscribe(ScrumFactoryEvent.ShowUserTasksSelector, Show);

                aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskAssigneeChanged, OnTaskChanged);
                aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskChanged, OnTaskChanged);

                ShowTaskDetailCommand = new DelegateCommand<TaskViewModel>(ShowTaskDetail);

                TrackTaskCommand = new DelegateCommand<TaskViewModel>(TrackTask);

               timeKeeper.Tick += new EventHandler(timeKeeper_Tick);
        }
コード例 #11
0
ファイル: SortHelper.cs プロジェクト: Klaudit/inbox2_desktop
 public SortHelper(CollectionViewSource source)
     : base(source)
 {
     // Default behavior
     date = true;
     descending = true;
 }
コード例 #12
0
        private void llenarTablaCliente()
        {

            clienteFacade prodF = new clienteFacade();

            var listaCliente = prodF.getClientes();

            if (listaCliente.Count > 0)
            {
                foreach (var item in listaCliente)
                {
                    ListCliente.Add(new Cliente { rut = item.rut, nombre = item.nombre, cantidadDescuento = item.cantidadDescuento, deuda = item.deuda, fechaUltimaCompra = item.fechaUltimaCompra, totalCompras = item.totalCompras });
                }

                itemCollectionViewSource = (CollectionViewSource)(FindResource("ItemCollectionViewSourceAllCliente"));
                itemCollectionViewSource.Source = ListCliente;

            }
            else
            {
                DateTime fvacio = Convert.ToDateTime("15/08/2008");
                ListCliente.Add(new Cliente { rut = "Sin Clientes", nombre = "", cantidadDescuento = "", deuda = 0,  totalCompras = 0 ,fechaUltimaCompra=fvacio});
                datagridCliente.ItemsSource = listaCliente;


            }
        }
コード例 #13
0
        public void Ctor()
        {
            var vm = new CalendarDetailsViewModel();

            Assert.IsFalse(vm.CanScrollHorizontal);
            Assert.IsTrue(vm.CanScrollVertical);

            Assert.AreEqual(LanguageService.Translate("Cmd_CreateCalendar"), vm.ToolbarItemList.First().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_RemoveCalendar"), vm.ToolbarItemList.Last().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_Save"), vm.WindowCommandItemList.First().Caption);
            Assert.AreEqual(LanguageService.Translate("Cmd_Cancel"), vm.WindowCommandItemList.Last().Caption);

            var daysOfWeek = new ObservableCollection<DayOfWeek>(new[]
                                                                 {
                                                                     DayOfWeek.Sunday,
                                                                     DayOfWeek.Monday,
                                                                     DayOfWeek.Tuesday,
                                                                     DayOfWeek.Wednesday,
                                                                     DayOfWeek.Thursday,
                                                                     DayOfWeek.Friday,
                                                                     DayOfWeek.Saturday
                                                                 });

            CollectionAssert.AreEqual(daysOfWeek, vm.DaysOfWeek);

            var workingIntervals = new CollectionViewSource();
            workingIntervals.SortDescriptions.Add(new SortDescription("StartDate", ListSortDirection.Ascending));
            workingIntervals.SortDescriptions.Add(new SortDescription("FinishDate", ListSortDirection.Ascending));

            CollectionAssert.AreEqual(workingIntervals.SortDescriptions, vm.WorkingIntervals.SortDescriptions);
        }
コード例 #14
0
ファイル: TasksView.xaml.cs プロジェクト: sunilmunikar/TaskR
 public TasksView()
 {
     InitializeComponent();
       var taskCollection = Resources["tasksCollection"];
       if (taskCollection is CollectionViewSource) {
     taskCollectionViewSource = taskCollection as CollectionViewSource;
       }
       if (taskCollectionViewSource != null) {
     taskCollectionViewSource.Filter += (s, e) => {
       var task = e.Item as Task;
       if (task == null) {
     return;
       }
       try {
     if (task.Status != "Closed" || (task.Status == "Closed" && showClosedCheckbox.IsChecked == true)) {
       e.Accepted = true;
     } else {
       e.Accepted = false;
     }
       } catch (Exception ex) {
     e.Accepted = false;
       }
     };
       }
 }
コード例 #15
0
		public DesignTimeMainViewModel()
		{
			IsEmpty = false;
			AvailableWindowWidth = 640;
			AvailableWindowHeight = 240;
			SearchText = "User Query...";
			UpdateAvailable = true;
			var icon = ConvertFromIcon(Properties.Resources.AppIcon);
			Windows = new CollectionViewSource
			{
				Source = new List<ISearchResult>
				{
					new DesignTimeSearchResult(DesignTimeSearchResult.CreateSampleIcon(), "process", "Window Title"),
					new DesignTimeSearchResult(icon, "very long process name", "Very very long window title that should end up with ellipsis because it is so very long"),
					new DesignTimeSearchResult(icon, "error", "This window has an error") { Error = "This is the error message" },
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
					new DesignTimeSearchResult(icon, "filler", "Some Window Title")
				}
			};
		}
コード例 #16
0
ファイル: VMStudent.cs プロジェクト: JiNanCVT/Calligraphy
        public VMStudent()
        {
            students3 = new CollectionViewSource();

            Student stu1 = new Student();
            Student stu2 = new Student();
            stu1.Name = "zhangsan";
            stu1.PhotoBitmapImage1 = "E:\\新建文件夹\\3.png";
            stu2.Name = "lisi";
            stu2.PhotoBitmapImage1 = "E:\\新建文件夹\\4.png";

            students1 = new ObservableCollection<Student>();
            students1.Add(stu1);
            students1.Add(stu2);

            Student stu3 = new Student();
            Student stu4 = new Student();
            stu3.Name = "wangwu";
            stu3.PhotoBitmapImage1 = "E:\\新建文件夹\\1.png";
            stu4.Name = "zhaoliu";
            stu4.PhotoBitmapImage1 = "E:\\新建文件夹\\2.png";

            students2 = new ObservableCollection<Student>();
            students2.Add(stu3);
            students2.Add(stu4);
            students3.Source = students2;
        }
コード例 #17
0
 void OverviewViewLoaded(object sender, System.Windows.RoutedEventArgs e)
 {
     _cvsPullRequests = Resources["cvsPullRequests"] as CollectionViewSource;
     _cvs = Resources["cvs"] as CollectionViewSource;
     _cvs.Filter += CvsFilter;
     _cvsPullRequests.Filter += CvsPullRequestsFilter;
 }
コード例 #18
0
 public FauxDataSource()
 {
     _unitDataSource = new ObservableCollection<Unit>(); ;
     
     int jobid = 5000;
     
     //generate a few thousand Units, with 1 detail(job) each
     for (int i = 1; i <= 3000; i++)
     {
         Random r = new Random(DateTime.Now.Millisecond);
         Unit u = new Unit();
         u.Id = i;
         u.Name = "Unit " + i;
         u.Location = RandomString(10, false);
         u.UnitStatus = (Status) r.Next(1, 6);
         UnitJob j = new UnitJob();
         j.JobId = jobid--;
         j.JobDescription = RandomString(15, false);
         j.UnitId = i;
         j.JobDurationMinutes = r.Next(5, 20);
         u.Jobs = new ObservableCollection<UnitJob>();
         u.Jobs.Add(j);
         _unitDataSource.Add(u);
     }
     
     UnitViewSource = new CollectionViewSource();
     UnitViewSource.Source = _unitDataSource;
     UnitViewSource.IsLiveFilteringRequested = true;
     UnitViewSource.IsLiveSortingRequested = true;
     UnitViewSource.LiveFilteringProperties.Add("UnitStatus");
 }
コード例 #19
0
ファイル: MainViewModel.cs プロジェクト: hva/warehouse.net
        public MainViewModel(IEventAggregator eventAggregator, ISignalRClient signalRClient, IAuthStore authStore,
            IProductsRepository productsRepository)
        {
            this.eventAggregator = eventAggregator;
            this.signalRClient = signalRClient;
            this.productsRepository = productsRepository;

            deleteRequest = new InteractionRequest<Confirmation>();
            CreateProductCommand = new DelegateCommand(CreateProduct);
            OpenProductCommand = new DelegateCommand<Product>(EditProduct);
            changePriceCommand = new DelegateCommand(ChangePrice, HasSelectedProducts);
            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedProducts);

            cvs = new CollectionViewSource();
            items = new ObservableCollection<Product>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Size", ListSortDirection.Ascending));

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }
        }
コード例 #20
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     reservationViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("reservationViewSource")));
     // Load data by setting the CollectionViewSource.Source property:
     // reservationViewSource.Source = [generic data source]
     refreshContext();
 }
コード例 #21
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            try
            {
                //commandRepositoryViewSource.View.CurrentChanging += new System.ComponentModel.CurrentChangingEventHandler(View_CurrentChanging);

                this.Topmost = false;
                commandRepositoryViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("commandRepositoryViewSource")));
                // Load data by setting the CollectionViewSource.Source property:
                commandRepositoryViewSource.Source = RepositoryLibrary.Repositorys;
                commandRepositoryViewSource.View.CurrentChanged += new EventHandler(View_CurrentChanged);
                runCommandViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("runCommandViewSource")));
                // Load data by setting the CollectionViewSource.Source property:
                if (((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem)) != null)
                    runCommandViewSource.Source = ((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem)).Commands;

            }
            catch (Exception ex)
            {


                MyMessageBox b = new MyMessageBox();
                b.ShowMe(ex.Message, "Unhandled error");
                Application.Current.Shutdown();
            }


        }
コード例 #22
0
ファイル: EngagementWindow.xaml.cs プロジェクト: gwupe/Gwupe
 internal EngagementWindow(GwupeClientAppContext appContext, DispatchingCollection<ObservableCollection<Notification>, Notification> notificationList, Engagement engagement)
 {
     InitializeComponent();
     _appContext = appContext;
     Engagement = engagement;
     engagement.PropertyChanged += EngagementOnPropertyChanged;
     try
     {
         ((Components.Functions.RemoteDesktop.Function)Engagement.GetFunction("RemoteDesktop")).Server.ServerConnectionOpened += EngagementOnRDPConnectionAccepted;
         ((Components.Functions.RemoteDesktop.Function)Engagement.GetFunction("RemoteDesktop")).Server.ServerConnectionClosed += EngagementOnRDPConnectionClosed;
     }
     catch (Exception e)
     {
         Logger.Error("Failed to link into function RemoteDesktop : " + e.Message, e);
     }
     _notificationView = new CollectionViewSource { Source = notificationList };
     _notificationView.Filter += NotificationFilter;
     _notificationView.View.Refresh();
     notificationList.CollectionChanged += NotificationListOnCollectionChanged;
     //SetTunnelIndicator(Engagement.IncomingTunnel, IncomingTunnelIndicator);
     //SetTunnelIndicator(Engagement.OutgoingTunnel, OutgoingTunnelIndicator);
     ShowChat();
     _ewDataContext = new EngagementWindowDataContext(_appContext, engagement);
     DataContext = _ewDataContext;
 }
コード例 #23
0
		public HomePage()
		{
			InitializeComponent();

            _HistorySource = (CollectionViewSource)this.Resources["HistorySource"];
			ViewModel.InitCollectionViewSources(_HistorySource);
		}
コード例 #24
0
        private void _Initialize()
        {
            try
            {
                Records = new ObservableCollection<HistoryRecord>();
                RecordsViewSource = new CollectionViewSource();
                RecordsViewSource.Source = Records;


                HistoryRecord hr = new HistoryRecord();
                hr.Id = "123";
                hr.ItemFullPath = "c:\\file.txt";
                hr.Count = 1;
                hr.DeviceName = "user1";
                hr.ItemSize = 100;
                Records.Add(hr);

                hr = new HistoryRecord();
                hr.Id = "123";
                hr.ItemFullPath = "c:\\HAHA.txt";
                hr.Count = 2;
                hr.DeviceName = "user1";
                hr.ItemSize = 100;
                Records.Add(hr);

                

                
            }
            catch (Exception ex)
            {
                
            }
        }
コード例 #25
0
 public FilterHelper(CollectionViewSource view)
     : base(view)
 {
     received = true;
     sent = true;
     concepts = true;
 }
コード例 #26
0
 public WinPicAccidentEdit(Несчастный_случай.DataSet1 ds, CollectionViewSource accidentViewSource, Int32 CategoryID)
 {
     InitializeComponent();
     ds1 = ds;
     ColPhoto = accidentViewSource;
     AID = CategoryID;
 }
コード例 #27
0
        public FamilyData()
        {
            InitializeComponent();

            // Get the data that is bound to the list.
            CollectionViewSource source = new CollectionViewSource();
            source.Source = App.Family;
            FamilyEditor.ItemsSource = source.View;

            // When the family changes we'll update things in this view
            App.Family.ContentChanged += new EventHandler<Microsoft.FamilyShowLib.ContentChangedEventArgs>(OnFamilyContentChanged);

            // Setup the binding to the chart controls.
            ListCollectionView tagCloudView = CreateView("LastName", "LastName");
            tagCloudView.Filter = new Predicate<object>(TagCloudFilter);
            TagCloudControl.View = tagCloudView;

            ListCollectionView histogramView = CreateView("AgeGroup", "AgeGroup");
            histogramView.Filter = new Predicate<object>(HistogramFilter);
            AgeDistributionControl.View = histogramView;
            AgeDistributionControl.CategoryLabels.Add(AgeGroup.Youth, Properties.Resources.AgeGroupYouth);
            AgeDistributionControl.CategoryLabels.Add(AgeGroup.Adult, Properties.Resources.AgeGroupAdult);
            AgeDistributionControl.CategoryLabels.Add(AgeGroup.MiddleAge, Properties.Resources.AgeGroupMiddleAge);
            AgeDistributionControl.CategoryLabels.Add(AgeGroup.Senior, Properties.Resources.AgeGroupSenior);

            BirthdaysControl.PeopleCollection = App.Family;
        }
コード例 #28
0
        public MainWindow()
        {
            InitializeComponent();

            _collectionItems = new List<CollectionItem>();
            _viewCollection = new CollectionViewSource();
            _viewCollection.Filter += ViewCollectionFilter;

            if (File.Exists(CollectionFileName))
            {
                _projectCollection = ProjectCollection.LoadFromFile(CollectionFileName);
                TbRootProjectDir.Text = _projectCollection.RootDir;
                ShowCollection();
                ShowTags();
            }
            else
            {
                TbRootProjectDir.Text = Properties.Settings.Default.RootPath;
                _projectCollection = new ProjectCollection();
            }
            _viewCollection.Source = _collectionItems;
            //_viewCollection.SortDescriptions.Add(new SortDescription("FullPath", ListSortDirection.Ascending));
            LvProjects.ItemsSource = _viewCollection.View;
            _folders = CreateTree();
            _viewFolders = new CollectionViewSource {Source = _folders };
            TvFolders.ItemsSource = _viewFolders.View;
        }
コード例 #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FilterOptionsViewModel"/> class.
        /// </summary>
        public FilterOptionsViewModel()
        {
            FilteredSystemVariables = new CollectionViewSource { Source = SystemVariables };
            FilteredSystemVariables.Filter += FilteredSystemVariablesOnFilter;

            this.defaultValueHolder = new DefaultValueHolder(this);
        }
コード例 #30
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource t_UserInfoViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("t_UserInfoViewSource")));
     // 通过设置 CollectionViewSource.Source 属性加载数据:
     t_UserInfoViewSource.Source = new Model1().t_UserInfo.ToList();
 }
コード例 #31
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource employeeViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("employeeViewSource")));
     // Загрузите данные, установив свойство CollectionViewSource.Source:
     employeeViewSource.Source = empL;
 }
コード例 #32
0
        public PlaylistWindow(
            Playlist?playlist = null,
            IEnumerable <PlaylistTrack>?additionalPlaylistTracks = null,
            Action?refreshOwner = null)
        {
            this.playlist     = playlist;
            this.refreshOwner = refreshOwner;

            InitializeComponent();

            Width  = SystemParameters.PrimaryScreenWidth * .8;
            Height = SystemParameters.PrimaryScreenHeight * .8;

            Loaded  += playlistWindow_Loaded;
            Closing += PlaylistWindow_Closing;
            Closed  += playlistWindow_Closed;

            //tracks
            tracks    = new();
            trackRows = new();
            var trackNo = 0;

            totalDuration = TimeSpan.Zero;
            locations     = new();
            albums        = new();
            artists       = new();
            genres        = new();
            years         = new();

            if (playlist is not null)
            {
                //there is usually a playlist, except when VS tries to display PlaylistWindow
                PlaylistNameTextBox.Text = playlist.Name;
                foreach (var playlistTrack in playlist.PlaylistTracks.GetStoredItems().OrderBy(plt => plt.TrackNo))
                {
                    tracks.Add(playlistTrack.Track);
                    var isAdditionalTrack = additionalPlaylistTracks?.Contains(playlistTrack) ?? false;
                    var trackRow          = new TrackRow(ref trackNo, playlistTrack, updateSelectedCountTextBox, isAdditionalTrack);
                    trackRows.Add(trackRow);
                    if (isAdditionalTrack && firstAddedTrackRow is null)
                    {
                        firstAddedTrackRow = trackRow;
                    }
                }
                DurationTextBox.Text = playlist.TracksDurationHhMm;
                DC.GetTracksStats(ref totalDuration, locations, albums, artists, genres, years, tracks);
            }

            PlaylistNameTextBox.TextChanged += playlistNameTextBox_TextChanged;
            TracksCountTextBox.Text          = tracks.Count.ToString();

            //filter
            FilterTextBox.TextChanged          += filterTextBox_TextChanged;
            ArtistComboBox.SelectionChanged    += filterComboBox_SelectionChanged;
            ArtistComboBox.ItemsSource          = artists;
            AlbumComboBox.SelectionChanged     += filterComboBox_SelectionChanged;
            AlbumComboBox.ItemsSource           = albums;
            AlbumComboBox.DisplayMemberPath     = "AlbumArtist";
            GenreComboBox.SelectionChanged     += filterComboBox_SelectionChanged;
            GenreComboBox.ItemsSource           = genres;
            YearComboBox.SelectionChanged      += yearComboBox_SelectionChanged;
            YearComboBox.ItemsSource            = years;
            LocationsComboBox.SelectionChanged += filterComboBox_SelectionChanged;
            LocationsComboBox.ItemsSource       = locations;
            RemoveCheckBox.Click      += checkBox_Click;
            PlaylistCheckBox.Click    += checkBox_Click;
            ClearButton.Click         += clearButton_Click;
            RemoveAllButton.Click     += removeAllButton_Click;
            PLAllButton.Click         += plAllButton_Click;
            UnselectAllButton.Click   += unselectAllButton_Click;
            ExecuteRemoveButton.Click += executeRemoveButton_Click;
            AddToOtherPlaylistComboBox.ItemsSource = DC.Data.PlaylistStrings.Where(pls => pls != PlaylistNameTextBox.Text);
            AddToOtherPlaylistButton.Click        += addToOtherPlaylistButton_Click;

            //datagrid
            tracksViewSource        = ((System.Windows.Data.CollectionViewSource) this.FindResource("TracksViewSource"));
            tracksViewSource.Source = trackRows;
            tracksViewSource.IsLiveSortingRequested = true;
            tracksViewSource.Filter += tracksViewSource_Filter;
            //strangely, it seems both following lines are needed to make sorting work properly
            TracksDataGrid.Columns[0].SortDirection = ListSortDirection.Ascending;
            tracksViewSource.View.SortDescriptions.Add(new SortDescription("PlaylistTrackNo", ListSortDirection.Ascending));
            TracksDataGrid.Sorting          += tracksDataGrid_Sorting;
            TracksDataGrid.SelectionChanged += tracksDataGrid_SelectionChanged;
            TracksDataGrid.LayoutUpdated    += TracksDataGrid_LayoutUpdated;
            BeginningButton.Click           += beginningButton_Click;
            UpPageButton.Click   += upPageButton_Click;
            UpRowButton.Click    += upRowButton_Click;
            DownRowButton.Click  += downRowButton_Click;
            DownPageButton.Click += downPageButton_Click;
            EndButton.Click      += endButton_Click;
            SaveButton.Click     += saveButton_Click;
            SaveButton.IsEnabled  = false;

            //Replaced: TracksDataGrid.MouseDoubleClick += tracksDataGrid_MouseDoubleClick;
            //Style rowStyle = new Style(typeof(DataGridRow));
            //rowStyle.Setters.Add(new EventSetter(DataGridRow.MouseDoubleClickEvent,
            //                         new MouseButtonEventHandler(tracksDataGrid_MouseDoubleClick)));
            //TracksDataGrid.RowStyle = rowStyle;
            TracksDataGrid.RowStyle.Setters.Add(new EventSetter(DataGridRow.MouseDoubleClickEvent,
                                                                new MouseButtonEventHandler(tracksDataGrid_MouseDoubleClick)));

            TrackPlayer.TrackChanged += trackPlayer_TrackChanged;
            TrackPlayer.Init(getPlayinglist);

            MainWindow.Register(this, "Playlist " + playlist?.Name);
        }
コード例 #33
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Labor.Birja_TrudaDataSet birja_TrudaDataSet = ((Labor.Birja_TrudaDataSet)(this.FindResource("birja_TrudaDataSet")));

            // Загрузить данные в таблицу Vacansies. Можно изменить этот код как требуется.
            // DataTable positionVacansies = new DataTable();
            // positionVacansies.Columns.Add(birja_TrudaDataSet.Vacansies.PositionColumn);
            // birja_TrudaDataSet.Tables.Add(positionVacansies);
            // this.birja_TrudaDataSetVacansiesTableAdapter = new DataAdapter(Birja_TrudaConnectionString).Fill((DataSet)birja_TrudaDataSet);//Columns["Position"]
            //new Birja_TrudaDataSetTableAdapters().Fill(birja_TrudaDataSet);
            //DataColumn headerVacancies = new DataColumn("vacanciesPosition", Type.GetType("System.String"));
            //headerVacancies = birja_TrudaDataSet.Vacansies.Columns;

            //System.Windows.Data.CollectionViewSource vacansiesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("vacansiesViewSource")));

            birja_TrudaDataSetVacansiesTableAdapter.Fill(birja_TrudaDataSet.Vacansies);

            System.Windows.Data.CollectionViewSource vacansiesViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("vacansiesViewSource")));

            //for (int i = 0; i < 5; i++)
            //{
            //    dataGrid.Columns.Add(birja_TrudaDataSet.Vacansie);
            //    //System.Windows.Data.CollectionViewSource vacansiesViewSource.I
            //}

            //var t = new DataTable();

            // create column header
            //foreach (string s in identifiders)
            //{
            //    t.Columns.Add(new DataColumn(s)); // <<=== i'm expecting you don't have defined any DataColumns, haven't you?
            //}

            //// Add data to DataTable
            //for (int lineNumber = identifierLineNumber; lineNumber < lineCount; lineNumber++)
            //{
            //    DataRow newRow = t.NewRow();
            //    for (int column = 0; column < identifierCount; column++)
            //    {
            //        newRow[column] = fileContent.ElementAt(lineNumber)[column];
            //    }
            //    t.Rows.Add(newRow);
            //}

            //return t.DefaultView;


            //foreach (DataRow row in birja_TrudaDataSet.Vacansies)
            //{
            //    var cells = row.ItemArray;
            //    foreach(object cell in cells)
            //    {
            //        dataGrid.Items.Add(cell.ToString());
            //    }
            //}
            // System.Windows.Data.CollectionViewSource vacansiesViewSource =

            // ((System.Windows.Data.CollectionViewSource)(this.FindResource("vacansiesViewSource")));


            vacansiesViewSource.View.MoveCurrentToFirst();

            this.birja_TrudaDataSet = birja_TrudaDataSet;
        }
コード例 #34
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (iD_MTextBox.Text != "")
            {
                try
                {
                    if ((name_of_medicineTextBox.Text == "") || (type_of_medicineTextBox.Text == "") || (dosaseTextBox.Text == ""))
                    {
                        MessageBox.Show("Данные не удалось обновить");
                    }
                    else
                    {
                        DB_Maket.ASSDataSet aSSDataSet = ((DB_Maket.ASSDataSet)(this.FindResource("aSSDataSet")));
                        DB_Maket.ASSDataSetTableAdapters.MedicineTableAdapter aSSDataSetMedicineTableAdapter = new DB_Maket.ASSDataSetTableAdapters.MedicineTableAdapter();
                        aSSDataSetMedicineTableAdapter.Update(aSSDataSet.Medicine);
                        MessageBox.Show("Данные успешно обновлены");
                    }
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show("Данные не удалось обновить");
                }
            }
            else

            if ((name_of_medicineTextBox.Text == "") || (type_of_medicineTextBox.Text == "") || (dosaseTextBox.Text == ""))
            {
                MessageBox.Show("Не удалось добавить запись");
            }
            else
            {
                try
                {
                    SqlConnection con = new SqlConnection("Data Source=DESKTOP-EUL68A7\\SQLEXPRESS;Initial Catalog=ASS;Integrated Security=True");
                    con.Open();
                    SqlCommand cmd = con.CreateCommand();
                    cmd.CommandType = System.Data.CommandType.Text;
                    int pcb;
                    if (prescriptionCheckBox.IsChecked == true)
                    {
                        pcb = 1;
                    }
                    else
                    {
                        pcb = 0;
                    }
                    cmd.CommandText = "INSERT INTO dbo.Medicine (Name_of_medicine,Type_of_medicine,Dosase,Storage_conditions,Usage_descrption,Prescription) VALUES (" + "'" + name_of_medicineTextBox.Text + "'" + "," + type_of_medicineTextBox.Text + "," + dosaseTextBox.Text + "," + "'" + storage_conditionsTextBox.Text + "'" + "," + "'" + usage_descrptionTextBox.Text + "'" + "," + pcb + ");";
                    cmd.ExecuteNonQuery();
                    con.Close();
                    name_of_medicineTextBox.Text   = "";
                    type_of_medicineTextBox.Text   = "";
                    dosaseTextBox.Text             = "";
                    storage_conditionsTextBox.Text = "";
                    usage_descrptionTextBox.Text   = "";
                    prescriptionCheckBox.IsChecked = false;

                    DB_Maket.ASSDataSet aSSDataSet = ((DB_Maket.ASSDataSet)(this.FindResource("aSSDataSet")));
                    // Load data into the table Medicine. You can modify this code as needed.
                    DB_Maket.ASSDataSetTableAdapters.MedicineTableAdapter aSSDataSetMedicineTableAdapter = new DB_Maket.ASSDataSetTableAdapters.MedicineTableAdapter();
                    aSSDataSetMedicineTableAdapter.Fill(aSSDataSet.Medicine);
                    System.Windows.Data.CollectionViewSource medicineViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("medicineViewSource")));


                    MessageBox.Show("Запись успешно добавлена");
                }
                catch
                {
                    MessageBox.Show("Не удалось добавить запись");
                }
            }
        }
//        System.Windows.Forms.Timer timer2 = new System.Windows.Forms.Timer();
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                viewSource1 = new CollectionViewSource();

                экипажиList = de.экипажи.Where(n => n.дистанция == клДистанция.дистанция).OrderBy(n => n.номер).ToList();

                результатыList = de.результаты.Where(n => n.экипажи.дистанция == клДистанция.дистанция)
                                 .OrderBy(n => n.порядок).ThenBy(n => n.экипажи.номер).ThenBy(n => n.попытка).ToList();



                foreach (экипажи eRow in экипажиList)
                {
                    if (результатыList.Where(n => n.экипаж == eRow.экипаж).Count() == 0)
                    {
                        int maxPor = 0;
                        if (результатыList.Any())
                        {
                            maxPor = результатыList.Max(n => n.порядок);
                        }
                        результаты newRow = new результаты
                        {
                            итог      = 0,
                            время_сек = 0,
                            время_мин = 0,
                            попытка   = 1,
                            результат = Guid.NewGuid(),
                            секунд    = 0,
                            штраф     = 0,
                            экипаж    = eRow.экипаж,
                            экипажи   = eRow,
                            зачетный  = false,
                            порядок   = maxPor + 1,
                            старт     = DateTime.Today,
                            финиш     = DateTime.Today
                        };

                        de.результаты.Add(newRow);
                        результатыList.Add(newRow);
                        label1.Visibility = Visibility.Visible;
                    }
                }

                viewSource1.Source    = результатыList;
                dataGrid1.ItemsSource = viewSource1.View;
                наимен_слета.Text     = "Экипажи " + клДистанция.наимен + "   " + клСлет.наимен;
                dataGrid1.Focus();

                //пересчет();

                //bindingSource1.DataSource = binList;
                //bindingSource1.Sort = " номер, попытка";


                this.Closed    += Список_школ_Closed;
                timer1.Interval = 100;
                timer1.Start();

                timer1.Tick += Timer1_Tick;

                //   timer2.Interval = 100;
                //  timer2.Start();
                //   timer2.Tick += Timer2_Tick;
                //viewSource1.View.CollectionChanged += View_CollectionChanged;
                //viewSource1.View.CurrentChanging += View_CurrentChanging;

                //dataGrid1.CellEditEnding += DataGrid1_CellEditEnding;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка загрузки " + ex.Message);
            }
        }
コード例 #36
0
 /// <summary>
 /// Odnalezienie źródła danych i wyświetlenie go.
 /// </summary>
 /// <param name="sender">Parametr sender zawiera odniesienie do kontrolki/obiektu, który wywołał zdarzenie</param>
 /// <param name="e">Routed Event wskazuje na zdarzenie, które jest kierowane</param>
 /// <code>cotext.Products.Load()</code>Załadowanie bazy produktów
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource productsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("productsViewSource")));
     context.Products.Load();
     prodViewSource.Source = context.Products.Local;
 }
コード例 #37
0
        //デザートのページのメソッド
        public void Dezart()
        {
            Uobei.SushiOrderDBDataSet sushiOrderDBDataSet = ((Uobei.SushiOrderDBDataSet)(this.FindResource("sushiOrderDBDataSet")));
            // テーブル 商品テーブル にデータを読み込みます。必要に応じてこのコードを変更できます。
            Uobei.SushiOrderDBDataSetTableAdapters.商品テーブルTableAdapter sushiOrderDBDataSet商品テーブルTableAdapter = new Uobei.SushiOrderDBDataSetTableAdapters.商品テーブルTableAdapter();
            sushiOrderDBDataSet商品テーブルTableAdapter.Fill(sushiOrderDBDataSet.商品テーブル);
            System.Windows.Data.CollectionViewSource 商品テーブルViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("商品テーブルViewSource")));
            商品テーブルViewSource.View.MoveCurrentToFirst();
            var menu = new Menu();

            NavigationService.Navigate(menu);

            #region 写真挿入
            var drv1 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[18];
            if (drv1[5].ToString() == "販売中")
            {
                menu.Button1.IsEnabled = true;
                menu.image1.Source     = (ImageSource) new ImageSourceConverter().ConvertFrom(drv1[4]);
                menu.Button1.Name      = drv1[2].ToString();
            }
            else
            {
                menu.Button1.IsEnabled = false;
            }

            var drv2 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[19];
            if (drv2[5].ToString() == "販売中")
            {
                menu.Button2.IsEnabled = true;
                menu.image2.Source     = (ImageSource) new ImageSourceConverter().ConvertFrom(drv2[4]);
                menu.Button2.Name      = drv2[2].ToString();
            }
            else
            {
                menu.Button2.IsEnabled = false;
            }

            var drv3 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[20];
            if (drv3[5].ToString() == "販売中")
            {
                menu.image3.Source = (ImageSource) new ImageSourceConverter().ConvertFrom(drv3[4]);
                menu.Button3.Name  = drv3[2].ToString();
            }
            else
            {
                menu.Button3.IsEnabled = false;
            }

            var drv4 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[21];
            if (drv4[5].ToString() == "販売中")
            {
                menu.image4.Source = (ImageSource) new ImageSourceConverter().ConvertFrom(drv4[4]);
                menu.Button4.Name  = drv4[2].ToString();
            }
            else
            {
                menu.Button4.IsEnabled = false;
            }

            var drv5 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[22];
            if (drv5[5].ToString() == "販売中")
            {
                menu.image5.Source = (ImageSource) new ImageSourceConverter().ConvertFrom(drv5[4]);
                menu.Button5.Name  = drv5[2].ToString();
            }
            else
            {
                menu.Button5.IsEnabled = false;
            }

            var drv6 = (DataRow)sushiOrderDBDataSet.商品テーブル.Rows[23];
            if (drv6[5].ToString() == "販売中")
            {
                menu.image6.Source = (ImageSource) new ImageSourceConverter().ConvertFrom(drv6[4]);
                menu.Button6.Name  = drv6[2].ToString();
            }
            else
            {
                menu.Button6.IsEnabled = false;
            }
            #endregion
        }
コード例 #38
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource lease_contractViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("lease_contractViewSource")));
 }
コード例 #39
0
ファイル: Products.xaml.cs プロジェクト: jcfontecha/erpcrm
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     // Load data
     productViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ProductViewSource")));
     LoadData();
 }
コード例 #40
0
 private void frmMain_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource phoneNumbersViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("phoneNumbersViewSource")));
     phoneNumbersViewSource.View.MoveCurrentToFirst();
 }
コード例 #41
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource читателиViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("читателиViewSource")));
     // Загрузите данные, установив свойство CollectionViewSource.Source:
     // читателиViewSource.Source = [универсальный источник данных]
 }
コード例 #42
0
        private void BarButtonItem_ItemClick_1(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            int TransactID1 = 0;

            System.Windows.Data.CollectionViewSource uSP_getAllCurrencyViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("uSP_getAllCurrencyViewSource")));

            //coolBlue.RegisterDataSet registerDataSet = ((coolBlue.RegisterDataSet)(this.FindResource("registerDataSet")));


            // int accountCurrent = 0;
            int wasnull = 0;

            // wasnull = (uSP_getAllAccountTypesUSP_getAllAccountsViewSource.View == null ? 1 : 0);
            if (wasnull == 1)
            {
                // MessageBox.Show("Warning: uSP_getLineViewSource is null", "CoolBlue");
                string message = "Warning: uSP_getAllCurrencyViewSource is null";
                string caption = "CoolBlue";

                MessageBoxButton  buttons       = MessageBoxButton.OK;
                MessageBoxImage   icon          = MessageBoxImage.Information;
                MessageBoxResult  defaultResult = MessageBoxResult.OK;
                MessageBoxOptions options       = MessageBoxOptions.RtlReading;
                // Show message box
                // MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                // Displays the MessageBox.
                MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                if (result == MessageBoxResult.OK)
                {
                    // Closes the parent form.

                    //this.Close();
                }
                return;
            }
            else
            {
                //DataRowView drv = (DataRowView)uSP_getAllAccountTypesUSP_getAllAccountsViewSource.View.CurrentItem;
                //accountCurrent = (drv == null ? 0 : DBNull.Value.Equals(drv["ID"]) == true ? 0 : (int)drv["ID"]);
            }



            SqlConnection conn = new SqlConnection()
            {
                ConnectionString = ProgramSettings.coolblueconnectionString
            };

            try
            {
                using (SqlCommand cmd3 = new SqlCommand()
                {
                    Connection = conn, CommandType = CommandType.StoredProcedure
                })
                {
                    //cmd3.Transaction = trans1;
                    cmd3.Parameters.Clear();
                    cmd3.CommandText = "dbo.USP_insertCurrency";
                    //cmd3.Parameters.AddWithValue("@nAccount", accountCurrent);

                    SqlParameter retval = cmd3.Parameters.Add("@transactIdentity", SqlDbType.Int);
                    retval.Direction = ParameterDirection.Output;
                    conn.Open();
                    cmd3.ExecuteNonQuery();
                    TransactID1 = (int)cmd3.Parameters["@transactIdentity"].Value;
                }
            }


            catch (Exception ex)
            {
                //utilities.errorLog(System.Reflection.MethodInfo.GetCurrentMethod().Name, ex);
                System.ArgumentException argEx = new System.ArgumentException("New Line", "", ex);
                throw argEx;
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }


                int          currencyCurrent = TransactID1;
                editCurrency editCurrency1   = new editCurrency(currencyCurrent);
                editCurrency1.ShowDialog();

                coolBlue.EditDataSet editDataSet = ((coolBlue.EditDataSet)(this.FindResource("editDataSet")));

                coolBlue.EditDataSetTableAdapters.USP_getAllCurrencyTableAdapter editDataSetUSP_getAllCurrencyTableAdapter = new coolBlue.EditDataSetTableAdapters.USP_getAllCurrencyTableAdapter();

                editDataSet.EnforceConstraints = false;
                editDataSetUSP_getAllCurrencyTableAdapter.Fill(editDataSet.USP_getAllCurrency);
                editDataSet.EnforceConstraints = true;

                uSP_getAllCurrencyViewSource.View.MoveCurrentToFirst();
            }
        }
コード例 #43
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     dataDoPicker.SelectedDate = DateTime.Now;
     System.Windows.Data.CollectionViewSource wypozyczenieViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("wypozyczenieViewSource")));
     wypozyczenieViewSource.Source = context.wypozyczenie.ToList();
 }
コード例 #44
0
 private void frmMain_Loaded(object sender, RoutedEventArgs e)
 {
     Coptil_Anamaria_Lab5.PhoneNumbersDataSet phoneNumbersDataSet    = ((Coptil_Anamaria_Lab5.PhoneNumbersDataSet)(this.FindResource("phoneNumbersDataSet")));
     System.Windows.Data.CollectionViewSource phoneNumbersViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("phoneNumbersViewSource")));
     phoneNumbersViewSource.View.MoveCurrentToFirst();
 }
コード例 #45
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource testerViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("testerViewSource")));
     // Load data by setting the CollectionViewSource.Source property:
     // testerViewSource.Source = [generic data source]
 }
コード例 #46
0
ファイル: Window3.xaml.cs プロジェクト: ArturGhi/licenta
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            licenta.test test = ((licenta.test)(this.FindResource("test")));
            // Load data into the table Angajat. You can modify this code as needed.
            licenta.testTableAdapters.AngajatTableAdapter testAngajatTableAdapter = new licenta.testTableAdapters.AngajatTableAdapter();
            testAngajatTableAdapter.Fill(test.Angajat);
            System.Windows.Data.CollectionViewSource angajatViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("angajatViewSource")));
            angajatViewSource.View.MoveCurrentToFirst();
            licenta.licentaDataSet licentaDataSet = ((licenta.licentaDataSet)(this.FindResource("licentaDataSet")));
            // Load data into the table Departament. You can modify this code as needed.
            licenta.licentaDataSetTableAdapters.DepartamentTableAdapter licentaDataSetDepartamentTableAdapter = new licenta.licentaDataSetTableAdapters.DepartamentTableAdapter();
            licentaDataSetDepartamentTableAdapter.Fill(licentaDataSet.Departament);
            System.Windows.Data.CollectionViewSource departamentViewSource1 = ((System.Windows.Data.CollectionViewSource)(this.FindResource("departamentViewSource1")));
            departamentViewSource1.View.MoveCurrentToFirst();
            // Load data into the table Pontaj. You can modify this code as needed.
            licenta.licentaDataSetTableAdapters.PontajTableAdapter licentaDataSetPontajTableAdapter = new licenta.licentaDataSetTableAdapters.PontajTableAdapter();
            licentaDataSetPontajTableAdapter.Fill(licentaDataSet.Pontaj);
            System.Windows.Data.CollectionViewSource pontajViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("pontajViewSource")));
            pontajViewSource.View.MoveCurrentToFirst();
            // Load data into the table Pontaj_management. You can modify this code as needed.
            licenta.licentaDataSetTableAdapters.Pontaj_managementTableAdapter licentaDataSetPontaj_managementTableAdapter = new licenta.licentaDataSetTableAdapters.Pontaj_managementTableAdapter();
            licentaDataSetPontaj_managementTableAdapter.Fill(licentaDataSet.Pontaj_management);
            System.Windows.Data.CollectionViewSource pontaj_managementViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("pontaj_managementViewSource")));
            pontaj_managementViewSource.View.MoveCurrentToFirst();
            // Load data into the table Comanda. You can modify this code as needed.
            licenta.testTableAdapters.ComandaTableAdapter testComandaTableAdapter = new licenta.testTableAdapters.ComandaTableAdapter();
            testComandaTableAdapter.Fill(test.Comanda);
            System.Windows.Data.CollectionViewSource comandaViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("comandaViewSource")));
            comandaViewSource.View.MoveCurrentToFirst();
            // Load data into the table Proiect. You can modify this code as needed.
            licenta.testTableAdapters.ProiectTableAdapter testProiectTableAdapter = new licenta.testTableAdapters.ProiectTableAdapter();
            testProiectTableAdapter.Fill(test.Proiect);
            System.Windows.Data.CollectionViewSource proiectViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("proiectViewSource")));
            proiectViewSource.View.MoveCurrentToFirst();
            // Load data into the table Cerere. You can modify this code as needed.
            licenta.testTableAdapters.CerereTableAdapter testCerereTableAdapter = new licenta.testTableAdapters.CerereTableAdapter();
            testCerereTableAdapter.Fill(test.Cerere);
            System.Windows.Data.CollectionViewSource cerereViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("cerereViewSource")));
            cerereViewSource.View.MoveCurrentToFirst();
            // Load data into the table User. You can modify this code as needed.
            licenta.testTableAdapters.UserTableAdapter testUserTableAdapter = new licenta.testTableAdapters.UserTableAdapter();
            testUserTableAdapter.Fill(test.User);
            System.Windows.Data.CollectionViewSource userViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("userViewSource")));
            userViewSource.View.MoveCurrentToFirst();
            datagrid1.Columns[4].Visibility = Visibility.Collapsed;
            datagrid1.Columns[5].Visibility = Visibility.Collapsed;
            datagrid1.Columns[6].Visibility = Visibility.Collapsed;
            // datagrid1.Columns[7].Visibility = Visibility.Collapsed;
            datagrid4.Columns[3].Visibility   = Visibility.Collapsed;
            datagrid5.Columns[3].Visibility   = Visibility.Collapsed;
            datagridpon.Columns[8].Visibility = Visibility.Collapsed;
            datagridpon.Columns[7].Visibility = Visibility.Collapsed;
            datagird.Columns[5].Visibility    = Visibility.Collapsed;
            combobox.SelectedIndex            = -1;
            // Load data into the table Sugestie. You can modify this code as needed.
            licenta.licentaDataSetTableAdapters.SugestieTableAdapter licentaDataSetSugestieTableAdapter = new licenta.licentaDataSetTableAdapters.SugestieTableAdapter();
            licentaDataSetSugestieTableAdapter.Fill(licentaDataSet.Sugestie);
            System.Windows.Data.CollectionViewSource sugestieViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("sugestieViewSource")));
            sugestieViewSource.View.MoveCurrentToFirst();


            this.datagrid1.Columns[1].Header = "Angajat";
            this.datagrid1.Columns[2].Header = "Departament";
            this.datagrid1.Columns[3].Header = "Telefon";
            this.data.Columns[1].Header      = "Nume departament";
            this.datagrid7.Columns[1].Header = "Angajat";
            this.datagrid7.Columns[2].Header = "Cerere";
            this.datagrid7.Columns[3].Header = "Stare";
            this.datagrid7.Columns[4].Header = "Data";
            this.datagrid4.Columns[1].Header = "Nr comanda";
            this.datagrid4.Columns[2].Header = "Comanda";
            this.datagrid5.Columns[1].Header = "Nr proiect";
            this.datagrid5.Columns[2].Header = "Proiect";
            this.data1.Columns[1].Header     = "Tip";
            this.data1.Columns[2].Header     = "Nume";
            this.data1.Columns[3].Header     = "Text";
            this.datagird.Columns[2].Header  = "Data";
            this.datagird.Columns[3].Header  = "Ora intrare";
            this.datagird.Columns[4].Header  = "Creat intrare";
            this.datagird.Columns[6].Header  = "Tip";
            this.datagird.Columns[7].Header  = "Ora iesire";
            this.datagird.Columns[8].Header  = "Creat iesire";

            this.datagridpon.Columns[1].Header = "Angajat";
            this.datagridpon.Columns[2].Header = "Data";
            this.datagridpon.Columns[3].Header = "Ora";
            this.datagridpon.Columns[4].Header = "Nr proiect";
            this.datagridpon.Columns[5].Header = "Nr comanda";
            this.datagridpon.Columns[6].Header = "Data creare";
        }
コード例 #47
0
ファイル: MainWindow.xaml.cs プロジェクト: chavp/MVVMNinja
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource projectViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("projectViewSource")));
     // Load data by setting the CollectionViewSource.Source property:
     projectViewSource.Source = new DataServiceStub().GetProjects();
 }
コード例 #48
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource noteViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("noteViewSource")));
     // Charger les données en définissant la propriété CollectionViewSource.Source :
     // noteViewSource.Source = [source de données générique]
 }
コード例 #49
0
        private void SimpleButtonNewPVMaster_Click(object sender, RoutedEventArgs e)
        {
            int nProjectsID = Settings.Default.nCurrentProjectID;

            Net_Zero.Masters masters = ((Net_Zero.Masters)(this.FindResource("masters")));
            int TransactID1          = 0;

            System.Windows.Data.CollectionViewSource getPVMasterViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getPVMasterViewSource")));

            Net_Zero.MastersTableAdapters.getPVMasterTableAdapter mastersgetPVMasterTableAdapter = new Net_Zero.MastersTableAdapters.getPVMasterTableAdapter();



            DataRowView drv = (DataRowView)getPVMasterViewSource.View.CurrentItem;
            //int accountCurrent = (drv == null ? 0 : DBNull.Value.Equals(drv["ID"]) == true ? 0 : (int)drv["ID"]);

            //int lineCurrent = 0;
            int wasnull = 0;

            wasnull = (getPVMasterViewSource.View == null ? 1 : 0);
            if (wasnull == 1)
            {
                // MessageBox.Show("Warning: uSP_getLineViewSource is null", "CoolBlue");
                string message = "Warning: getPVViewSource is null";
                string caption = "Net-Zero";

                MessageBoxButton  buttons       = MessageBoxButton.OK;
                MessageBoxImage   icon          = MessageBoxImage.Information;
                MessageBoxResult  defaultResult = MessageBoxResult.OK;
                MessageBoxOptions options       = MessageBoxOptions.RtlReading;
                // Show message box
                // MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                // Displays the MessageBox.
                MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                if (result == MessageBoxResult.OK)
                {
                    // Closes the parent form.

                    //this.Close();
                }
                return;
            }
            else
            {
                DataRowView drv1 = (DataRowView)getPVMasterViewSource.View.CurrentItem;
                //lineCurrent = (drv1 == null ? 0 : DBNull.Value.Equals(drv1["ID"]) == true ? 0 : (int)drv1["ID"]);
            }



            if (getPVMasterViewSource.View != null)

            {
                SqlConnection conn1 = new SqlConnection()
                {
                    ConnectionString = ProgramSettings.net_zeroconnectionString
                };
                //getPVViewSource.View.MoveCurrentToFirst();

                try
                {
                    using (SqlCommand cmd3 = new SqlCommand()
                    {
                        Connection = conn1, CommandType = CommandType.StoredProcedure
                    })
                    {
                        //cmd3.Transaction = trans1;
                        cmd3.Parameters.Clear();
                        cmd3.CommandText = "dbo.USP_insertPVMaster";

                        cmd3.Parameters.AddWithValue("@cModel", "Model");
                        cmd3.Parameters.AddWithValue("@cBrand", "Brand");
                        cmd3.Parameters.AddWithValue("@nPmax", 0);
                        cmd3.Parameters.AddWithValue("@nVmp", 0);
                        cmd3.Parameters.AddWithValue("@nImp", 0);
                        cmd3.Parameters.AddWithValue("@nVoc", 0);
                        cmd3.Parameters.AddWithValue("@nIsc", 0);
                        cmd3.Parameters.AddWithValue("@nWeight_kg", 0);
                        cmd3.Parameters.AddWithValue("@nLength_mm", 0);
                        cmd3.Parameters.AddWithValue("@nHeight_mm", 0);
                        cmd3.Parameters.AddWithValue("@nWidth_mm", 0);
                        cmd3.Parameters.AddWithValue("@cFrame", "");
                        cmd3.Parameters.AddWithValue("@cVendor", "");
                        cmd3.Parameters.AddWithValue("@nPrice", 0);
                        cmd3.Parameters.AddWithValue("@nPriority", 0);

                        cmd3.Parameters.AddWithValue("@cURL", "");



                        SqlParameter retval = cmd3.Parameters.Add("@transactIdentity", SqlDbType.Int);
                        retval.Direction = ParameterDirection.Output;
                        conn1.Open();
                        cmd3.ExecuteNonQuery();
                        TransactID1 = (int)cmd3.Parameters["@transactIdentity"].Value;
                    }
                }


                catch (Exception ex)
                {
                    //utilities.errorLog(System.Reflection.MethodInfo.GetCurrentMethod().Name, ex);
                    System.ArgumentException argEx = new System.ArgumentException("New Line", "", ex);
                    throw argEx;
                }
                finally
                {
                    if (conn1.State == ConnectionState.Open)
                    {
                        conn1.Close();
                    }

                    mastersgetPVMasterTableAdapter.Fill(masters.getPVMaster);
                }



                //getPVViewSource.View.MoveCurrentToNext();
            }
        }
コード例 #50
0
        private void BarButtonItem_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            //int TransactID1 = 0;
            string notes = "";

            string name = "";

            System.Windows.Data.CollectionViewSource uSP_getOneCatViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("uSP_getOneCatViewSource")));

            coolBlue.CategoriesDataSet categoriesDataSet = ((coolBlue.CategoriesDataSet)(this.FindResource("categoriesDataSet")));


            //int accountCurrent = 0;
            int wasnull = 0;

            wasnull = (uSP_getOneCatViewSource.View == null ? 1 : 0);
            if (wasnull == 1)
            {
                // MessageBox.Show("Warning: uSP_getLineViewSource is null", "CoolBlue");
                string message = "Warning:uSP_getOneVendorViewSource is null";
                string caption = "CoolBlue";

                MessageBoxButton  buttons       = MessageBoxButton.OK;
                MessageBoxImage   icon          = MessageBoxImage.Information;
                MessageBoxResult  defaultResult = MessageBoxResult.OK;
                MessageBoxOptions options       = MessageBoxOptions.RtlReading;
                // Show message box
                // MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                // Displays the MessageBox.
                MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                if (result == MessageBoxResult.OK)
                {
                    // Closes the parent form.

                    //this.Close();
                }
                return;
            }
            else
            {
                DataRowView drv = (DataRowView)uSP_getOneCatViewSource.View.CurrentItem;
                //accountCurrent = (drv == null ? 0 : DBNull.Value.Equals(drv["ID"]) == true ? 0 : (int)drv["ID"]);
                notes = (DBNull.Value.Equals(drv["cNote"]) == true ? "" : (string)drv["cNote"]);

                name = (DBNull.Value.Equals(drv["cName"]) == true ? "" : (string)drv["cName"]);
            }



            SqlConnection conn = new SqlConnection()
            {
                ConnectionString = ProgramSettings.coolblueconnectionString
            };

            try
            {
                using (SqlCommand cmd3 = new SqlCommand()
                {
                    Connection = conn, CommandType = CommandType.StoredProcedure
                })
                {
                    //cmd3.Transaction = trans1;
                    cmd3.Parameters.Clear();
                    cmd3.CommandText = "dbo.USP_updateCat";
                    cmd3.Parameters.AddWithValue("@ID", nCatID);
                    cmd3.Parameters.AddWithValue("@notes", notes);

                    cmd3.Parameters.AddWithValue("@name", name);


                    //SqlParameter retval = cmd3.Parameters.Add("@transactIdentity", SqlDbType.Int);
                    //retval.Direction = ParameterDirection.Output;
                    conn.Open();
                    cmd3.ExecuteNonQuery();
                    //TransactID1 = (int)cmd3.Parameters["@transactIdentity"].Value;
                }
            }


            catch (Exception ex)
            {
                //utilities.errorLog(System.Reflection.MethodInfo.GetCurrentMethod().Name, ex);
                System.ArgumentException argEx = new System.ArgumentException("New Line", "", ex);
                throw argEx;
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }

                //VendorDataSet.EnforceConstraints = false;

                //coolBlue.vendorDataSetTableAdapters.USP_getOneVendorTableAdapter vendorDataSetUSP_getOneVendorTableAdapter = new coolBlue.vendorDataSetTableAdapters.USP_getOneVendorTableAdapter();


                //vendorDataSetUSP_getOneVendorTableAdapter.Fill(VendorDataSet.USP_getOneVendor, nVendorID);

                //VendorDataSet.EnforceConstraints = true;

                //uSP_getLineDataGrid.

                //uSP_getAllAccountTypesUSP_getAllAccountsViewSource.View.MoveCurrentToPosition(0);

                //resetButtons();
                // LocateNewLine(TransactID1);
                this.Close();
            }
        }
コード例 #51
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     this.dbcontext        = new timetableCreationEntities3();
     this.moduleViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("moduleViewSource")));
     refreshListView();
 }
コード例 #52
0
 public AddFriendPage()
 {
     InitializeComponent();
     playerDCViewSource        = ((System.Windows.Data.CollectionViewSource)(this.FindResource("playerDCViewSource")));
     playerDCViewSource.Source = new List <PlayerDC>();
 }
コード例 #53
0
        public void SavePVMaster()
        {
            System.Windows.Data.CollectionViewSource getPVMasterViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("getPVMasterViewSource")));

            int nProjectsID = Settings.Default.nCurrentProjectID;

            DataRowView drv = (DataRowView)getPVMasterViewSource.View.CurrentItem;
            //int accountCurrent = (drv == null ? 0 : DBNull.Value.Equals(drv["ID"]) == true ? 0 : (int)drv["ID"]);

            //int lineCurrent = 0;
            int wasnull = 0;

            wasnull = (getPVMasterViewSource.View == null ? 1 : 0);
            if (wasnull == 1)
            {
                // MessageBox.Show("Warning: uSP_getLineViewSource is null", "CoolBlue");
                string message = "Warning: getPVMasterViewSource is null";
                string caption = "Net-Zero";

                MessageBoxButton  buttons       = MessageBoxButton.OK;
                MessageBoxImage   icon          = MessageBoxImage.Information;
                MessageBoxResult  defaultResult = MessageBoxResult.OK;
                MessageBoxOptions options       = MessageBoxOptions.RtlReading;
                // Show message box
                // MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                // Displays the MessageBox.
                MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);

                if (result == MessageBoxResult.OK)
                {
                    // Closes the parent form.

                    //this.Close();
                }
                return;
            }
            else
            {
                DataRowView drv1 = (DataRowView)getPVMasterViewSource.View.CurrentItem;
                //lineCurrent = (drv1 == null ? 0 : DBNull.Value.Equals(drv1["ID"]) == true ? 0 : (int)drv1["ID"]);
            }



            if (getPVMasterViewSource.View != null)

            {
                SqlConnection conn1 = new SqlConnection()
                {
                    ConnectionString = ProgramSettings.net_zeroconnectionString
                };
                getPVMasterViewSource.View.MoveCurrentToFirst();
                for (int i = 0; i - 1 < i++; i++)
                {
                    DataRowView drv3 = (DataRowView)getPVMasterViewSource.View.CurrentItem;
                    int         nID  = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nID"]) == true ? 0 : (int)drv3["nID"]);
                    //MessageBox.Show(ID.ToString());

                    if (nID == 0)
                    {
                        break;
                    }

                    decimal nPrice = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nPrice"]) == true ? 0 : (decimal)drv3["nPrice"]);
                    // MessageBox.Show(nAmnt.ToString());



                    string cURL    = (DBNull.Value.Equals(drv3["cURL"]) == true ? "" : (string)drv3["cURL"]);
                    string cVendor = (DBNull.Value.Equals(drv3["cVendor"]) == true ? "" : (string)drv3["cVendor"]);

                    string cFrame = (DBNull.Value.Equals(drv3["cFrame"]) == true ? "" : (string)drv3["cFrame"]);
                    string cBrand = (DBNull.Value.Equals(drv3["cBrand"]) == true ? "" : (string)drv3["cBrand"]);
                    string cModel = (DBNull.Value.Equals(drv3["cModel"]) == true ? "" : (string)drv3["cModel"]);


                    Boolean bDeleted = (drv3 == null ? false : DBNull.Value.Equals(drv3["bDeleted"]) == true ? false : (bool)drv3["bDeleted"]);


                    decimal nPmax      = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nPmax"]) == true ? 0 : (decimal)drv3["nPmax"]);
                    decimal nVmp       = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nVmp"]) == true ? 0 : (decimal)drv3["nVmp"]);
                    decimal nImp       = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nImp"]) == true ? 0 : (decimal)drv3["nImp"]);
                    decimal nVoc       = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nVoc"]) == true ? 0 : (decimal)drv3["nVoc"]);
                    decimal nIsc       = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nIsc"]) == true ? 0 : (decimal)drv3["nIsc"]);
                    decimal nWeight_kg = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nWeight_kg"]) == true ? 0 : (decimal)drv3["nWeight_kg"]);
                    decimal nLength_mm = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nLength_mm"]) == true ? 0 : (decimal)drv3["nLength_mm"]);
                    decimal nHeight_mm = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nHeight_mm"]) == true ? 0 : (decimal)drv3["nHeight_mm"]);
                    decimal nWidth_mm  = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nWidth_mm"]) == true ? 0 : (decimal)drv3["nWidth_mm"]);
                    decimal nPriority  = (drv3 == null ? 0 : DBNull.Value.Equals(drv3["nPriority"]) == true ? 0 : (decimal)drv3["nPriority"]);

                    /////write new record to dbo.split

                    //SqlConnection conn1 = new SqlConnection() { ConnectionString = ProgramSettings.coolblueconnectionString };
                    try
                    {
                        using (SqlCommand cmd3 = new SqlCommand()
                        {
                            Connection = conn1, CommandType = CommandType.StoredProcedure
                        })
                        {
                            //cmd3.Transaction = trans1;
                            cmd3.Parameters.Clear();
                            cmd3.CommandText = "dbo.USP_updatePVMaster";
                            cmd3.Parameters.AddWithValue("@nID", nID);

                            cmd3.Parameters.AddWithValue("@cModel", cModel);
                            cmd3.Parameters.AddWithValue("@cBrand", cBrand);
                            cmd3.Parameters.AddWithValue("@nPmax", nPmax);
                            cmd3.Parameters.AddWithValue("@nVmp", nVmp);
                            cmd3.Parameters.AddWithValue("@nImp", nImp);
                            cmd3.Parameters.AddWithValue("@nVoc", nVoc);
                            cmd3.Parameters.AddWithValue("@nIsc", nIsc);
                            cmd3.Parameters.AddWithValue("@nWeight_kg", nWeight_kg);
                            cmd3.Parameters.AddWithValue("@nLength_mm", nLength_mm);
                            cmd3.Parameters.AddWithValue("@nHeight_mm", nHeight_mm);
                            cmd3.Parameters.AddWithValue("@nWidth_mm", nWidth_mm);
                            cmd3.Parameters.AddWithValue("@cFrame", cFrame);
                            cmd3.Parameters.AddWithValue("@cVendor", cVendor);
                            cmd3.Parameters.AddWithValue("@nPrice", nPrice);
                            cmd3.Parameters.AddWithValue("@nPriority", nPriority);
                            cmd3.Parameters.AddWithValue("@cURL", cURL);

                            cmd3.Parameters.AddWithValue("@bDeleted", bDeleted);



                            //SqlParameter retval = cmd3.Parameters.Add("@transactIdentity", SqlDbType.Int);
                            //retval.Direction = ParameterDirection.Output;
                            conn1.Open();
                            cmd3.ExecuteNonQuery();
                        }
                    }


                    catch (Exception ex)
                    {
                        //utilities.errorLog(System.Reflection.MethodInfo.GetCurrentMethod().Name, ex);
                        System.ArgumentException argEx = new System.ArgumentException("New Line", "", ex);
                        throw argEx;
                    }
                    finally
                    {
                        if (conn1.State == ConnectionState.Open)
                        {
                            conn1.Close();
                        }

                        //registerDataSet.EnforceConstraints = false;

                        //registerDataSetUSP_getSplitTableAdapter.Fill(registerDataSet.USP_getSplit, accountCurrent);
                        //registerDataSetUSP_getLineTableAdapter.Fill(registerDataSet.USP_getLine, accountCurrent);
                        //registerDataSet.EnforceConstraints = true;

                        ////uSP_getLineDataGrid.

                        ////uSP_getAllAccountTypesUSP_getAllAccountsViewSource.View.MoveCurrentToPosition(0);

                        ////resetButtons();
                        //LocateNewLine(TransactID1);
                    }
                    getPVMasterViewSource.View.MoveCurrentToNext();
                }
            }
        }
コード例 #54
0
 public DeferHelper(CollectionViewSource target)
 {
     _target = target;
     _target.BeginDefer();
 }
コード例 #55
0
        private static void OnIsLiveGroupingRequestedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CollectionViewSource cvs = (CollectionViewSource)d;

            cvs.OnForwardedPropertyChanged();
        }
        private void refreshData()
        {
            System.Windows.Data.CollectionViewSource aChampionshipEventsResultsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("aChampionshipEventsResultsViewSource")));
            // Load data by setting the CollectionViewSource.Source property:
            aChampionshipEventsResultsViewSource.Source = Event.Results.OrderBy(r => r.Rank);
            this.resultsDataGrid.ItemsSource            = null;
            this.resultsDataGrid.ItemsSource            = Event.Results.OrderBy(r => r.Rank);
            //this.resultsDataGrid.DataContext = Event.Results;

            if (selectedResult != null)
            {
                this.resultsDataGrid.SelectedItem = selectedResult;
            }

            this.dgScoringTeams.ItemsSource = Event.getScoringTeams().Where(e => e.Rank > 0);

            if (Event is IHeatEvent)
            {
                IHeatEvent iEvent = (IHeatEvent)Event;
                if (iEvent.Final.Files.Count() > 0)
                {
                    this.btnShowScannedResults.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    this.btnShowScannedResults.Visibility = System.Windows.Visibility.Collapsed;
                }
            }
            else
            {
                if (Event.Files.Count() > 0)
                {
                    this.btnShowScannedResults.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    this.btnShowScannedResults.Visibility = System.Windows.Visibility.Collapsed;
                }
            }

            if (Event is IFinalEvent)
            {
                this.btnSetHeatAsFinal.Visibility = System.Windows.Visibility.Visible;
                if (((IFinalEvent)Event).HeatRunAsFinal)
                {
                    this.btnOpenHeats.Visibility = System.Windows.Visibility.Collapsed;
                }
                else
                {
                    this.btnOpenHeats.Visibility = System.Windows.Visibility.Visible;
                }
            }
            else
            {
                this.btnOpenHeats.Visibility      = System.Windows.Visibility.Collapsed;
                this.btnSetHeatAsFinal.Visibility = System.Windows.Visibility.Collapsed;
            }

            // Auto Lane Assignment has been removed
            //if (Event is ILaneAssignedEvent)
            //if (((ILaneAssignedEvent)Event).requiresLaneUpdate())
            //this.btnOpenResultsCard.Visibility = System.Windows.Visibility.Visible;
            //else
            //this.btnOpenResultsCard.Visibility = System.Windows.Visibility.Collapsed;
            //else
            //this.btnOpenResultsCard.Visibility = System.Windows.Visibility.Collapsed;
        }
コード例 #57
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     System.Windows.Data.CollectionViewSource searchedStudentInfoViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("searchedStudentInfoViewSource")));
     // Load data by setting the CollectionViewSource.Source property:
     // searchedStudentInfoViewSource.Source = [generic data source]
 }
コード例 #58
0
        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            System.Windows.Data.CollectionViewSource car_modelViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("car_modelViewSource")));

            car_modelViewSource.Source = itemL;
        }
コード例 #59
0
 public FilterStub(CollectionViewSource parent)
 {
     _parent        = new WeakReference(parent);
     _filterWrapper = new Predicate <object>(WrapFilter);
 }
コード例 #60
-1
 public TextFilter()
 {
     InitializeComponent();
     FilterCollection = new List<ItemFilter>();
     col = (CollectionViewSource)FindResource("collection");
     FilterCollection.Add(new ItemFilter() {Name = "Выделить все...", IsCheked = true });
 }