Пример #1
0
        void mc_srv_select_RDCompleted(object sender, srv_select_RDCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                if (e.Result.Count > 0)
                {
                    PagedCollectionView c1 = new PagedCollectionView(e.Result);

                    //c1.GroupDescriptions.Add(new PropertyGroupDescription(""));

                    listRD = new List<RD_ex>();
                    string name = e.Result[0].Contractor_Name;
                    RD_ex R = new RD_ex(name);
                    foreach (cRD item in c1)
                    {
                        if (name != item.Contractor_Name)
                        {
                            listRD.Add(R);
                            name = item.Contractor_Name;
                            R = new RD_ex(name);
                        }
                        R.addItem(item.MassType, item.Sort_Name, item.Val.ToString());
                    }

                    dgCol = new PagedCollectionView(GenerateDataB().ToDataSource());

                    dg_B.ItemsSource = dgCol;
                    //dg_F.ItemsSource = GenerateDataF().ToDataSource();
                }
            }

        }
Пример #2
0
        private void BindDataGrid(List<V_RoleUserInfo> obj)
        {
            PagedCollectionView pcv = null;
            if (obj == null || obj.Count < 1)
            {
                //HtmlPage.Window.Alert("对不起!未能找到相关记录。");
                DtGridUsers.ItemsSource = null;
                return;
            }
            var q = from ent in obj
                    select ent;
            //按公司部门排序
            q = q.OrderBy(s=>s.COMPANYNAME).OrderBy(s=>s.DEPARTMENTNAME);
            pcv = new PagedCollectionView(q);
            pcv.PageSize = 500;
            DtGridUsers.ItemsSource = pcv;
            
            //if (e.Result != null)
            //{
            //    List<T_SYS_ROLE> menulist = e.Result.ToList();
            //    var q = from ent in menulist
            //            select ent;

            //    pcv = new PagedCollectionView(q);
            //    pcv.PageSize = 100;
            //}

            //DtGrid.ItemsSource = pcv;
            //DtGridUsers.CacheMode = new BitmapCache();
        }
Пример #3
0
        void client_GetLogsCompleted(object sender, GetLogsCompletedEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
                {
                    var taskListView = new PagedCollectionView(e.Result);
                    if (taskListView.CanGroup)
                    {
                        if (cbGroupByIndend.IsChecked.HasValue && cbGroupByIndend.IsChecked.Value)
                        {
                            var group = new PropertyGroupDescription();
                            group.PropertyName = "IndentLevel";
                            taskListView.GroupDescriptions.Add(group);
                        }

                        if (cbGroupByMessage.IsChecked.HasValue && cbGroupByMessage.IsChecked.Value)
                        {
                            var group = new PropertyGroupDescription();
                            group.PropertyName = "Message";
                            taskListView.GroupDescriptions.Add(group);
                        }

                    }

                    logEntryEventArgsDataGrid.ItemsSource = taskListView;
                    if(!string.IsNullOrWhiteSpace(searchBox.txtSearchCriteria.Text))
                    {
                        SearchBox_Search(null, new SearchCriteriaEventArgs(searchBox.txtSearchCriteria.Text));
                    }

                    waitCursor.IsWaitEnable = false;
                });
        }
Пример #4
0
 void BindData(IEnumerable<Measurement> measurementList)
 {
     PagedCollectionView pagedList = new PagedCollectionView(measurementList);
     ListBoxMeasurementList.ItemsSource = pagedList;
     DataPagerMeasurements.Source = pagedList;
     ListBoxMeasurementList.SelectedIndex = -1;
 }
Пример #5
0
		private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
		{
			PagedCollectionView pcv = new PagedCollectionView(dataContext);
			pcv.PageSize = 10;
			this.DataContext = pcv;
			this.searchSalesData.ItemsSource = dataContext.Select(a => a.SalesPerson);

			double minSalesAmout = dataContext.Min(a => a.SalesAmount);
			double maxSalesAmount = dataContext.Max(a => a.SalesAmount);
			double salesAmountDelta = maxSalesAmount - minSalesAmout;

			double minFontSize = 10.0;
			double maxFontSize = 30.0;

			double fontSizeDelta = maxFontSize - minFontSize;

			for (int i = 0; i < dataContext.Count; i++)
			{
				TextBlock textBlock = new TextBlock
				{
					Text = dataContext[i].CompanyName,
					Foreground = i % 2 == 0 ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Blue),
					Margin = new Thickness(2),
					FontSize = minFontSize + dataContext[i].SalesAmount * fontSizeDelta / salesAmountDelta
				};
				this.wrapPanelSales.Children.Add(textBlock);
			}
		}
        private void galatee_OkClickedChoixClient(object sender, EventArgs e)
        {
            if (this.Anciennecamp != null)
            {
                foreach (var item_ in this.Anciennecamp)
                {
                    foreach (var item in item_.DETAILCAMPAGNEGC_)
                    {
                        CsLclient facture = new CsLclient();
                        facture.CENTRE       = item.CENTRE;
                        facture.CLIENT       = item.CLIENT;
                        facture.ORDRE        = item.ORDRE;
                        facture.NOM          = item.NOM;
                        facture.REFEM        = item.PERIODE;
                        facture.SOLDEFACTURE = item.MONTANT;
                        facture.NDOC         = item.NDOC;
                        Lstfacture.Add(facture);
                    }
                }
            }

            System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
            LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
            if (dg_facture.ItemsSource != null)
            {
                this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
            }

            btn_Rech.IsEnabled = true;
            desableProgressBar();
            ActiverElement(true);
            Message.ShowInformation("Les factures déja en campagne ne seront pas dans cette campagne", "Information");
        }
        //查詢磁卡資料  
        async void QueryMagneticCard()
        {
            //busyIndicator.IsBusy = true;
            ObservableCollection<MagneticCard> objMagneticCard = new ObservableCollection<MagneticCard>();

            var q = await db.LoadAsync<vwMagneticCard>(db.GetVwMagneticCardQuery());

            foreach (var vwMagneticCardData in q)
            {
                objMagneticCard.Add(new MagneticCard
                {
                    RoleID = vwMagneticCardData.RoleID??0,
                    ABA = vwMagneticCardData.ABA,
                    Name = vwMagneticCardData.Name,
                    Company = vwMagneticCardData.Company,
                    Memo = vwMagneticCardData.Memo
                });
            }
            //分頁,但會選取DataGrid第一筆
            pageView = new PagedCollectionView(q);

            dataGrid.ItemsSource = pageView;
            magneticCardData = objMagneticCard;
            //busyIndicator.IsBusy = false;
        }
Пример #8
0
        public static DataGrid ToPrintFriendlyGrid(this DataGrid source,PagedCollectionView pcv)
        {
            DataGrid dg = new DataGrid();
            dg.ItemsSource = pcv;
            dg.AutoGenerateColumns = false;

            for (int i = 0; i < source.Columns.Count; i++)
            {
                DataGridTextColumn newColumn = new DataGridTextColumn();
                DataGridTextColumn column = (DataGridTextColumn)source.Columns[i];
                newColumn.Header = column.Header;
                System.Windows.Data.Binding bind;
                if (column.Binding != null)
                {
                    bind = new System.Windows.Data.Binding();
                    bind.Path = column.Binding.Path;
                    //bind.Converter = column.Binding.Converter;
                }
                else
                    bind = new System.Windows.Data.Binding();
                newColumn.Binding = bind;
                dg.Columns.Add(newColumn);
            }

            return dg;
        }
Пример #9
0
 void BindData(IEnumerable<Device> deviceList)
 {
     m_pagedList = new PagedCollectionView(deviceList);
     ListBoxDeviceList.ItemsSource = m_pagedList;
     DataPagerDevices.Source = m_pagedList;
     ListBoxDeviceList.SelectedIndex = -1;
 }
Пример #10
0
        public ChatViewModel(IChatService chatService)
        {
            this.contacts = new ObservableCollection<Contact>();
            this.contactsView = new PagedCollectionView(this.contacts);
            this.sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
            this.showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
            this.showDetailsCommand = new ShowDetailsCommandImplementation(this);

            this.contactsView.CurrentChanged += this.OnCurrentContactChanged;

            this.chatService = chatService;
            this.chatService.Connected = true;
            this.chatService.ConnectionStatusChanged += (s, e) => this.RaisePropertyChanged(() => this.ConnectionStatus);
            this.chatService.MessageReceived += this.OnMessageReceived;

            this.chatService.GetContacts(
                result =>
                {
                    if (result.Error == null)
                    {
                        foreach (var item in result.Result)
                        {
                            this.contacts.Add(item);
                        }
                    }
                });
        }
Пример #11
0
        public static void PrintGrid(this DataGrid source,PagedCollectionView pcv)
        {
            var dg = source.ToPrintFriendlyGrid(pcv);
            var doc = new PrintDocument();

            var offsetY = 0d;
            var totalHeight = 0d;
            var canvas = new Canvas();
            canvas.Children.Add(dg);
            doc.PrintPage += (s, e) =>
            {
                e.PageVisual = canvas;
                canvas.Margin = new Thickness(50);
                if (totalHeight == 0)
                {
                    totalHeight = dg.DesiredSize.Height;
                }

                Canvas.SetTop(dg, -offsetY);

                offsetY += e.PrintableArea.Height;

                e.HasMorePages = offsetY <= totalHeight;
            };


            doc.Print(null);
        }
 /// <summary>
 /// Initializes a DataPagerSample.
 /// </summary>
 public DataPagerSample()
 {
     InitializeComponent();
     PagedCollectionView pcv = new PagedCollectionView(Airport.SampleAirports.ToArray());
     pcv.PageSize = 6;
     DataContext = pcv;
 }
        private void OKButton_Click_1(object sender, RoutedEventArgs e)
        {
            if (dg_facture_Copy.ItemsSource != null && cbo_regroupement.SelectedItem != null)
            {
                //PagedCollectionView pcv = (PagedCollectionView)dg_facture_Copy.ItemsSource;
                //List<CsLclient> CollectionName = new List<CsLclient>();

                System.Windows.Data.PagedCollectionView view = (System.Windows.Data.PagedCollectionView)datapager_Copy.Source;
                var ListeFacture = ((List <CsLclient>)view.SourceCollection).ToList();

                //CollectionName = (List<CsLclient>)pcv.SourceCollection;

                //var ListeFacture = CollectionName;
                var regcli = (CsRegCli)cbo_regroupement.SelectedItem;
                if (ListeFacture.Count > 0)
                {
                    SaveCampane(ListeFacture, regcli, UserConnecte.PK_ID);
                }
                else
                {
                    Message.Show("Vous ne pouvez pas creer  de campagne sans au moin une facture selectionne", "Information");
                }

                this.DialogResult = true;
            }
            else
            {
                Message.Show("Vous ne pouvez pas creer  de campagne sans au moin une facture selectionne", "Information");
            }
        }
Пример #14
0
 public DataGridGrouping()
 {
     InitializeComponent();
     // Create a collection to store task data.
     ObservableCollection<Task> taskList = new ObservableCollection<Task>();
     // Generate some task data and add it to the task list.
     for (int i = 1; i <= 14; i++)
     {
         taskList.Add(new Task()
         {
             ProjectName = "Project " + ((i % 3) + 1).ToString(),
             TaskName = "Task " + i.ToString(),
             DueDate = DateTime.Now.AddDays(i),
             Complete = (i % 2 == 0),
             Notes = "Task " + i.ToString() + " is due on "
                   + DateTime.Now.AddDays(i) + ". Lorum ipsum..."
         });
     }
     
     PagedCollectionView taskListView = new PagedCollectionView(taskList);
     this.dataGrid1.ItemsSource = taskListView;
     if (taskListView.CanGroup == true)
     {
         // Group tasks by ProjectName...
         taskListView.GroupDescriptions.Add(new PropertyGroupDescription("ProjectName"));
         // Then group by Complete status.
         taskListView.GroupDescriptions.Add(new PropertyGroupDescription("Complete"));
     }
     if (taskListView.CanSort == true)
     {
         // By default, sort by ProjectName.
         taskListView.SortDescriptions.Add(new SortDescription("ProjectName", ListSortDirection.Ascending));
     }
     
 }
        void wc_ws_selectNextCalibrationsCompleted(object sender, ws_selectNextCalibrationsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                c_collection_next = new PagedCollectionView(e.Result);

                IEnumerable<wsCalibration> next = from item in e.Result where item.plannedDate > DateTime.Now select item;
                IEnumerable<wsCalibration> missed = from item in e.Result where item.plannedDate <= DateTime.Now select item;
                IEnumerable<wsCalibration> not = from item in e.Result where item.plannedDate == null select item;

                c_collection_next = new PagedCollectionView(next);
                c_collection_missed = new PagedCollectionView(missed);
                c_collection_not = new PagedCollectionView(not);

                dg_NextWeek.ItemsSource = c_collection_next;
                dg_Missed.ItemsSource = c_collection_missed;
                dg_Not.ItemsSource = c_collection_not;

                txt_nextCaption.Text = "Период поверки устройств истекает в ближайшую неделю (список на дату: "+ DateTime.Now.Date + ")";
                txt_missedCaption.Text = "Поверка просрочена (список на дату: " + DateTime.Now.Date + ")";
                txt_notCaption.Text = "Отсутствуют сведения  поверке (список на дату: " + DateTime.Now.Date + ")"; 
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }   
        }
Пример #16
0
        void wc_ws_selectDeviceCalibrationsCompleted(object sender, ws_selectDeviceCalibrationsCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                if (e.Result.Count > 0)
                {
                    dg_Calibration.Visibility = Visibility.Visible;
                    no_Calibration.Visibility = Visibility.Collapsed;

                    PagedCollectionView collection = new PagedCollectionView(e.Result);

                    dg_Calibration.ItemsSource = collection;

                }
                else
                {
                    dg_Calibration.Visibility = Visibility.Collapsed;
                    no_Calibration.Visibility = Visibility.Visible;
                }
            }
            else
            {
                cwnd_ShitHappens w = new cwnd_ShitHappens(ErrorResources.err_SELECT, e.OpStatus.ToString());
                w.Show();
            }
        }
 void db_GetRecordsCompleted(object sender, GetRecordsCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         PagedCollectionView pagedView = new PagedCollectionView(GenerateEHistory(e.Result));
         dgEDetails.ItemsSource = pagedView;
     }
 }
Пример #18
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void db_GetRequistionCompleted(object sender, GetRequistionCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         PagedCollectionView pagedView = new PagedCollectionView(e.Result);
         dgRDetails.ItemsSource = pagedView;
     }
 }
 /// <summary>
 /// Initializes a DataGridGroupingSample.
 /// </summary>
 public DataGridGroupingSample()
 {
     InitializeComponent();
     PagedCollectionView pcv = new PagedCollectionView(Contact.People);
     pcv.GroupDescriptions.Add(new PropertyGroupDescription("State"));
     pcv.GroupDescriptions.Add(new PropertyGroupDescription("City"));
     DataContext = pcv;
 }
Пример #20
0
 void db_GetFileInformationCompleted(object sender, GetFileInformationCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         pagedLogView = new PagedCollectionView(e.Result);
         dgLog.ItemsSource = pagedLogView;
     }
 }
Пример #21
0
 void MainPage_Loaded(object sender, RoutedEventArgs e) 
 {
     IList<orderEntity> list = this.GetDataSource();
     PagedCollectionView pcv = new PagedCollectionView(list);
     pcv.PageSize = 10;
     this.dataGrid1.ItemsSource = pcv;
     this.dataPager1.DataContext = pcv;                                   
 }
 public ArcGISPortalServiceSearchProvider()
 {
     Results = _results;
     PagedResults = new PagedCollectionView(Results) { PageSize = _pageSize, };
     PagedResults.PageChanging += PagedResults_PageChanging;
     ResultsView = new ServiceSearchResultsView();
     InputView = new SingleLineSearchInputView();
     Properties.SetDisplayName(this, this.GetDisplayNameFromAttribute());
 }
 private void LoadDataPager <T>(object ItemsSource, DataPager datapager_, DataGrid dg)
 {
     if (ItemsSource != null)
     {
         System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView((List <T>)ItemsSource);
         dg.ItemsSource    = view;
         datapager_.Source = view;
     }
 }
Пример #24
0
 private void BindDataGrid(List<T_OA_ARCHIVES> obj)
 {
     if (obj.Count < 1) return;
     PagedCollectionView pcv = new PagedCollectionView(obj);
     Type a = ((PagedCollectionView)pcv).CurrentItem.GetType();
     pcv.PageSize = 10;
     FirstLastPreviousNextNumeric.DataContext = pcv;
     dgArchives.ItemsSource = pcv;
 }
Пример #25
0
 public MainWindow()
 {
     //Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
     InitializeComponent();
     comboBox.ItemsSource = new string[] { "Generic", "Black", "DarkBlue" };
     var pcv=new PagedCollectionView(Enumerable.Range(1, 100).ToList());
     dataPager.Source = pcv;
     listBox.ItemsSource = pcv;
 }
Пример #26
0
        void dsc_GetPageLatestVersionsOfWorkflowDefinitionCompleted(object sender, GetPageLatestVersionsOfWorkflowDefinitionCompletedEventArgs e)
        {
            PagedCollectionView pcv = new PagedCollectionView(e.Result);

            //列表控件数据源绑定
            dataGrid.ItemsSource = pcv;

            //分页控件数据源绑定
            dataPager.DataContext = pcv;
        }
        /// <summary>
        /// Re-initialize all components in this child UI.
        /// This method also checks whether or not the selected pattern is a complex type. 
        /// If yes, the data form will render a special tag to accomodate the complex type settings.
        /// </summary>
        /// <param name="p">The selected Pattern</param>
        public void RebuildPanel(PatternBase p)
        {
            this.PnlPatternSetter.CommandButtonsVisibility = DataFormCommandButtonsVisibility.Commit;
            this.PnlPatternSetter.CurrentItem = p;

            #region Checks whether the selected pattern is a complex type

            #region if pattern is ["Position Weighted Matrix"]
            if (p is PWM)
            {
                pcv = new PagedCollectionView((p as PWM).RowElements);
                DataContext = pcv;
                SubElementView.Header = "PWM row elements";
                SubPanelDF.Header = "Add a PWM row here.";
            }
            #endregion

            #region else if pattern is a ["Block"]
            else if (p is BioPatMLEditor.PatternControls.PatternModels.Block)
            {
                pcv = new PagedCollectionView((p as BioPatMLEditor.PatternControls.PatternModels.Block).BlockElements);
                DataContext = pcv;
                SubPanelDF.Header = "Add your Block(s) here.";
                SubElementView.Header = "Block sequences";
            }
            #endregion

            #region else if pattern is a ["Composition"]
            else if (p is Composition)
            {
                pcv = new PagedCollectionView((p as Composition).compElements);
                DataContext = pcv;
                SubPanelDF.Header = "Add your Symbol & Weight here.";
                SubElementView.Header = "Symbol Weights";
            }
            #endregion

            #region else if pattern is a ["Repeat"]
            else if (p is Repeat)
            {
                pcv = new PagedCollectionView((p as Repeat).RepeatPairs);
                DataContext = pcv;
                SubElementView.Header = "Pairings";
                SubPanelDF.Header = "Add your pairings here.";
            }
            #endregion

            #region Otherwise just another ordinary pattern, not a complex one.
            else
                //Patterns with no sub elements
                SubElementView.Visibility = System.Windows.Visibility.Collapsed;
            #endregion

            #endregion
        }
        public TrainsScheduleDGridController(TrainsScheduleDGrid view,
            TrainInfoCollection collection)
        {
            if (view == null)
                throw new ArgumentNullException("view");
            if (collection == null)
                throw new ArgumentNullException("collection");

            this.view = view;
            cView = new PagedCollectionView(collection) {PageSize = 10};
        }
Пример #29
0
 private void srv_GetBgLogDataCompleted(object sender, GetBgLogDataCompletedEventArgs e)
 {
     loadingProgress.IsBusy = false;
     PagedCollectionView pageView = new PagedCollectionView(e.Result);
     dpList.Source = pageView;
     dgList.ItemsSource = pageView;
     if (e.Result.Count == 0)
     {
         MessageBox.Show("没有找到匹配的记录!");
     }
 }
        public PlanListTraceDataGrid(PlanListViewModel aPlanListViewModel, bool aRemove)
        {
            InitializeComponent();

            this.DataContext = aPlanListViewModel;
            this.planListViewModel = aPlanListViewModel;
            plansDataGrid.SetValue(Canvas.ZIndexProperty, 3);
            filterExpander.SetValue(Canvas.ZIndexProperty, 1);

            this.showFinishedCheckBox.IsChecked = true;
            this.showUnfinishedCheckBox.IsChecked = true;

            if (aRemove)
            {
                string projectNameColumn = "项目名称";
                string manufactureNumberColumn = "生产令号";
                string versionIDColumn = "版本号";
                for (int pos = plansDataGrid.Columns.Count - 1; pos >= 0; --pos)
                {
                    string currentColumn = plansDataGrid.Columns[pos].Header as string;
                    if (projectNameColumn == currentColumn
                        || manufactureNumberColumn == currentColumn
                        || versionIDColumn == currentColumn)
                    {
                        plansDataGrid.Columns.Remove(plansDataGrid.Columns[pos]);
                    }
                }
                this.plansDataGrid.ItemsSource = this.planListViewModel.FilterPlanList;

                this.programNameLabel.Visibility = Visibility.Collapsed;
                this.programNameTextBox.Visibility = Visibility.Collapsed;
                this.manufactureNameLabel.Visibility = Visibility.Collapsed;
                this.manufactureNumberTextBox.Visibility = Visibility.Collapsed;
            }
            else
            {
                PagedCollectionView view = new PagedCollectionView(this.planListViewModel.FilterPlanList);
                view.GroupDescriptions.Add(new PropertyGroupDescription("ProjectName"));
                this.plansDataGrid.ItemsSource = view;
                try
                {
                    foreach (CollectionViewGroup group in view.Groups)
                    {
                        plansDataGrid.CollapseRowGroup(group, true);
                    }
                }
                catch (Exception ex)
                {
                    // Could not collapse group.
                    MessageBox.Show(ex.Message);
                }
            }
        }
Пример #31
0
 private void client_GetLotteryNumsInfoListCompleted(object sender, AdminService.GetLotteryNumsInfoListCompletedEventArgs e)
 {
     loadingProgress.IsBusy = false;
     if (e.Result.Count == 0)
     {
         MessageBox.Show("没有找到匹配的记录!");
     }
     currentPos = 0;
     PagedCollectionView pcv = new PagedCollectionView(e.Result);
     dpList.Source = pcv;
     dgList.ItemsSource = pcv;
 }
 public GoogleServiceSearchProvider()
 {
     Results = _results;
     PagedResults = new PagedCollectionView(Results)
     {
         PageSize = 12,
         Filter = (o) => { return ((SearchResultViewModel)o).IsInitialized; }
     };
     Properties.SetDisplayName(this, this.GetDisplayNameFromAttribute());
     ResultsView = new ServiceSearchResultsView();
     InputView = new SingleLineSearchInputView();
 }
Пример #33
0
        public void GetFrames(IList studyList)
        {
            int[] studyIdArray = (from object study in studyList select ((Vysetrenie)study).IdVysetrenia).ToArray();

            _laboratoryDomainContext.Load(_laboratoryDomainContext.GetFramesByStudiesQuery(studyIdArray), true).Completed += (sender, args) =>
            {
                var pagedCollectionView = new PagedCollectionView(((LoadOperation<DicomFrameDto>)sender).Entities);
                pagedCollectionView.GroupDescriptions.Add(new PropertyGroupDescription("DicomFile.Vysetrenie.IdentifikacneUdaje.RodCislo"));
                pagedCollectionView.MoveCurrentTo(null);
                Frames = pagedCollectionView;
                NotifyOfPropertyChange("Frames");
            };
        }
        //Recherche des factures sen fonction des critère entré
        private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit)
        {
            //Activation du busy indicator
            allowProgressBar();

            //Grisé certain éléments du formulaire pour bloqué certainnes actions
            ActiverElement(false);

            //Exécution du service web recupération des factures
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureAvecProduitCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit);
        }
        private void Remplirfacture(CsRegCli csRegCli, List <string> listperiode)
        {
            allowProgressBar();
            ActiverElement(false);
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAsync(csRegCli, listperiode);
        }
        private void btn_DeChargerTout_Click(object sender, RoutedEventArgs e)
        {
            //var facture = ((List<ServiceRecouvrement.CsLclient>)dg_facture.ItemsSource);
            dg_facture.SelectedItems.Clear();
            System.Windows.Data.PagedCollectionView view = (System.Windows.Data.PagedCollectionView)datapager.Source;

            ListFacture_Selectionner = ((List <CsLclient>)view.SourceCollection).ToList();
            foreach (var item in ListFacture_Selectionner)
            {
                dg_facture.SelectedItems.Add(item);
                this.txt_TotalFacture.Text = ListFacture_Selectionner.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
            }
            ListFacture_Selectionner.Clear();
            Galatee.Silverlight.Shared.CommonMethode.TransfertDataGrid <CsLclient>(dg_facture, dg_facture_Copy);

            LoadDataPager <CsLclient>(dg_facture.ItemsSource, datapager, dg_facture);

            LoadDataPager <CsLclient>(dg_facture_Copy.ItemsSource, datapager_Copy, dg_facture_Copy);

            txt_TotalFacture.Text       = ((List <CsLclient>)dg_facture.ItemsSource).Sum(c => c.MONTANT).Value.ToString(SessionObject.FormatMontant);
            txt_TotalFactureEnvoie.Text = ((List <CsLclient>)dg_facture_Copy.ItemsSource).Sum(c => c.MONTANT).Value.ToString(SessionObject.FormatMontant);
        }
        //Recherche des factures sen fonction des critère entré
        private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit)
        {
            //Activation du busy indicator
            allowProgressBar();

            //Grisé certain éléments du formulaire pour bloqué certainnes actions
            ActiverElement(false);

            //Exécution du service web recupération des factures
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureAvecProduitCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                List <CsLclient> lstFactureGeneral = new List <CsLclient>();
                List <CsLclient> lstFactureExist   = new List <CsLclient>();
                lstFactureGeneral = args.Result;

                /*LKO  15/01/2021 VERFICATION DE DOUBLON A LA CREATION D'UNE CAMPAGNE */
                if (lstFactureGeneral != null && lstFactureGeneral.Count != 0)
                {
                    lstFactureExist = lstFactureGeneral.Where(t => t.IsPAIEMENTANTICIPE).ToList();
                    Lstfacture      = lstFactureGeneral.Where(t => !t.IsPAIEMENTANTICIPE).ToList();
                }
                if (lstFactureExist != null && lstFactureExist.Count != 0)
                {
                    List <object> _LstObj = new List <object>();
                    _LstObj = ClasseMEthodeGenerique.RetourneListeObjet(lstFactureExist);
                    Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();
                    _LstColonneAffich.Add("NUMDEM", "CAMPAGNE");
                    _LstColonneAffich.Add("CENTRE", "CENTRE");
                    _LstColonneAffich.Add("CLIENT", "CLIENT");
                    _LstColonneAffich.Add("ORDRE", "ORDRE");
                    _LstColonneAffich.Add("NDOC", "NUM FACTURE");
                    _LstColonneAffich.Add("REFEM", "PERIODE");

                    List <object> obj = Shared.ClasseMEthodeGenerique.RetourneListeObjet(_LstObj);
                    MainView.UcListeClientMultiple ctrl = new MainView.UcListeClientMultiple(obj, _LstColonneAffich, false, "Liste des factures deja dans une campagne");
                    ctrl.Closed += new EventHandler(galatee_OkClickedChoixClient);
                    ctrl.Show();
                    return;
                }    /*****/
                else
                {
                    if (this.Anciennecamp != null)
                    {
                        foreach (var item_ in this.Anciennecamp)
                        {
                            foreach (var item in item_.DETAILCAMPAGNEGC_)
                            {
                                CsLclient facture = new CsLclient();
                                facture.CENTRE       = item.CENTRE;
                                facture.CLIENT       = item.CLIENT;
                                facture.ORDRE        = item.ORDRE;
                                facture.NOM          = item.NOM;
                                facture.REFEM        = item.PERIODE;
                                facture.SOLDEFACTURE = item.MONTANT;
                                facture.NDOC         = item.NDOC;
                                Lstfacture.Add(facture);
                            }
                        }
                    }

                    System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                    LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                    if (dg_facture.ItemsSource != null)
                    {
                        this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
                    }

                    btn_Rech.IsEnabled = true;
                    desableProgressBar();
                    ActiverElement(true);

                    return;
                }
            };
            service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit);
        }