Exemplo n.º 1
0
 internal void InitializeComponent(BcontrolDataHandler dataHandler, C1DataGrid searchGrid)
 {
     ViewModelLocator vmlocator = new ViewModelLocator();
     object[] args = new object[] { dataHandler, searchGrid };
     ActivityFinderPopupViewModel vm = (ActivityFinderPopupViewModel)vmlocator.GetViewModel(typeof(ActivityFinderPopupViewModel), true, args);
     this.DataContext = vm;
 }
        public ActivityFinderPopupViewModel(BcontrolDataHandler datahandler,C1DataGrid searchGrid)
        {
            eventaggregator = EventAggregator.Instance;
            IsVisible = false;
            _datahandler = datahandler;
            _datahandler.SearchInitialDataRetrieved += new EventHandler<GetSearchInitialDataCompletedEventArgs>(bcontrolDataHandler_SearchInitialDataRetrieved);
            _datahandler.SearchByMapListRetrieved +=new EventHandler<GetSearchMapListCompletedEventArgs>(bcontrolDatahandler_SearchByMapListRetrieved);
            _datahandler.SearchByGlobalHeadListRetrieved += new EventHandler<GetSearchGlobalHeadListCompletedEventArgs>(bcontrolDatahandler_SearchByGlobalHeadListRetrieved);
            _datahandler.SearchByGlobalFunctionListRetrieved += new EventHandler<GetSearchGlobalFunctionListCompletedEventArgs>(bcontrolDatahandler_SearchByGlobalFunctionListRetrieved);
            _datahandler.SearchByBusinessAreaListRetrieved += new EventHandler<GetSearchBusinessAreaListCompletedEventArgs>(bcontrolDatahandler_SearchByBusinessAreaListRetrieved);
            _datahandler.SearchByBusinessFunctionListRetrieved += new EventHandler<GetSearchBusinessFunctionListCompletedEventArgs>(bcontrolDatahandler_SearchByBusinessFunctionListRetrieved);
            _datahandler.SearchBySubFunctionListRetrieved += new EventHandler<GetSearchSubFunctionListCompletedEventArgs>(bcontrolDatahandler_SearchByBusinessSubFunctionListRetrieved);

            _datahandler.SearchByLevelDataRetrieved += new EventHandler<GetSearchResultsBylevelCompletedEventArgs>(bcontrolDataHandler_SearchByLevelDataRetrieved);
            _datahandler.SearchByHierarchyDataRetrieved += new EventHandler<GetSearchResultsByHierarchyCompletedEventArgs>(bcontrolDataHandler_SearchByHierarchyDataRetrieved);
            _datahandler.DiagramTemplateLinkRetrieved += new EventHandler<GetDiagramTemplateLinkCompletedEventArgs>(bcontrolDataHandler_DiagramTemplateLinkRetrieved);
            _datahandler.ExisitingActivitiesRetrieved +=new EventHandler<GetExisitingActivitiesCompletedEventArgs>(bcontrolDatahandler_ExisitingActivitiesRetrieved);            

            _isModifiedLinks = false;
         
            _searchResultsList = new ObservableCollection<ActivitySet>();
            _datahandler.GetDiagramTemplateLink();

            ErrorMessage = "";

            _searchGrid = searchGrid;
        }              
        public UploadReportHierarchyViewModel(StringBuilder log, C1DataGrid grid, BcontrolDataHandler bcontrolDataHandler)
        {
            eventaggregator = EventAggregator.Instance;
            _log = log;
            _grid = grid;

            PreviewCommand = new RelayCommand(PreviewAction);
            PreviewCommand.IsEnabled = false;
            UploadCommand = new RelayCommand(UploadAction);
            UploadCommand.IsEnabled = false;

            CloseCommand = new RelayCommand(CloseAction);
            CloseCommand.IsEnabled = true;

            _datahandler = bcontrolDataHandler;

            _datahandler.ClearBcontrolHierarchyDataRetrieved += new EventHandler<ClearBcontrolHierarchyDataCompletedEventArgs>(_datahandler_ClearBcontrolHierarchyDataRetrieved);
            _datahandler.AddBcontrolHierarchyDataRetrieved += new EventHandler<AddBcontrolHierarchyDataCompletedEventArgs>(_datahandler_AddBcontrolHierarchyDataRetrieved);
            _datahandler.CompleteAddBcontrolHierarchyDataRetrieved += new EventHandler<CompleteAddBcontrolHierarchyDataCompletedEventArgs>(_datahandler_CompleteAddBcontrolHierarchyDataRetrieved);

            _columns = new Dictionary<string, ReportField>();
            
            _columns.Add("Map Name", new ReportField(100, true));
            _columns.Add("Level", new ReportField(500, true));
            _columns.Add("FunctionalHead", new ReportField(50, false));
            _columns.Add("AdditionalData", new ReportField(100, false));
            _columns.Add("TOM", new ReportField(100, false));
            _columns.Add("REN", new ReportField(100, false));
            _columns.Add("Bcontrol Function Structure", new ReportField(100, false));
            _columns.Add("Taxonomy Level 3", new ReportField(100, false));
            _columns.Add("BusinessHierarchy1", new ReportField(100, false));
            _columns.Add("BusinessHierarchy2", new ReportField(100, false));
            _columns.Add("BusinessHierarchy3", new ReportField(100, false));

        }
Exemplo n.º 4
0
 public UploadHierarchyDialog(StringBuilder log,BcontrolDataHandler bcontrolDataHandler)
 {            
     InitializeComponent();
     ViewModelLocator vmlocator = new ViewModelLocator();
     object[] args = new object[] { log, this.dataGrid, bcontrolDataHandler };
     UploadReportHierarchyViewModel vm = (UploadReportHierarchyViewModel)vmlocator.GetViewModel(typeof(UploadReportHierarchyViewModel), false, args);
     this.DataContext = vm;
              
 }
Exemplo n.º 5
0
        public MainPage(IDictionary<string, string> initParams)
        {
            InitializeComponent();

            eventaggregator = EventAggregator.Instance;
            eventaggregator.Subscribe<SPList>(new Action<SPList>(ListUpdatedSubscription));
            eventaggregator.Subscribe<LogErrorMessage>(new Action<LogErrorMessage>(AddMessageToLog));
            _sLists = new StringBuilder();
            InitParams = initParams;

            if (Constants.Logging)
                _sLog = new StringBuilder();

            if (HtmlPage.Document.QueryString.ContainsKey("save"))
                btnSave.Visibility = Visibility.Visible;

            _excelGrid = new ExcelGrid(excelGridControl, 30, _sLog, txtTextLine, lblTextBlock);

            AddToLog("Control Instantiated");

            _dataHandlerUser = new DataHandlerUser(_excelGrid, this);
            _liveUpdateHandler = new LiveUpdateHandler(this);

            // Fetching Login info and groups for the login user
            _userAccessHandler = new UserAccessHandler(this);
            _userAccessHandler.UserGroupsRetrieved += handler_UserGroupsRetrieved;
            _userAccessHandler.GetUserLoginIdAndMemberGroups();

            _handler = new DataHandler(_excelGrid, this);
            _handler.ListDataRetrieved += handler_ListDataRetrieved;
            _handler.ListsRetrieved += handler_ListsRetrieved;
            _handler.ListDeleted += handler_ListDeleted;


            _handler.GetSiteLists();
            _handler.GetFrequencyValidations();


            chooseUsers.InitializeComponent(_dataHandlerUser, _excelGrid);
            sbMenuShow.Completed += sbMenuShow_Completed;
            sbMenuHide.Completed += sbMenuHide_Completed;
            ldgLists.StartRotating();

            _excelGrid.DisplayColumnSpacer = true;
            _excelGrid.RowChangedEvent += excelGrid_RowChangedEvent;
            _excelGrid.AttachHandler(this);

            _excelGrid.UpdateStatus("Retrieving lists...");

            _excelGrid.AddHint("Use the list dropdown to select another list to edit. If a list is already loading you'll have to wait until it's finished before selecting another.");
            _excelGrid.AddHint("Use the 'Live Update' button to either generate or update tasks in the live system. If a task with the same ID1 was already generated in the system in the last day, the task will be updated, otherwise a new one will be generated.");
            _excelGrid.AddHint("View the version history of a task using the 'Version History' button.");
            _excelGrid.AddHint("Setup Alerts using the 'Alert Me' button. Try changing the frequency of the alert to 'Daily' or 'Weekly' if you find you're receiving too many.");
            _excelGrid.AddHint("You'll only be able to select the relevant 'Business Area' under an 'Asset Category'. These have been setup by the admin team. Please email 'BCheck L2 Support' if you believe the structure is incorrect.");
            _excelGrid.AddHint("Clicking on a user cell will popup the user edit window. From here you can add and remove users. If the user hasn't been inserted before, the name will turn blue as the system tries to identify them. If the user cannot be indentified the name will turn red, otherwise it will turn grey.");

            sbMenuShow.Begin();

            MessageDialog.SetupMessage(LayoutRoot);
            _columnFactory = new CustomColumnFactory();


            _deleteReady = false;
            _settingsAllowed = false;
            _settingsReady = false;

            string CurrentUrl = HtmlPage.Document.DocumentUri.ToString();
            _isRcoUrl = (CurrentUrl.ToUpper().IndexOf(Constants.RcoChecklistAdminPage) > 0) ? true : false;

            _bcontrolDataHandler = new BcontrolDataHandler(this);

            activityPopup.InitializeComponent(_bcontrolDataHandler, activityPopup.SearchResultsGrid);

            BusinessUnits = _handler.GetBusinessUnits();

        }