Exemplo n.º 1
0
        public void LoadNewConfigurations(string path)
        {
            _changedFlag = false;

            PageList.Clear();

            _excel = ImportExcel.Instance;

            _excel.ImportExcelConfiguration(path);

            if (_excel.ImportFileOK)
            {
                ObservableCollection<PageType> tempList = GetAllPages();
                GroupList = GetAllGroups();
                ItemTypeOrderList = GetAllItems();

                LinkCollections(tempList, GroupList, ItemTypeOrderList);

                foreach (PageType page in tempList)
                {
                    PageList.Add(page);
                }

                _groupCounter = 0;
                int index = 0;

                while (index < WorkSheetktResources.Instance.ktResourceList.Count)
                {
                    if (Convert.ToInt32(WorkSheetktResources.Instance.ktResourceList[index].ResourceID) > _groupCounter)
                    {
                        _groupCounter = Convert.ToInt32(WorkSheetktResources.Instance.ktResourceList[index].ResourceID);
                    }

                    index++;
                }
            }
        }
Exemplo n.º 2
0
        public void LoadWorkspace(string path)
        {
            _changedFlag = false;

            ImportExcel.Instance = null;
            _excel = ImportExcel.Instance;

            _excel.ImportExcelFromFile(path);

            if (_excel.ImportFileOK)
            {
                PageList = GetAllPages();
                GroupList = GetAllGroups();
                ItemTypeOrderList = GetAllItems();

                LinkCollections(PageList, GroupList, ItemTypeOrderList);

                _groupCounter = 0;
                int index = 0;

                while (index < WorkSheetktResources.Instance.ktResourceList.Count)
                {
                    if (Convert.ToInt32(WorkSheetktResources.Instance.ktResourceList[index].ResourceID) > _groupCounter)
                    {
                        _groupCounter = Convert.ToInt32(WorkSheetktResources.Instance.ktResourceList[index].ResourceID);
                    }

                    index++;
                }
            }
            else
            {
                MessageBox.Show("Fil ikke importeret");
            }

            PageTypeItemsView = CollectionViewSource.GetDefaultView(PageList);
            PageTypeItemsView.Filter = ItemFilter;
            PageTypeItemsView.Refresh();
        }
Exemplo n.º 3
0
        public void Initialize()
        {
            _importPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Ressources\Configuration.xlsx");
            _exportPath = System.IO.Path.Combine(Environment.CurrentDirectory, @"Ressources\UnitTest.xlsx");

            _wvm = WorkspaceViewModel.Instance;
            _groupTableVm = new GroupTableViewModel();
            _wvm.LoadWorkspace(_importPath);
            _impExcel = ImportExcel.Instance;
            _exExcel = TreatPraktik.ViewModel.ExportExcel.Instance;

            //Get original lists of worksheets
            _oldExGroup = (from a in _impExcel._workSheetktExaminedGroup.ExaminedGroupList
                           select new ktExaminedGroup
                           {
                               DataQualityScore = a.DataQualityScore,
                               Expanded = a.Expanded,
                               GroupExpendable = a.GroupExpendable,
                               GroupIdentifier = a.GroupIdentifier,
                               GroupType = a.GroupType,
                               ID = a.ID,
                               Name = a.Name,
                               RequiredScore = a.RequiredScore
                           }).ToList();

            _oldGroupOrder = (from a in _impExcel._workSheetktUIGroupOrder.ktUIGroupOrderList
                              select new ktUIGroupOrder
                              {
                                  DepartmentID = a.DepartmentID,
                                  GroupOrder = a.GroupOrder,
                                  GroupTypeID = a.GroupTypeID,
                                  PageTypeID = a.PageTypeID
                              }).ToList();

            _oldOrder = (from a in _impExcel._workSheetktUIOrder.ktUIOrderList
                         select new ktUIOrder
                         {
                             DesignID = a.DesignID,
                             GroupOrder = a.GroupOrder,
                             GroupTypeID = a.GroupTypeID,
                             IncludedTypeID = a.IncludedTypeID,
                             PageTypeID = a.PageTypeID
                         }).ToList();

            _oldResources = (from a in _impExcel._workSheetktResources.ktResourceList
                             select new ktResources
                             {
                                 ResourceID = a.ResourceID,
                                 ResourceResxID = a.ResourceResxID,
                                 ResourceTypeID = a.ResourceTypeID
                             }).ToList();

            _oldResTranslation = (from a in _impExcel._workSheetktResourceTranslation.ktResourceTranslationList
                                  select new ktResourceTranslation
                                  {
                                      LanguageID = a.LanguageID,
                                      ResourceID = a.ResourceID,
                                      TranslationText = a.TranslationText
                                  }).ToList();
        }