Ejemplo n.º 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            WelcomForm welcom = new Page.WelcomForm();

            welcom.ShowDialog();
            change = new ChangePage(pageChange);
            Global.BindParms();
            Global.BindCardAndAxis();
            Global.BindDi();
            Global.BindDo();
            Global.BindTask();
            Global.Initial();
            Global.LoadParams();

            labMap.Add(PageName.pageProduct.ToString(), lblProduct);
            labMap.Add(PageName.pageSetting.ToString(), lblSetting);
            labMap.Add(PageName.pageCamera.ToString(), lblCamera);
            labMap.Add(PageName.pageAlarm.ToString(), lblAlarm);
            labMap.Add(PageName.pageChart.ToString(), lblChart);
            labMap.Add(PageName.pageInfo.ToString(), lblInfo);
            labMap.Add(PageName.pageLogin.ToString(), lblLogin);

            pageMap.Add(PageName.pageProduct.ToString(), new pageProduct());
            pageMap.Add(PageName.pageSetting.ToString(), new pageSetting());
            pageMap.Add(PageName.pageCamera.ToString(), new pageCamera());
            pageMap.Add(PageName.pageAlarm.ToString(), new pageAlarm());
            pageMap.Add(PageName.pageChart.ToString(), new pageChart());
            pageMap.Add(PageName.pageInfo.ToString(), new pageInfo());
            pageMap.Add(PageName.pageLogin.ToString(), new pageLogin());
            pageMap.Add(PageName.pageEngineer.ToString(), new pageEngineer());
            pageMap.Add(PageName.pageGRR.ToString(), new pageGRR());
            panelPage.Controls.Add(pageMap[PageName.pageLogin.ToString()]);
        }
Ejemplo n.º 2
0
        public void ShowConcreteLesson(TestKey key)
        {
            var test = _testService.GetTestByTaskDescription(key);

            RedirectDecorator.ToViewModel(ChangePage.CreateAndPassData(typeof(TestResultViewModel), typeof(UserTestModel), test)
                                          );
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the list of history items to show those on a new page
        /// </summary>
        /// <param name="pageModifier">Delegate to determine what page is being moved to</param>
        private void UpdateDisplay(ChangePage pageModifier)
        {
            History.Items.Clear();
            int historyLength = userHistory.Count();
            int newPageNum    = pageModifier(pageNum);

            if (newPageNum > -1 && newPageNum * resultsPerPage < historyLength) //Only change page if the requested number is valid
            {
                pageNum = newPageNum;
            }
            pageNumLabel.Text = "Page " + (pageNum + 1); //Add one as page num is zero indexed

            int startIndex  = pageNum * resultsPerPage;
            int pageEntries = historyLength - startIndex;

            if (pageEntries > resultsPerPage)
            {
                pageEntries = resultsPerPage;
            }

            for (int i = startIndex; i < startIndex + pageEntries; i++)
            {
                History.Items.Add(userHistory[i].Key + " " + userHistory[i].Value + "\n"); //TODO: Use string.format
            }
        }
        public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController)
        {
            var vc    = referenceViewController as PointsBaseViewController;
            var index = vc.PageIndex;

            //CurrentIndex = vc.PageIndex;
            if (CurrentIndex == -1)
            {
                CurrentIndex = 0;
            }
            else
            {
                CurrentIndex = vc.PageIndex;
            }
            index++;
            //if (index > (PageCount - 1))
            //    index = 0;
            if (SelectedIndex != -1)
            {
                CurrentIndex = index = SelectedIndex;
            }
            ChangePage?.Invoke(CurrentIndex, null);
            if (index > (PageCount - 1))
            {
                index = PageCount - 1;
                return(null);
            }
            return(_parentViewController.ViewControllerAtIndex(index));
        }
Ejemplo n.º 5
0
        public static void VerifyFieldValues(string module, ModuleData data)
        {
            string moduleSelected = module;

            if (module.Contains("Flex"))
            {
                //Determine if Flex module is valid
                bool moduleValid = false;
                for (int i = 1; i < 10; i++)
                {
                    if (module == ("Flex" + i))
                    {
                        moduleValid |= true;
                        break;
                    }
                }
                if (!moduleValid)
                {
                    log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                    Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                    return;
                }
                //Set module name to Flex
                moduleSelected = "Flex";
            }

            switch (moduleSelected)
            {
            case "Incident":
            {
                IncidentPage.VerifyTicketFieldValues(data);
                break;
            }

            case "Problem":
            {
                ProblemPage.VerifyTicketFieldValues(data);
                break;
            }

            case "Change":
            {
                ChangePage.VerifyTicketFieldValues(data);
                break;
            }

            case "Flex":
            {
                FlexPage.VerifyTicketFieldValues(data);
                break;
            }

            default:
            {
                log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                break;
            }
            }
        }
Ejemplo n.º 6
0
        public async Task PostSerializeReload(VersionController versionController)
        {
            ChangeLog changeLog = await versionController.GetChangeLog();

            if (EmptyPage.Visibility == Visibility.Visible)
            {
                return;
            }

            if (ChangeLogPage.Visibility == Visibility.Visible)
            {
                OpenPage(PageType.ChangeLog);
                return;
            }

            if (VersionPage.Visibility == Visibility.Visible)
            {
                VersionRef oldRef = VersionPage.GetRef();
                foreach (VersionRef versionRef in changeLog.Versions)
                {
                    if (versionRef.VersionName == oldRef.VersionName)
                    {
                        OpenPage(PageType.Version, versionRef);
                        return;
                    }
                }

                OpenPage(PageType.ChangeLog);
                return;
            }

            if (ChangePage.Visibility == Visibility.Visible)
            {
                VersionRef oldVersionRef = VersionPage.GetRef();
                ChangeRef  oldChangeRef  = ChangePage.GetChangeRef();
                foreach (VersionRef versionRef in changeLog.Versions)
                {
                    if (versionRef.VersionName == oldVersionRef.VersionName)
                    {
                        Version version = await versionRef.GetVersion();

                        foreach (ChangeRef changeRef in version.Changes)
                        {
                            if (changeRef.Guid == oldChangeRef.Guid)
                            {
                                OpenPage(PageType.Change, versionRef, changeRef);
                                return;
                            }
                        }

                        OpenPage(PageType.Version, versionRef);
                        return;
                    }
                }

                OpenPage(PageType.ChangeLog);
                return;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Moves through the local history of this tab, sending a new http request to the new url
        /// </summary>
        /// <param name="moveFunc">A delegate function to operate on the current page number and change it to a new page number</param>
        private void MoveInHistory(ChangePage moveFunc)
        {
            //Make sure the position in history is always valid
            Contract.Ensures(localHistoryPosition > -1);
            Contract.Ensures(localHistoryPosition < localHistory.Count());

            int newHistoryPosition = moveFunc(localHistoryPosition);

            if (newHistoryPosition > -1 && newHistoryPosition < localHistory.Count())
            {
                localHistoryPosition = newHistoryPosition;
                GetRequest(localHistory[localHistoryPosition], false);
            }
        }
 private void ChangePage(ChangePage message)
 {
     if (message.ViewModelType == typeof(FirstViewModel))
     {
         ShowFirstView();
     }
     else if (message.ViewModelType == typeof(SecondViewModel))
     {
         ShowSecondView();
     }
     else if (message.ViewModelType == typeof(ThirdViewModel))
     {
         ShowThirdView();
     }
 }
Ejemplo n.º 9
0
        public void OpenPage(PageType pageType, VersionRef versionRef = null, ChangeRef changeRef = null)
        {
            EmptyPage.Visibility     = Visibility.Collapsed;
            ChangeLogPage.Visibility = Visibility.Collapsed;
            VersionPage.Visibility   = Visibility.Collapsed;
            ChangePage.Visibility    = Visibility.Collapsed;

            switch (pageType)
            {
            case PageType.Empty:
                EmptyPage.Visibility = Visibility.Visible;
                break;

            case PageType.ChangeLog:
                ChangeLogPage.Visibility = Visibility.Visible;
                ChangeLogPage.Refresh();
                break;

            case PageType.Version:
                if (versionRef == null)
                {
                    return;
                }

                VersionPage.Visibility = Visibility.Visible;
                VersionPage.Refresh(versionRef);
                break;

            case PageType.Change:
                if (changeRef == null)
                {
                    return;
                }

                ChangePage.Visibility = Visibility.Visible;
                ChangePage.Refresh(changeRef);
                break;
            }
        }
Ejemplo n.º 10
0
 public Schema()
     : base()
 {
     InstanceType = typeof(__Paginati__);
     ClassName    = "PaginationPage";
     Properties.ClearExposed();
     Html = Add <__TString__>("Html");
     Html.DefaultValue = "/KitchenSink/PaginationPage.html";
     Html.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Html__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Html__ = (System.String)_v_; }, false);
     ChangePage = Add <__TLong__>("ChangePage$");
     ChangePage.DefaultValue = 0L;
     ChangePage.Editable     = true;
     ChangePage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__ChangePage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__ChangePage__ = (System.Int64)_v_; }, false);
     ChangePage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.ChangePage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.ChangePage)input); });
     NextPage = Add <__TLong__>("NextPage$");
     NextPage.DefaultValue = 0L;
     NextPage.Editable     = true;
     NextPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__NextPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__NextPage__ = (System.Int64)_v_; }, false);
     NextPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.NextPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.NextPage)input); });
     PreviousPage = Add <__TLong__>("PreviousPage$");
     PreviousPage.DefaultValue = 0L;
     PreviousPage.Editable     = true;
     PreviousPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__PreviousPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__PreviousPage__ = (System.Int64)_v_; }, false);
     PreviousPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.PreviousPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.PreviousPage)input); });
     LastPage = Add <__TLong__>("LastPage$");
     LastPage.DefaultValue = 0L;
     LastPage.Editable     = true;
     LastPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__LastPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__LastPage__ = (System.Int64)_v_; }, false);
     LastPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.LastPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.LastPage)input); });
     FirstPage = Add <__TLong__>("FirstPage$");
     FirstPage.DefaultValue = 0L;
     FirstPage.Editable     = true;
     FirstPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__FirstPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__FirstPage__ = (System.Int64)_v_; }, false);
     FirstPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.FirstPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.FirstPage)input); });
     Library = Add <__TArray__>("Library");
     Library.SetCustomGetElementType((arr) => { return(__PaLibraryE__.DefaultTemplate); });
     Library.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Library__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Library__ = (__Arr__)_v_; }, false);
     EntriesPerPage = Add <__TLong__>("EntriesPerPage$");
     EntriesPerPage.DefaultValue = 5L;
     EntriesPerPage.Editable     = true;
     EntriesPerPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__EntriesPerPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__EntriesPerPage__ = (System.Int64)_v_; }, false);
     EntriesPerPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.EntriesPerPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.EntriesPerPage)input); });
     PageEntries = Add <__TArray1__>("PageEntries");
     PageEntries.SetCustomGetElementType((arr) => { return(__PaPageEntr__.DefaultTemplate); });
     PageEntries.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__PageEntries__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__PageEntries__ = (__Arr1__)_v_; }, false);
     Pages = Add <__TArray2__>("Pages");
     Pages.SetCustomGetElementType((arr) => { return(__PaPagesEle__.DefaultTemplate); });
     Pages.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Pages__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Pages__ = (__Arr2__)_v_; }, false);
     TotalEntries = Add <__TLong__>("TotalEntries");
     TotalEntries.DefaultValue = 0L;
     TotalEntries.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__TotalEntries__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__TotalEntries__ = (System.Int64)_v_; }, false);
     TotalPages = Add <__TLong__>("TotalPages");
     TotalPages.DefaultValue = 0L;
     TotalPages.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__TotalPages__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__TotalPages__ = (System.Int64)_v_; }, false);
     CurrentPage = Add <__TLong__>("CurrentPage");
     CurrentPage.DefaultValue = 1L;
     CurrentPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__CurrentPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__CurrentPage__ = (System.Int64)_v_; }, false);
     CurrentOffset = Add <__TLong__>("CurrentOffset");
     CurrentOffset.DefaultValue = 0L;
     CurrentOffset.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__CurrentOffset__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__CurrentOffset__ = (System.Int64)_v_; }, false);
     DisableFirst = Add <__TBool__>("DisableFirst");
     DisableFirst.DefaultValue = true;
     DisableFirst.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__DisableFirst__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__DisableFirst__ = (System.Boolean)_v_; }, false);
     DisableLast = Add <__TBool__>("DisableLast");
     DisableLast.DefaultValue = false;
     DisableLast.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__DisableLast__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__DisableLast__ = (System.Boolean)_v_; }, false);
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 切換頁數
        /// </summary>
        /// <param name="CurrentPage"></param>
        private void SetCurrentPage(int CurrentPage, bool isNotify = true)
        {
            //先隱藏按鍵,等設定完狀態後在顯示,為了防止畫面閃爍用的;//
            btnArrowFirst.Visible = false;
            btnArrowLeft.Visible  = false;
            btnArrowRight.Visible = false;
            btnArrowLast.Visible  = false;

            if (m_TotalPage == 1)
            {
                m_CurrentPage = 1;

                btnArrowFirst.Enabled = false;
                btnArrowLeft.Enabled  = false;
                btnArrowRight.Enabled = false;
                btnArrowLast.Enabled  = false;
            }
            else if (CurrentPage >= m_TotalPage)
            {
                //表示切換至最後一頁;//
                m_CurrentPage = m_TotalPage;

                //關閉最後一頁及下一頁按鈕;//
                btnArrowFirst.Enabled = true;
                btnArrowLeft.Enabled  = true;
                btnArrowRight.Enabled = false;
                btnArrowLast.Enabled  = false;
            }
            else if (CurrentPage <= 1)
            {
                //表示切換至第一頁;//
                m_CurrentPage = 1;

                //關閉第一頁及前一頁按鈕;//
                btnArrowFirst.Enabled = false;
                btnArrowLeft.Enabled  = false;
                btnArrowRight.Enabled = true;
                btnArrowLast.Enabled  = true;
            }
            else
            {
                //表示切換到中間的頁數;//
                m_CurrentPage = CurrentPage;

                btnArrowFirst.Enabled = true;
                btnArrowLeft.Enabled  = true;
                btnArrowRight.Enabled = true;
                btnArrowLast.Enabled  = true;
            }

            //切換頁數通知;//
            if (isNotify == true)
            {
                ChangePage?.Invoke(m_CurrentPage);
            }

            //顯示現在的頁數;//
            tbCurrentPage.Text = m_CurrentPage.ToString();

            //按鍵設定完狀態後顯示,為了防止畫面閃爍用的;//
            btnArrowFirst.Visible = true;
            btnArrowLeft.Visible  = true;
            btnArrowRight.Visible = true;
            btnArrowLast.Visible  = true;
        }
Ejemplo n.º 12
0
        public void InfoUpdate(ChangePage changePage)
        {
            //start
            if (changePage == ChangePage.Start)
            {
                CurrentPage++;
                OffsetCurrentPage = CurrentPage - 1;
                ResPages[OffsetCurrentPage].CurrectCheckState = TickallCB.CheckState;

                foreach (var c in tabControl1.SelectedTab.Controls.OfType <CheckBox>().ToArray())
                {
                    ResPages[OffsetCurrentPage].CheckStates.Add(c.CheckState);
                }

                ResPages[OffsetCurrentPage].IsViewed = true;

                NameTB.Text = ResPages[OffsetCurrentPage].Name;
                tabControl1.SelectedTab.Text = NameTB.Text + ", PDF page:" + CurrentPage;
                PgNumL.Text    = "Page: " + CurrentPage;
                this.Text      = NameTB.Text + ", PDF page:" + CurrentPage;
                AddressTB.Text = ResPages[OffsetCurrentPage].Address;
                BarTB.Text     = ResPages[OffsetCurrentPage].Barcode;
                DelTB.Text     = ResPages[OffsetCurrentPage].DeliveryDate;
                ConTB.Text     = ResPages[OffsetCurrentPage].ConsignmentNumber;
                PostTB.Text    = ResPages[OffsetCurrentPage].PostCode;
                TelTB.Text     = ResPages[OffsetCurrentPage].Telephone;
                LocatTB.Text   = ResPages[OffsetCurrentPage].Location;
                LocatNoTB.Text = ResPages[OffsetCurrentPage].LocationNumber;
                ParcelTB.Text  = ResPages[OffsetCurrentPage].ParcelNumber;

                if (CurrentPage == MaxPg)
                {
                    Continue.Text = "Finish";
                }

                return;
            }

            //Change page to next page
            if (changePage == ChangePage.Next)
            {
                //foreach (CheckBox c in tabControl1.SelectedTab.Controls.OfType<CheckBox>())
                var idex = 0;
                foreach (var c in tabControl1.SelectedTab.Controls.OfType <CheckBox>())
                {
                    ResPages[OffsetCurrentPage].CheckStates[idex] = c.CheckState;
                    idex++;
                }

                ResPages[OffsetCurrentPage].IsViewed          = true;
                ResPages[OffsetCurrentPage].CurrectCheckState = TickallCB.CheckState;

                if (CurrentPage < MaxPg)
                {
                    CurrentPage++;
                    OffsetCurrentPage++;
                    TickallCB.CheckState = ResPages[OffsetCurrentPage].CurrectCheckState;

                    if (ResPages[OffsetCurrentPage].IsViewed)
                    {
                        var index = 0;
                        foreach (var checkBox in tabControl1.SelectedTab.Controls.OfType <CheckBox>())
                        {
                            checkBox.CheckState = ResPages[OffsetCurrentPage].CheckStates[index];
                            index++;
                        }
                    }
                    else if (!ResPages[OffsetCurrentPage].IsViewed)
                    {
                        foreach (var checkBox in tabControl1.SelectedTab.Controls.OfType <CheckBox>().ToArray())
                        {
                            checkBox.CheckState = CheckState.Unchecked;
                            ResPages[OffsetCurrentPage].CheckStates.Add(checkBox.CheckState);
                        }
                    }

                    //textfields
                    NameTB.Text = ResPages[OffsetCurrentPage].Name;
                    tabControl1.SelectedTab.Text = NameTB.Text + ", PDF page:" + CurrentPage;
                    PgNumL.Text    = "Page: " + CurrentPage;
                    this.Text      = NameTB.Text + ", PDF page:" + CurrentPage;
                    AddressTB.Text = ResPages[OffsetCurrentPage].Address;
                    BarTB.Text     = ResPages[OffsetCurrentPage].Barcode;
                    DelTB.Text     = ResPages[OffsetCurrentPage].DeliveryDate;
                    ConTB.Text     = ResPages[OffsetCurrentPage].ConsignmentNumber;
                    PostTB.Text    = ResPages[OffsetCurrentPage].PostCode;
                    TelTB.Text     = ResPages[OffsetCurrentPage].Telephone;
                    LocatTB.Text   = ResPages[OffsetCurrentPage].Location;
                    LocatNoTB.Text = ResPages[OffsetCurrentPage].LocationNumber;
                    ParcelTB.Text  = ResPages[OffsetCurrentPage].ParcelNumber;

                    //end
                    if (CurrentPage > 1)
                    {
                        PrevBtn.Enabled = true;
                    }

                    if (CurrentPage == MaxPg)
                    {
                        Continue.Text = "Finish";
                    }
                }
                else if (CurrentPage == MaxPg)
                {
                    var checkStates     = new List <CheckState>();
                    var uncheckedNumber = 0;
                    var pageCount       = ResPages.Count();
                    for (var index = 0; index < pageCount; index++)
                    {
                        foreach (var checkState in ResPages[index].CheckStates)
                        {
                            if (checkState == CheckState.Unchecked)
                            {
                                uncheckedNumber++;
                            }
                        }
                    }

                    if (uncheckedNumber > 0)
                    {
                        var chkinfo = new CHKINFO();
                        chkinfo.ShowDialog();
                    }
                    else if (uncheckedNumber == 0)
                    {
                        var completed = new Completed(this);
                        completed.ShowDialog();
                        start.ArchivePDF();
                        Close();
                    }
                }
            }

            //Change page to previous page
            if (changePage == ChangePage.Previous)
            {
                var index = 0;
                foreach (var checkBox in tabControl1.SelectedTab.Controls.OfType <CheckBox>())
                {
                    ResPages[OffsetCurrentPage].CheckStates[index] = checkBox.CheckState;
                    index++;
                }

                ResPages[OffsetCurrentPage].IsViewed          = true;
                ResPages[OffsetCurrentPage].CurrectCheckState = TickallCB.CheckState;

                CurrentPage--;
                OffsetCurrentPage    = CurrentPage - 1;
                TickallCB.CheckState = ResPages[OffsetCurrentPage].CurrectCheckState;

                if (ResPages[OffsetCurrentPage].IsViewed)
                {
                    var i = 0;
                    foreach (var c in tabControl1.SelectedTab.Controls.OfType <CheckBox>())
                    {
                        c.CheckState = ResPages[OffsetCurrentPage].CheckStates[i];
                        i++;
                    }
                }
                else if (!ResPages[OffsetCurrentPage].IsViewed)
                {
                    foreach (var c in tabControl1.SelectedTab.Controls.OfType <CheckBox>().ToArray())
                    {
                        ResPages[OffsetCurrentPage].CheckStates.Add(c.CheckState);
                    }
                }

                if (CurrentPage + 1 > 1)
                {
                    if (CurrentPage + 1 == MaxPg)
                    {
                        Continue.Text = "Next";
                    }

                    NameTB.Text = ResPages[OffsetCurrentPage].Name;
                    tabControl1.SelectedTab.Text = NameTB.Text + ", PDF page:" + CurrentPage;
                    PgNumL.Text    = "Page: " + CurrentPage;
                    this.Text      = NameTB.Text + ", PDF page:" + CurrentPage;
                    AddressTB.Text = ResPages[OffsetCurrentPage].Address;
                    BarTB.Text     = ResPages[OffsetCurrentPage].Barcode;
                    DelTB.Text     = ResPages[OffsetCurrentPage].DeliveryDate;
                    ConTB.Text     = ResPages[OffsetCurrentPage].ConsignmentNumber;
                    PostTB.Text    = ResPages[OffsetCurrentPage].PostCode;
                    TelTB.Text     = ResPages[OffsetCurrentPage].Telephone;
                    LocatTB.Text   = ResPages[OffsetCurrentPage].Location;
                    LocatNoTB.Text = ResPages[OffsetCurrentPage].LocationNumber;
                    ParcelTB.Text  = ResPages[OffsetCurrentPage].ParcelNumber;

                    if (CurrentPage == 1)
                    {
                        PrevBtn.Enabled = false;
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public static void AmIOnTicketPageSwitch(string module, string ticketNum)
        {
            switch (module)
            {
            case "Incident":
            {
                IncidentPage.AmIOnPage();
                IncidentPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Incident task":
            {
                IncidentTaskPage.AmIOnPage();
                IncidentTaskPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Problem":
            {
                ProblemPage.AmIOnPage();
                ProblemPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Change":
            {
                ChangePage.AmIOnPage();
                ChangePage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Change task":
            {
                ChangeTaskPage.AmIOnPage();
                ChangeTaskPage.IsTicketNumberCorrect(ticketNum);
                break;
            }

            case "Flex1":
            {
                FlexPage.AmIOnPage(module);
                FlexPage.IsTicketNumberCorrect(module, ticketNum);
                break;
            }

            case "Flex2":
            {
                FlexPage.AmIOnPage(module);
                FlexPage.IsTicketNumberCorrect(module, ticketNum);
                break;
            }

            case "Announcement":
            {
                AnnouncementPage.AmIOnPage();
                break;
            }

            case "Knowledge Base":
            {
                KBPage.AmIOnPage(ticketNum);
                break;
            }

            case "Survey":
            {
                SurveyPage.AmIOnPage();
                break;
            }

            case "Report":
            {
                ReportsPage.AmIOnPage();
                break;
            }

            case "CI":
            {
                CIPage.AmIOnPage(ticketNum);
                break;
            }

            default:
            {
                log.Error("This module[" + module + "] does not exist. Check the feature file for errors.");
                Assert.Fail("This module[" + module + "] does not exist. Check the feature file for errors.");
                break;
            }
            }
        }