Ejemplo n.º 1
0
 /// <summary>
 /// Set is checked navbar item
 /// </summary>
 /// <param name="applicationPage"></param>
 public void SetIsChecked(ApplicationPage applicationPage)
 {
     foreach (var item in NavbarItems)
     {
         item.IsChecked = applicationPage == item.ApplicationPage ? true : false;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Navigates to the specified page.
        /// </summary>
        /// <param name="page">The page to go to</param>
        /// <param name="viewModel">The view model, if any, to set explicitly to the new page</param>
        public void GoToPage(ApplicationPage page, BaseViewModel viewModel = null)
        {
            // Set the view model
            CurrentPageViewModel = viewModel;

            // Always hide Mail delivery system if we are changing pages

            // Set the current page
            CurrentPage = page;

            // Fire off a CurrentPage changed event
            OnPropertyChanged(nameof(CurrentPage));

            // Show side menu or not ?
            if (CurrentPage == ApplicationPage.Login)
            {
                SideMenuVisible       = false;
                UserCredentialVisible = false;
            }
            else
            {
                SideMenuVisible       = true;
                UserCredentialVisible = true;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Navigates to the specified page
        /// </summary>
        /// <param name="page">The page to go to</param>
        internal void GoToPage(ApplicationPage page)
        {
            CurrentPage = page;

            // Show side menu or not
            SideMenuVisible = page == ApplicationPage.Chat;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and a view model, if any, and creates the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            // Find the appropriate page
            switch (page)
            {
            case ApplicationPage.Login:
                return(new LoginPage(viewModel as LoginViewModel));

            case ApplicationPage.WaitingForTest:
                return(new WaitingForTestPage(viewModel as WaitingForTestViewModel));

            case ApplicationPage.ResultOverviewPage:
                return(new ResultOverviewPage(viewModel as ResultOverviewViewModel));

            case ApplicationPage.ResultQuestionsPage:
                return(new ResultQuestionsPage(viewModel as ResultQuestionsViewModel));

                #region Question Pages

            case ApplicationPage.QuestionMultipleCheckboxes:
                return(new QuestionMultipleCheckboxesPage(viewModel as QuestionMultipleCheckboxesViewModel));

            case ApplicationPage.QuestionMultipleChoice:
                return(new QuestionMultipleChoicePage(viewModel as QuestionMultipleChoiceViewModel));

            case ApplicationPage.QuestionSingleTextBox:
                return(new QuestionSingleTextBoxPage(viewModel as QuestionSingleTextBoxViewModel));

                #endregion

            default:
                Debugger.Break();
                return(null);
            }
        }
 /// <summary>
 /// Raises the page changed event if there is a 
 /// subscriber
 /// </summary>
 /// <param name="targetPage"></param>
 protected void OnPageChanged(ApplicationPage targetPage, ViewModelBase dataContext)
 {
     if (PageChanged != null)
     {
         PageChanged(targetPage, dataContext);
     }
 }
        /// <summary>
        /// Check if the client is connected to a server
        /// </summary>
        /// <param name="delayBetweenCheck">The delay between every check in milliseconds</param>
        /// <param name="waitTime">The time needed for every ping to the server in milliseconds</param>
        public void StartConnectionListener(int delayBetweenCheck = 1000, int waitTime = 100)
        {
            // Make the command
            Command connectionChecker = new Command(async() =>
            {
                while (true)
                {
                    if (RCClientHelpers.PingServer(RCClientHelpers.LatestIPAddress, RCClientHelpers.ServerPort, waitTime))
                    {
                        if (Client.SingletonRCClient.SingleRCClient.IsConnected)
                        {
                            this.CurrentPage = ApplicationPage.ControllerSelect;
                        }
                    }
                    else
                    {
                        this.CurrentPage = ApplicationPage.Login;
                        Client.SingletonRCClient.SingleRCClient.TcpClient.Disconnect();
                    }
                    await Task.Delay(delayBetweenCheck);
                }
            });

            // Start the listener
            connectionChecker.Execute(null);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Function for changing page
        /// </summary>
        /// <param name="applicationPage"></param>
        private void ChangePage(ApplicationPage applicationPage)
        {
            switch (applicationPage)
            {
            case ApplicationPage.ApparatMenu:
                //Change page to ApparatMenu
                ApparatMenu.Enabled = true;
                AddMenu.Enabled     = false;
                Settings.Enabled    = false;
                mainView.SelectTab(ApparatMenu);
                break;

            case ApplicationPage.ApparatSettings:
                //Change page to ApparatSettings
                ApparatMenu.Enabled = false;
                AddMenu.Enabled     = false;
                Settings.Enabled    = true;
                mainView.SelectTab(Settings);
                break;

            case ApplicationPage.AddApparat:
                //Change page to AddMenu
                ApparatMenu.Enabled = false;
                Settings.Enabled    = false;
                AddMenu.Enabled     = true;
                mainView.SelectTab(AddMenu);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 8
0
 internal void GoToPage(ApplicationPage page)
 {
     //Set the page
     CurrentPage = page;
     //Show the menu
     SideMenuVisible = page == ApplicationPage.Chat;
 }
Ejemplo n.º 9
0
        public void GoToPage(ApplicationPage page)
        {
            CurrentPage = page;

            //Show side menu
            SideMenuVisible = page == ApplicationPage.Main;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// The Factory Method
        /// </summary>
        /// <param name="page">The page to get</param>
        public Page GetPage(ApplicationPage page)
        {
            Page applicationPage = null;

            switch (page)
            {
            case ApplicationPage.Login:
            case ApplicationPage.AddingProducts:
            case ApplicationPage.ProductsManagement:
            case ApplicationPage.AddingCategory:
            case ApplicationPage.CategoriesManagement:
            case ApplicationPage.AddingClient:
            case ApplicationPage.ClientsManagement:
            case ApplicationPage.AddingSale:
            case ApplicationPage.SalesManagement:
            case ApplicationPage.AddingUser:
            case ApplicationPage.UsersManagement:
            case ApplicationPage.CreatingBackup:
            case ApplicationPage.RestoringSavedCopy:
                return(mApplicationPages[page]);

            default:
                break;
            }
            return(applicationPage);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and a view model, if any, and creates the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            // Find the appropriate page
            switch (page)
            {
            case ApplicationPage.WelcomePage:
                return(new WelcomePage(viewModel as WelcomeViewModel));

            case ApplicationPage.AppSettings:
                return(new UI.Pages.AppSettings());

            case ApplicationPage.DesktopWallpapers:
                return(new DesktopWallpapers());

            case ApplicationPage.MobileWallpapers:
                return(new MobileWallpapers());

            case ApplicationPage.MyWallpapers:
                return(new MyWallpapers(viewModel as MyWallpapersViewModel));

            case ApplicationPage.History:
                return(new History());

            case ApplicationPage.Wallpaper:
                return(new Wallpaper(viewModel as WallpaperViewModel));

            default:
                // Debugger.Break();
                return(null);
            }
        }
 private void ChangePage(ApplicationPage newPage)
 {
     if (newPage != CurrentPage)
     {
         CurrentPage = newPage;
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and a view model,if any, and creates the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            //Find the appropriate page
            switch (page)
            {
            case ApplicationPage.Login:
                return(new LoginPage(viewModel as LoginViewModel));

            case ApplicationPage.Register:
                return(new RegisterPage(viewModel as RegisterViewModel));

            case ApplicationPage.Chat:
                return(new ChatPage(viewModel as ChatMessageListViewModel));

            case ApplicationPage.DataGrid:
                return(new DataGridPage(viewModel as DataGridPageViewModel));

            case ApplicationPage.TextBox:
                return(new TextBoxPage(viewModel as TextBoxPageViewModel));

            default:
                Debugger.Break();
                return(null);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        ///     使用 GoToPage 的方法来切换页面,而不是通过直接赋值 CurrentPage
        ///     因为 ApplicationViewModel 有一个 SideMenuVisible 的属性,默认为 false
        ///     如果是 Login 或者 Register,我们是不用设置其为 true 的,
        ///     但是 ChatPage 我们需要设置其为 true
        ///     为了方便,我们通过 GoToPage 的方法,根据需要传入的 Page 页面来判断如何修改 ApplicationViewModel 中的属性
        /// </summary>
        /// <param name="targetPage"> The page you want to navigate to </param>
        public void GoToPage(ApplicationPage targetPage)
        {
            CurrentPage = targetPage;

            // Hide Side menu if it is not a chat page
            SideMenuVisible = targetPage == ApplicationPage.Chat;
        }
        /// <summary>
        /// Navigates to the specified modal
        /// </summary>
        /// <param name="page">The modal page to go to</param>
        /// <param name="viewModel">The view model, if any, to set explicitly to the new modal page</param>
        public void GoToModal(ApplicationPage page, BaseViewModel viewModel = null)
        {
            // Set the view model
            CurrentModalViewModel = viewModel;

            // See if page has changed
            var different = CurrentModalPage != page;

            // Set the current page
            CurrentModalPage = page;

            if (page == ApplicationPage.None)
            {
                DarkeningGridOpacity = 0.0f;
                IoC.Application.DarkeningGridOpacity = 0.0f;
                IoC.Application.PayButtonVisibility  = Visibility.Hidden;
                DarkeningGridVisibility = Visibility.Hidden;
            }

            // If the page hasn't changed, fire off notification
            // So pages still update if just the view model has changed
            if (!different)
            {
                OnPropertyChanged(nameof(CurrentModalPage));
            }
        }
        public static BasePage ToBasePage(this ApplicationPage page, object viewmodel = null)
        {
            switch (page)
            {
            case ApplicationPage.Login:
                return(new LoginPage(viewmodel as LoginViewModel));

            case ApplicationPage.Register:
                return(new RegisterPage(viewmodel as RegisterViewModel));

            case ApplicationPage.Game:
                return(new GamePage(viewmodel as GamePageViewModel));

            case ApplicationPage.GameInfoSelection:
                return(new GameInfoSelectionPage(viewmodel as GameInfoSelectionPageViewModel));

            case ApplicationPage.UsersDatabase:
                return(new UsersDatabasePage(viewmodel as UsersDatabasePageViewModel));

            case ApplicationPage.Welcome:
                return(new WelcomePage(viewmodel as WelcomePageViewModel));

            default:
                Debugger.Break();
                return(null);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Navigates the application to specified page
        /// </summary>
        /// <param name="page">The page to go to</param>
        public void GoToPage(ApplicationPage page)
        {
            // Change current page to specified one
            CurrentPage = page;

            App.Current.MainPage = page.ToApplicationPage();
        }
Ejemplo n.º 18
0
        public CardViewModel(CardModel model, ApplicationPage page)
        {
            _model = model;

            //DeleteTileCommand = new RelayCommand(() => DeleteTile());
            OpenPageCommand = new RelayCommand(() => OpenPage(page));
        }
        /// <summary>
        /// Navigate to the specified page
        /// </summary>
        /// <param name="page">The page to go to</param>
        public void GoToPage(ApplicationPage page)
        {
            CurrentPage = page;

            //Show side menu or not?
            SideMenuVisible = (page == ApplicationPage.Chat);
        }
    private void SetTitleBar()
    {
        ApplicationPage page = (ApplicationPage)Page;

        page.TitleBar.Text = string.Format(
            GetLocalResourceObject("ConfirmActivity_Description").ToString(), GetFromUser(), User.GetById(_UserId));
    }
Ejemplo n.º 21
0
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and view model, if any, and create the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            // Find the appropriate page
            switch (page)
            {
            case ApplicationPage.Login:
                return(new LoginPage(viewModel as LoginViewModel));

            case ApplicationPage.Dashboard:
                return(new DashboardPage(viewModel as DashboardViewModel));

            case ApplicationPage.Products:
                return(new ProductPage(viewModel as ProductViewModel));

            case ApplicationPage.Users:
                return(new UsersPage(viewModel as UserViewModel));

            case ApplicationPage.Customers:
                return(new CustomerPage(viewModel as CustomerViewModel));

            case ApplicationPage.Transaction:
                return(new TransactionPage(viewModel as TransactionViewModel));

            case ApplicationPage.Reports:
                return(new ReportPage(viewModel as ReportViewModel));

            default:
                Debugger.Break();
                return(null);
            }
        }
Ejemplo n.º 22
0
    protected override void OnFormBound()
    {
        base.OnFormBound();
        IHistory history = (IHistory)BindingSource.Current;

        SetScheduledByLabel(history);
        cmdDelete.OnClientClick = FormHelper.GetConfirmDeleteScript();
        ClientBindingMgr.RegisterSaveButton(cmdOK);

        bool isEditAllowed = CurrentUserId == history.UserId || CurrentUserId == "ADMIN";

        cmdDelete.Visible = isEditAllowed;
        cmdOK.Visible     = isEditAllowed;

        ApplicationPage page = (ApplicationPage)Page;

        page.TitleBar.Image = ResolveUrl(GetTitleBarImage());


        var parms = AppContext["ActivityParameters"] as System.Collections.Generic.Dictionary <string, string>;

        if ((parms != null) && parms.ContainsKey("AllowEditHistory"))
        {
            //means we dropped an email - the delete button should dissappear and cancel should delete the record...
            cmdDelete.Visible = false;
        }
    }
        public static BasePage          ToBasePage(this ApplicationPage page)
        {
            switch (page)
            {
            case ApplicationPage.Login:
                return(new LoginPage());

            case ApplicationPage.Register:
                return(new RegisterPage());

            case ApplicationPage.UserPage:
                return(new UserPage());

            case ApplicationPage.DispatcherPage:
                return(new DispatcherPage());

            case ApplicationPage.Driver:
                return(new DriverPage());

            case ApplicationPage.Admin:
                return(new AdminPage());

            default:
                Debugger.Break();
                return(null);
            }
        }
        /// <summary>
        /// Changes the current page of the main window.
        /// </summary>
        /// <param name="page">Redirect application to this page.</param>
        protected void ChangePage(ApplicationPage page)
        {
            WindowViewModel windowViewModel = ((WindowViewModel)((MainWindow)Application.Current.MainWindow).DataContext);

            windowViewModel.PreviousPage = windowViewModel.CurrentPage;
            windowViewModel.CurrentPage  = page;
        }
Ejemplo n.º 25
0
        private void LoadPages()
        {
            StopTimer();

            try
            {
                if (_pageArray[_counter] == "Instagram")
                {
                    CurrentPage = ApplicationPage.Instagram;
                }
                else if (_pageArray[_counter] == "Telephone")
                {
                    CurrentPage = ApplicationPage.Telephone;
                }
                else if (_pageArray[_counter] == "Calendar")
                {
                    CurrentPage = ApplicationPage.Calendar;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Что-то пошло не так..." + e.Message, "", MessageBoxButton.OK,
                                MessageBoxImage.Warning);
            }

            NotifyOfPropertyChange(() => CurrentPage);
            _progressBar = 0;
            StartTimer();
        }
Ejemplo n.º 26
0
 public virtual void Update(ApplicationPage entity)
 {
     if (entity != null)
     {
         this.Context.Entry <ApplicationPage>(entity).State = EntityState.Modified;
     }
 }
Ejemplo n.º 27
0
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and a view model, if any, and creates the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            switch (page)
            {
            case ApplicationPage.Dashboard:
                return(new Dashboard());

            case ApplicationPage.DiaryLog:
                return(new DiaryLog());

            case ApplicationPage.ToDoList:
                return(new ToDoLog());

            case ApplicationPage.WorkoutLog:
                return(new WorkoutLog());

            case ApplicationPage.PocketBank:
                return(new PocketBank());

            case ApplicationPage.BookLog:
                return(new BookLog());

            case ApplicationPage.Notebook:
                return(new Notebook());

            case ApplicationPage.AppSettings:
                return(new UI.Pages.AppSettings());

            default:
                return(new WelcomePage());
            }
        }
        public void Navigate(ApplicationPage sourcePage)
        {
            NavigateEventArgs args = new NavigateEventArgs();

            args.Page = sourcePage;
            OnNavigate(args);
        }
Ejemplo n.º 29
0
        public void BeSubmittedWhenValid()
        {
            const string FirstName = "Sarah";
            const string LastName  = "Smith";
            const string Number    = "123456-A";
            const string Age       = "18";
            const string Income    = "50000";

            using (IWebDriver driver = new ChromeDriver())
            {
                var applicationPage = new ApplicationPage(driver);
                applicationPage.NavigateTo();

                applicationPage.EnterFirstName(FirstName);
                applicationPage.EnterLastName(LastName);
                applicationPage.EnterFrequentFlyerNumber(Number);
                applicationPage.EnterAge(Age);
                applicationPage.EnterGrossAnnualIncome(Income);
                applicationPage.ChooseMaritalStatusSingle();
                applicationPage.ChooseBusinessSourceTV();
                applicationPage.AcceptTerms();
                ApplicationCompletePage applicationCompletePage =
                    applicationPage.SubmitApplication();

                applicationCompletePage.EnsurePageLoaded();

                Assert.Equal("ReferredToHuman", applicationCompletePage.Decision);
                Assert.NotEmpty(applicationCompletePage.ReferenceNumber);
                Assert.Equal($"{FirstName} {LastName}", applicationCompletePage.FullName);
                Assert.Equal(Age, applicationCompletePage.Age);
                Assert.Equal(Income, applicationCompletePage.Income);
                Assert.Equal("Single", applicationCompletePage.RelationshipStatus);
                Assert.Equal("TV", applicationCompletePage.BusinessSource);
            }
        }
Ejemplo n.º 30
0
        public void OpenPage(ApplicationPage page)
        {
            Debug.WriteLine("Going to page...");

            //Open the page
            IoC.Get <ApplicationViewModel>().CurrentPage = page;
        }
        /// <summary>
        /// Takes a <see cref="ApplicationPage"/> and a view model, if any, and creates the desired page
        /// </summary>
        /// <param name="page"></param>
        /// <param name="viewModel"></param>
        /// <returns></returns>
        public static BasePage ToBasePage(this ApplicationPage page, object viewModel = null)
        {
            // Find the appropriate page
            switch (page)
            {
            case ApplicationPage.Main:
                return(new MainPage(viewModel as MainPageViewModel));

            case ApplicationPage.Help:
                return(new HelpPage());

            case ApplicationPage.About:
                return(new AboutPage());

            case ApplicationPage.Settings:
                return(new SettingsPage());

            case ApplicationPage.Experimental:
                return(new ExperimentalPage());

            default:
                Debugger.Break();
                return(null);
            }
        }
Ejemplo n.º 32
0
        protected AnalyticsBase(ApplicationPage appPage, IAggregateService aggregateService)
        {
            if (aggregateService == null)
                throw new ArgumentNullException("aggregateService");

            this.AggregateService = aggregateService; 
            this.appPage = appPage;
            if (appPage != ApplicationPage.SplashScreen)
                this.weather = UnitOfWork.WeatherRepository.Get();
        }
 public void GoToPage(ApplicationPage page)
 {
     switch (page)
     {
         case ApplicationPage.NewControl1:
             _stage.Child = new UserControl1();
             break;
         case ApplicationPage.NewWindow2:
             var win = new Window2();
             win.Show();
             break;
     }
 }
Ejemplo n.º 34
0
 public LinkHandler(ApplicationPage page)
 {
     _page = page;
 }
        public void Prerequisites()
        {
            bool isMenuSelected = false;
            int stepNo = 0;
            int applicationNumber = 0;
            int indexNumber = 0;
            int fileNumber = 0;
            // Gets scriptname through reflection
            string testScriptName = GetTestScriptName();

            // Loads config data and creates a Singleton object of Configuration and loads data into generic test case variables
            GetConfigData();

            // Get process exe file path
            string[] processPath = PrepareProcessFilePath();

            // Get debug viewer exe file path
            string configFilesLocation = PrepareConfigureDataFilePath();

            // Get log directory details from xml file
            PrepareLogDirectoryPath(configFilesLocation);

            // Start debug viewer
            ApplicationLog applicationLog = new ApplicationLog(configFilesLocation, reportFileDirectory, testScriptName);
            applicationLog.StartDebugViewer();

            // Prepare test data file path
            string testDataFilePath = PrepareTestDataFilePath(testScriptName);

            string applicationName = null;

            SessionHandler sessionHandler = new SessionHandler();
            Browser browser = sessionHandler.GetBrowserInstance();
            try
            {
                if (null == browser)
                {
                    browser = BrowserFactory.Instance.GetBrowser(browserId, testScriptName, configFilesLocation);
                    LoginPage loginPage = new LoginPage(browser);
                    stepNo++;
                    SearchPage searchPageNew = loginPage.Login(this.userName, this.password, this.applicationURL, this.timeout, processPath);
                    Assert.IsNotNull(searchPageNew, "Failed to login in application");
                    WriteLogs(testScriptName, stepNo, "Login succssfull.", "PASS", browser);

                }

                SearchPage searchPage = new SearchPage(browser);
                string emailAddress = GetValuesFromXML("Prerequisite", "EmailAddress", testDataFilePath);
                string userPassword = GetValuesFromXML("Prerequisite", "Password", testDataFilePath);

                stepNo++;
                isMenuSelected = searchPage.SelectMenuItem("Admin", "User Configurations", null);
                Assert.IsTrue(isMenuSelected, "Navigation to User Configurations page failed.");
                WriteLogs(testScriptName, stepNo, "Navigation to User Configurations page passed.", "PASS", browser);

                for (int count1 = 1; count1 <= 2; count1++)
                {
                    string userNode = "User";
                    userNode = userNode + count1.ToString();
                    string user = GetValuesFromXML("Prerequisite", userNode, testDataFilePath);

                    stepNo++;
                    UserConfigurationPage userConfigurationPage = new UserConfigurationPage(browser);
                    userConfigurationPage = userConfigurationPage.VerifyUserPresent(user);

                    if (null == userConfigurationPage)
                    {
                        stepNo++;
                        userConfigurationPage = new UserConfigurationPage(browser);
                        UserDetailsPage userDetailsPage = userConfigurationPage.ClickAddUserButton();
                        Assert.IsNotNull(userDetailsPage, "Click add user failed");
                        WriteLogs(testScriptName, stepNo, "Add user button Clicked", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userDetailsPage.AddUpdateUser(user, emailAddress, userPassword,true,false);
                        Assert.IsNotNull(userConfigurationPage, "Adding user failed");
                        WriteLogs(testScriptName, stepNo, "Adding user passed", "PASS", browser);

                        stepNo++;
                        UserPermissionPage userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user);
                        Assert.IsNotNull(userPermissionPage, "Click User aceess button failed");
                        WriteLogs(testScriptName, stepNo, "Click User aceess button passed", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.UncheckResetPasswordNextLoginCheckbox();
                        Assert.IsNotNull(userPermissionPage, "Uncheck Reset Password Next Login Checkbox failed");
                        WriteLogs(testScriptName, stepNo, "Uncheck Reset Password Next Login Checkbox passed", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button User Permission failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button User Permission passed", "PASS", browser);
                    }
                    else
                    {
                        WriteLogs(testScriptName, stepNo, "User already present", "PASS", browser);
                    }
                }
                string appliactionCount = GetValuesFromXML("Prerequisite", "ApplicationCount", testDataFilePath);
                int count = Int32.Parse(appliactionCount);
                for (applicationNumber = 1; applicationNumber <= count; applicationNumber++)
                {
                    string applicationNameNode = "Application";
                    applicationNameNode = applicationNameNode + applicationNumber.ToString();
                    applicationName = GetValuesFromXML(applicationNameNode, "Name", testDataFilePath);

                    //Navigating To Applications Page
                    stepNo++;
                    isMenuSelected = searchPage.SelectMenuItem("Admin", "Applications", null);
                    Assert.IsTrue(isMenuSelected, "Navigation to application page failed.");
                    WriteLogs(testScriptName, stepNo, "Navigation to application page passed.", "PASS", browser);

                    stepNo++;
                    ApplicationPage applicationPage = new ApplicationPage(browser);
                    applicationPage = applicationPage.IsApplicationExist(applicationName);
                    if (null == applicationPage)
                    {
                        applicationPage = new ApplicationPage(browser);
                        AddApplicationPage addApplicationPage = applicationPage.ClickAddApplicationButton();
                        Assert.IsNotNull(addApplicationPage, "Click add application failed");
                        WriteLogs(testScriptName, stepNo, "Add Application Button Clicked", "PASS", browser);

                        stepNo++;
                        EditApplicationPage editApplicationPage = new EditApplicationPage(browser);
                        if (applicationNumber == 4)
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, false, false, false, false, false, true, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application Added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application Added Succesfully ", "PASS", browser);
                        }
                        else if (applicationNumber == 1 || applicationNumber == 5)
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, false, false, false, false, false, false, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application Added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application Added Succesfully ", "PASS", browser);
                        }
                        else
                        {
                            editApplicationPage = addApplicationPage.addApplicationDetails(applicationName, applicationName, true, false, false, false, false, false, false, null);
                            Assert.IsNotNull(editApplicationPage, applicationName + " application added Failed");
                            WriteLogs(testScriptName, stepNo, applicationName + " application added Succesfully ", "PASS", browser);
                        }
                        string indexCount = GetValuesFromXML(applicationNameNode, "IndexCount", testDataFilePath);
                        int count1 = Int32.Parse(indexCount);
                        //Adding Application Index
                        for (indexNumber = 1; indexNumber <= count1; indexNumber++)
                        {
                            string indexNameNade = "IndexName";
                            string indexTypeNade = "IndexType";
                            indexNameNade = indexNameNade + indexNumber.ToString();
                            indexTypeNade = indexTypeNade + indexNumber.ToString();
                            string indexName = GetValuesFromXML(applicationNameNode, indexNameNade, testDataFilePath);
                            string indexType = GetValuesFromXML(applicationNameNode, indexTypeNade, testDataFilePath);
                            stepNo++;
                            if (1 == indexNumber)
                            {
                                editApplicationPage = editApplicationPage.AddApplicationIndex(true, indexName, indexType, false, false, false, false);
                            }
                            else
                            {
                                editApplicationPage = editApplicationPage.AddApplicationIndex(false, indexName, indexType, false, false, false, false);
                            }
                            Assert.IsNotNull(editApplicationPage, "Adding application index failed");
                            WriteLogs(testScriptName, stepNo, "Index in application Added Succesfully ", "PASS", browser);
                        }
                        //Implementing Application
                        stepNo++;
                        editApplicationPage = editApplicationPage.ImplementApplication(true);
                        Assert.IsNotNull(editApplicationPage, "Implement application failed for application " + applicationName);
                        WriteLogs(testScriptName, stepNo, applicationName + " application Implemented Succesfully ", "PASS", browser);

                        //Navigating To User Configuration Page
                        stepNo++;
                        isMenuSelected = searchPage.SelectMenuItem("Admin", "User Configurations", null);
                        Assert.IsTrue(isMenuSelected, "Navigating to user configuration failed");
                        WriteLogs(testScriptName, stepNo, "Navigation to User Configurations page passed.", "PASS", browser);

                        stepNo++;
                        UserConfigurationPage userConfigurationPage = new UserConfigurationPage(browser);
                        UserPermissionPage userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(this.userName);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        ApplicationLevelPermissionPage applicationLevelPermissionPage = userPermissionPage.NavigateToApplicationConfiguration(applicationName);
                        Assert.IsNotNull(applicationLevelPermissionPage, "Click  on application configuration image failed");
                        WriteLogs(testScriptName, stepNo, "Click on Application Configuration image ", "PASS", browser);

                        stepNo++;
                        applicationLevelPermissionPage = applicationLevelPermissionPage.SelectAllAccountFuncMgnt();
                        Assert.IsNotNull(applicationLevelPermissionPage, "Select all account function management failed");
                        WriteLogs(testScriptName, stepNo, "Select All Account Management Checkbox Clicked ", "PASS", browser);

                        stepNo++;
                        applicationLevelPermissionPage = applicationLevelPermissionPage.SelectAllCabinetMgnt();
                        Assert.IsNotNull(applicationLevelPermissionPage, "Select all cabinet mangement failed");
                        WriteLogs(testScriptName, stepNo, "Select All Cabinet Management Checkbox Clicked ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = applicationLevelPermissionPage.ClickUpdateButtonAppConf();
                        Assert.IsNotNull(userPermissionPage, "Update application level permissions failed");
                        WriteLogs(testScriptName, stepNo, "Update Application Level Permissions Clicked ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Update user permissions failed");
                        WriteLogs(testScriptName, stepNo, "Update User Permissions Clicked ", "PASS", browser);

                        string user1 = GetValuesFromXML("Prerequisite", "User1", testDataFilePath);
                        string user2 = GetValuesFromXML("Prerequisite", "User2", testDataFilePath);

                        stepNo++;
                        userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user1);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.CheckUncheckApplicationUserConf(applicationName, true);
                        Assert.IsNotNull(userPermissionPage, "Selecting Application for UserA failed");
                        WriteLogs(testScriptName, stepNo, "Selecting Application for UserA passed ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button passed ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userConfigurationPage.ClickAccessUserConfiguration(user2);
                        Assert.IsNotNull(userPermissionPage, "Click user Access link failed");
                        WriteLogs(testScriptName, stepNo, "Click on User Access on User Configuration Page ", "PASS", browser);

                        stepNo++;
                        userPermissionPage = userPermissionPage.CheckUncheckApplicationUserConf(applicationName, true);
                        Assert.IsNotNull(userPermissionPage, "Selecting Application for UserA failed");
                        WriteLogs(testScriptName, stepNo, "Selecting Application for UserA passed ", "PASS", browser);

                        stepNo++;
                        userConfigurationPage = userPermissionPage.ClickUpdateButtonUserPermission();
                        Assert.IsNotNull(userConfigurationPage, "Click Update Button failed");
                        WriteLogs(testScriptName, stepNo, "Click Update Button passed ", "PASS", browser);
                        applicationName = GetValuesFromXML(applicationNameNode, "Name", testDataFilePath);
                        string fileCount = GetValuesFromXML(applicationNameNode, "FileCount", testDataFilePath);
                        int count2 = Int32.Parse(fileCount);
                        string sourceFolder = this.currentDirectory + this.projectDirectory + "\\" + this.testDataDirectory + "\\" + testScriptName + "\\";
                        string[] files = new string[count2];
                        for (fileNumber = 1; fileNumber <= count2; fileNumber++)
                        {
                            string fileNameNode = "FileName";
                            fileNameNode = fileNameNode + fileNumber.ToString();
                            files[fileNumber - 1] = GetValuesFromXML(applicationNameNode, fileNameNode, testDataFilePath);
                        }
                        stepNo++;
                        bool isFilesCopied = userConfigurationPage.CopyFilesToIncomingFolder(applicationName, sourceFolder, files);
                        Assert.IsTrue(isFilesCopied, "Copying files to incoming folder failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Copying files to incoming folder passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        isMenuSelected = userConfigurationPage.SelectMenuItem("Indexing", null, null);
                        Assert.IsTrue(isMenuSelected, "Navigation to indexing page failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to indexing page passed ", "PASS", browser);

                        stepNo++;
                        IndexingPage indexingPage = new IndexingPage(browser);
                        indexingPage = indexingPage.SelectApplication(applicationName);
                        Assert.IsNotNull(indexingPage, "Select application failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Select application passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        isMenuSelected = userConfigurationPage.SelectMenuItem("Indexing", null, null);
                        Assert.IsTrue(isMenuSelected, "Navigation to indexing page failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to indexing page passed ", "PASS", browser);

                        stepNo++;
                        indexingPage = indexingPage.SelectApplication(applicationName);
                        Assert.IsNotNull(indexingPage, "Select application failed for " + applicationName);
                        WriteLogs(testScriptName, stepNo, "Select application passed for " + applicationName, "PASS", browser);

                        stepNo++;
                        indexingPage = indexingPage.NavigateToFirstPage();
                        Assert.IsNotNull(indexingPage, "Navigation to first document failed ");
                        WriteLogs(testScriptName, stepNo, "Navigation to first document passed ", "PASS", browser);

                        string indexValeNode = "IndexValue";
                        string indexValue = GetValuesFromXML(applicationNameNode, indexValeNode, testDataFilePath);
                        if (indexValue == "null")
                        {
                            indexValue = null;
                        }
                        for (fileNumber = 1; fileNumber <= count2; fileNumber++)
                        {
                            stepNo++;
                            indexingPage = indexingPage.AddIndexDetails(indexValue, applicationName);
                            Assert.IsNotNull(indexingPage, indexValue + " adding index failed for " + applicationName);
                            WriteLogs(testScriptName, stepNo, indexValue + " adding index passed for " + applicationName, "PASS", browser);
                        }
                    }
                    else
                    {
                        stepNo++;
                        WriteLogs(testScriptName, stepNo, applicationName + " application exist", "PASS", browser);
                    }
                }

            }
            catch (Exception exception)
            {
                stepNo++;
                WriteLogs(testScriptName, stepNo, "Execution of script terminated. Exception is " + exception.Message, "FAIL", browser);
                Assert.IsTrue(false, "Execution of script terminated.");
            }
            finally
            {

                sessionHandler.StoreBrowserInstance(browser);
                stepNo++;
                // to stop debeg viewer
                applicationLog.StopDebugViewer();
                bool isExceptionFound = applicationLog.VerifyDebugLogFiles(reportFileDirectory, testScriptName);
                if (!isExceptionFound)
                {
                    WriteLogs(testScriptName, stepNo, "Exception/error found in log file", "INFO", browser);
                }
            }
        }