Exemplo n.º 1
0
        private void InitData()
        {
            int numericalorder = 0;
            var listData       = new List <DataItemViewModelBase>();

            foreach (var documentDataItemOlder in documentDatasOlder)
            {
                var dataOlder           = documentDataItemOlder.ToString();
                var documentDataItemNew = this.documentDatasNew.FirstOrDefault(k => string.Equals(k.keyword, documentDataItemOlder.keyword, StringComparison.CurrentCultureIgnoreCase));

                var dataNew = documentDataItemNew != null?documentDataItemNew.ToString() : string.Empty;

                var itemViewModel = new DataItemViewModelBase(documentDataItemOlder.Id, string.Empty, dataOlder, dataNew, true, documentDataItemOlder, documentDataItemNew, false, documentDataItemOlder.date.ToString());
                listData.Add(itemViewModel);
            }

            foreach (var documentDataItemNew in documentDatasNew)
            {
                if (!documentDatasOlder.Any(k => string.Equals(k.keyword, documentDataItemNew.keyword, StringComparison.CurrentCultureIgnoreCase)))
                {
                    var dataNew       = documentDataItemNew.ToString();
                    var itemViewModel = new DataItemViewModelBase(string.Empty, string.Empty, string.Empty, dataNew, false, null, documentDataItemNew, false, documentDataItemNew.date.ToString());
                    listData.Add(itemViewModel);
                }
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show       = numericalorder == 1;
                this.Items.Add(item);
            }
        }
        private void InitData()
        {
            int numericalorder = 0;
            var listData = new List<DataItemViewModelBase>();
            foreach (var documentDataItemOlder in documentDatasOlder)
            {
                var dataOlder = documentDataItemOlder.ToString();
                var documentDataItemNew = this.documentDatasNew.FirstOrDefault(k => string.Equals(k.keyword, documentDataItemOlder.keyword, StringComparison.CurrentCultureIgnoreCase));

                var dataNew = documentDataItemNew != null ? documentDataItemNew.ToString() : string.Empty;

                var itemViewModel = new DataItemViewModelBase(documentDataItemOlder.Id, string.Empty, dataOlder, dataNew, true, documentDataItemOlder, documentDataItemNew, false, documentDataItemOlder.date.ToString());
                listData.Add(itemViewModel);
            }

            foreach (var documentDataItemNew in documentDatasNew)
            {
                if (!documentDatasOlder.Any(k => string.Equals(k.keyword, documentDataItemNew.keyword, StringComparison.CurrentCultureIgnoreCase)))
                {
                    var dataNew = documentDataItemNew.ToString();
                    var itemViewModel = new DataItemViewModelBase(string.Empty, string.Empty, string.Empty, dataNew, false, null, documentDataItemNew, false, documentDataItemNew.date.ToString());
                    listData.Add(itemViewModel);
                }
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show = numericalorder == 1;
                this.Items.Add(item);
            }
        }
        private void InitData()
        {
            foreach (var measureLawItemOlder in this.measureLawsOlder)
            {
                var measureLawGroupByCategory = this.measureLawsGroupByCategory.FirstOrDefault(k => string.Equals(k.AgeCategory, measureLawItemOlder.ageCategory, StringComparison.CurrentCultureIgnoreCase));
                if (measureLawGroupByCategory != null)
                {
                    measureLawGroupByCategory.MeasureLawsOlder.Add(measureLawItemOlder);
                }
                else
                {
                    measureLawGroupByCategory = new MeasureLawGroupByCategory(measureLawItemOlder.ageCategory);
                    measureLawGroupByCategory.MeasureLawsOlder.Add(measureLawItemOlder);
                    this.measureLawsGroupByCategory.Add(measureLawGroupByCategory);
                }
            }

            foreach (var measureLawItemNew in this.measureLawsNew)
            {
                var measureLawGroupByCategory = this.measureLawsGroupByCategory.FirstOrDefault(k => string.Equals(k.AgeCategory, measureLawItemNew.ageCategory, StringComparison.CurrentCultureIgnoreCase));
                if (measureLawGroupByCategory != null)
                {
                    measureLawGroupByCategory.MeasureLawsNew.Add(measureLawItemNew);
                }
                else
                {
                    measureLawGroupByCategory = new MeasureLawGroupByCategory(measureLawItemNew.ageCategory);
                    measureLawGroupByCategory.MeasureLawsNew.Add(measureLawItemNew);
                    this.measureLawsGroupByCategory.Add(measureLawGroupByCategory);
                }
            }

            int numericalorder = 0;
            var listData       = new List <DataItemViewModelBase>();

            foreach (var measureLawItem in this.measureLawsGroupByCategory)
            {
                var dataOlder = measureLawItem.GetStringDataOlder();
                var dataNew   = measureLawItem.GetStringDataOlder();

                var itemViewModel = new DataItemViewModelBase(measureLawItem.GetIds(), string.Empty, dataOlder, dataNew, true, measureLawItem.MeasureLawsOlder, measureLawItem.MeasureLawsNew, false);
                listData.Add(itemViewModel);
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show       = numericalorder == 1;
                this.Items.Add(item);
            }
        }
        private void InitData()
        {
            int numericalorder = 0;
            var listData       = new List <DataItemViewModelBase>();

            foreach (var relativeInfoItemOlder in relativeInfosOlder)
            {
                var dataOlder           = relativeInfoItemOlder.ToString();
                var relativeInfoItemNew = this.relativeInfosNew.FirstOrDefault(k => k.title == relativeInfoItemOlder.title &&
                                                                               string.Equals(k.firstName, relativeInfoItemOlder.firstName, StringComparison.CurrentCultureIgnoreCase) &&
                                                                               string.Equals(k.lastName, relativeInfoItemOlder.lastName, StringComparison.CurrentCultureIgnoreCase));
                var dataNew = relativeInfoItemNew != null?relativeInfoItemNew.ToString() : string.Empty;

                var itemViewModel = new DataItemViewModelBase(relativeInfoItemOlder.Id, string.Empty, dataOlder, dataNew, true, relativeInfoItemOlder, relativeInfoItemNew, false);
                listData.Add(itemViewModel);
            }

            foreach (var relativeInfoItemNew in relativeInfosNew)
            {
                if (!relativeInfosOlder.Any(k => k.title == relativeInfoItemNew.title &&
                                            string.Equals(k.firstName, relativeInfoItemNew.firstName, StringComparison.CurrentCultureIgnoreCase) &&
                                            string.Equals(k.lastName, relativeInfoItemNew.lastName, StringComparison.CurrentCultureIgnoreCase)))
                {
                    var dataNew       = relativeInfoItemNew.ToString();
                    var itemViewModel = new DataItemViewModelBase(string.Empty, string.Empty, string.Empty, dataNew, false, null, relativeInfoItemNew, false);
                    listData.Add(itemViewModel);
                }
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show       = numericalorder == 1;
                this.Items.Add(item);
            }
        }
        private void InitData()
        {
            int numericalorder = 0;
            var listData = new List<DataItemViewModelBase>();
            foreach (var relativeInfoItemOlder in relativeInfosOlder)
            {
                var dataOlder = relativeInfoItemOlder.ToString();
                var relativeInfoItemNew = this.relativeInfosNew.FirstOrDefault(k => k.title == relativeInfoItemOlder.title
                        && string.Equals(k.firstName, relativeInfoItemOlder.firstName, StringComparison.CurrentCultureIgnoreCase)
                        && string.Equals(k.lastName, relativeInfoItemOlder.lastName, StringComparison.CurrentCultureIgnoreCase));
                var dataNew = relativeInfoItemNew != null ? relativeInfoItemNew.ToString() : string.Empty;

                var itemViewModel = new DataItemViewModelBase(relativeInfoItemOlder.Id, string.Empty, dataOlder, dataNew, true, relativeInfoItemOlder, relativeInfoItemNew, false);
                listData.Add(itemViewModel);
            }

            foreach (var relativeInfoItemNew in relativeInfosNew)
            {
                if (!relativeInfosOlder.Any(k => k.title == relativeInfoItemNew.title
                    && string.Equals(k.firstName, relativeInfoItemNew.firstName, StringComparison.CurrentCultureIgnoreCase)
                        && string.Equals(k.lastName, relativeInfoItemNew.lastName, StringComparison.CurrentCultureIgnoreCase)))
                {
                    var dataNew = relativeInfoItemNew.ToString();
                    var itemViewModel = new DataItemViewModelBase(string.Empty, string.Empty, string.Empty, dataNew, false, null, relativeInfoItemNew, false);
                    listData.Add(itemViewModel);
                }
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show = numericalorder == 1;
                this.Items.Add(item);
            }
        }
        private void InitData()
        {
            foreach (var measureLawItemOlder in this.measureLawsOlder)
            {
                var measureLawGroupByCategory = this.measureLawsGroupByCategory.FirstOrDefault(k => string.Equals(k.AgeCategory, measureLawItemOlder.ageCategory, StringComparison.CurrentCultureIgnoreCase));
                if (measureLawGroupByCategory != null)
                {
                    measureLawGroupByCategory.MeasureLawsOlder.Add(measureLawItemOlder);
                }
                else
                {
                    measureLawGroupByCategory = new MeasureLawGroupByCategory(measureLawItemOlder.ageCategory);
                    measureLawGroupByCategory.MeasureLawsOlder.Add(measureLawItemOlder);
                    this.measureLawsGroupByCategory.Add(measureLawGroupByCategory);
                }
            }

            foreach (var measureLawItemNew in this.measureLawsNew)
            {
                var measureLawGroupByCategory = this.measureLawsGroupByCategory.FirstOrDefault(k => string.Equals(k.AgeCategory, measureLawItemNew.ageCategory, StringComparison.CurrentCultureIgnoreCase));
                if (measureLawGroupByCategory != null)
                {
                    measureLawGroupByCategory.MeasureLawsNew.Add(measureLawItemNew);
                }
                else
                {
                    measureLawGroupByCategory = new MeasureLawGroupByCategory(measureLawItemNew.ageCategory);
                    measureLawGroupByCategory.MeasureLawsNew.Add(measureLawItemNew);
                    this.measureLawsGroupByCategory.Add(measureLawGroupByCategory);
                }
            }

            int numericalorder = 0;
            var listData = new List<DataItemViewModelBase>();
            foreach (var measureLawItem in this.measureLawsGroupByCategory)
            {
                var dataOlder = measureLawItem.GetStringDataOlder();
                var dataNew = measureLawItem.GetStringDataOlder();

                var itemViewModel = new DataItemViewModelBase(measureLawItem.GetIds(), string.Empty, dataOlder, dataNew, true, measureLawItem.MeasureLawsOlder, measureLawItem.MeasureLawsNew, false);
                listData.Add(itemViewModel);
            }

            // sort
            foreach (var item in listData.OrderBy(k => k.Sort).ThenBy(k => k.SortName).ToList())
            {
                numericalorder++;
                item.NameColumn = numericalorder.ToString();
                item.Show = numericalorder == 1;
                this.Items.Add(item);
            }
        }