Example #1
0
        public void PromptToSaveChangesOnNavigationToOtherScreen()
        {
            #region Data Pupil Setup

            #region Create a new pupil, so that it can be attached later to the newly created contact1

            AutomationSugar.Log("Data Creation started");
            Guid        pupilId       = Guid.NewGuid();
            DataPackage dataPackage   = this.BuildDataPackage();
            var         pupilSurname  = Utilities.GenerateRandomString(10, "LinkForPupil2");
            var         pupilForename = Utilities.GenerateRandomString(10, "LinkForPupil2" + Thread.CurrentThread.ManagedThreadId);
            dataPackage.AddBasicLearner(pupilId, pupilSurname, pupilForename, new DateTime(2005, 10, 01), new DateTime(2012, 08, 01));

            #endregion
            DataSetup DataSetPupil = new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage);


            #endregion

            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            NavigateToOtherScreen.GoToRoomScreen();
            RoomPage SchoolRoomPage = new RoomPage();
            SchoolRoomPage.CreateSchoolRoom();
            SchoolRoomPage.EnterShortName("Rm60");
            AddressBookSearchPage searchBox = new AddressBookSearchPage();
            searchBox.ClearText();
            searchBox.EnterSearchTextForPupils(pupilForename);
            AddressBookPopup popup = searchBox.ClickOnFirstPupilRecord();
            popup.ClickPupilDetailsLink();
            popup.WaitForConfirmationDialogToAppear();
            WebContext.Screenshot();
            bool DialogDisplayed = SeleniumHelper.Get("save_continue_commit_dialog").Displayed;
            Assert.IsTrue(DialogDisplayed, "Failure to popup confirmation Dialog");
        }
Example #2
0
        private void btnAddReservation_Click(object sender, EventArgs e)
        {
            this.Hide();
            RoomPage roomPage = new RoomPage(restEasy);

            roomPage.Show(restEasy);
        }
Example #3
0
        public void RoomLongNameMaxFieldLength()
        {
            RoomPage schoolRoomPage = FacilitiesNavigation.NavigateToRoomPage();

            schoolRoomPage.CreateSchoolRoom();
            schoolRoomPage.WaitForCancelButttonToAppear();
            Assert.IsTrue(schoolRoomPage.Longname.GetAttribute("maxlength") == "32");
        }
Example #4
0
        public void CheckDeniedAccessWithHalfDataTodelInRoomPage()
        {
            SenderMail SenderMail = new SenderMail();
            RoomPage   Page       = new RoomPage();

            SenderMail.PosName = "Менеджер";
            bool Predict = false;
            bool result  = Page.CheckForDel(2);

            Assert.AreEqual(Predict, result);
        }
Example #5
0
        public void CheckGrantedAccessTodelInRoomPage()
        {
            SenderMail SenderMail = new SenderMail();
            RoomPage   Page       = new RoomPage();

            SenderMail.PosName = "Администратор";
            bool Predict = true;
            bool result  = Page.CheckForDel(2);

            Assert.AreEqual(Predict, result);
        }
Example #6
0
        public void CheckDeniedAccessTodelInRoomPageHalfData()
        {
            SenderMail SenderMail = new SenderMail();
            RoomPage   Page       = new RoomPage();

            SenderMail.PosName = "Администратор";
            bool Predict = false;
            bool result  = Page.CheckForDel(0);

            Assert.AreEqual(Predict, result);
        }
 public MainViewModel(FurniturePage furniturePage, OrderPage orderPage, ClientPage clientPage, ServicePage servicePage, RoomPage roomPage)
 {
     this.furniturePage = furniturePage;
     this.orderPage     = orderPage;
     this.roomPage      = roomPage;
     this.clientPage    = clientPage;
     this.servicePage   = servicePage;
     SetFurniturePage   = new DelegateCommand((o) => { control = furniturePage; form = furniturePage.ViewModel; NotifyPropertyChanged("CurrentPage"); NotifyPropertyChanged("Form"); furniturePage.ViewModel.Update(); });
     SetOrderPage       = new DelegateCommand((o) => { control = orderPage; form = orderPage.ViewModel; NotifyPropertyChanged("CurrentPage"); NotifyPropertyChanged("Form"); orderPage.ViewModel.Update(); });
     SetRoomPage        = new DelegateCommand((o) => { control = roomPage; form = roomPage.ViewModel; NotifyPropertyChanged("CurrentPage"); NotifyPropertyChanged("Form"); roomPage.ViewModel.Update(); });
     SetServicePage     = new DelegateCommand((o) => { control = servicePage; form = servicePage.ViewModel; NotifyPropertyChanged("CurrentPage"); NotifyPropertyChanged("Form"); servicePage.ViewModel.Update(); });
     SetClientPage      = new DelegateCommand((o) => { control = clientPage; form = clientPage.ViewModel; NotifyPropertyChanged("CurrentPage"); NotifyPropertyChanged("Form"); clientPage.ViewModel.Update(); });
 }
Example #8
0
        private void SearchAndClickRoom(RoomPage roomPage, string shortRoomName, string longRoomName)
        {
            TestResultReporter.Log("Searching room >> " + shortRoomName);

            roomPage.EnterShortNameSearchPanel(shortRoomName);
            roomPage.EnterLongNameSearchPanel(longRoomName);
            roomPage.ClickSeachRoomButton();
            SearchResults.WaitForResults();
            Assert.IsTrue(SearchResults.HasResults(1));
            TestResultReporter.Log(string.Format("Room '{0}' FOUND!!", shortRoomName));

            roomPage.ClickSearchResults();
            SearchResults.WaitForResults();
            TestResultReporter.Log(string.Format("Opened Room '{0}'", shortRoomName));
        }
Example #9
0
 public ViewModelRoom()
 {
     Data = new List <ViewChart>()
     {
         /*operationRoom,
          * examinationRoom,
          * hospitalRoom*/
         new ViewChart {
             Type = "Hospital Room", Count = RoomPage.GetRoomCount("hospitalRoom")
         },
         new ViewChart {
             Type = "Operation Room", Count = RoomPage.GetRoomCount("operationRoom")
         },
         new ViewChart {
             Type = "Examination Room", Count = RoomPage.GetRoomCount("examinationRoom")
         }
     };
 }
Example #10
0
        public void PromptSaveChangesPupilContact()
        {
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            NavigateToOtherScreen.GoToRoomScreen();
            RoomPage SchoolRoomPage = new RoomPage();

            SchoolRoomPage.CreateSchoolRoom();
            SchoolRoomPage.EnterShortName("Rm60");
            AddressBookSearchPage searchBox = new AddressBookSearchPage();

            searchBox.ClearText();
            searchBox.EnterSearchTextForPupilContacts("Jonathan");
            searchBox.ClickOnFirstPupilContactRecord();    //Bug 30498
            AddressBookPopup popup = new AddressBookPopup();

            popup.ClickPupilContactsDetailsLink();
            popup.WaitForConfirmationDialogToAppear();
            WebContext.Screenshot();
            bool DialogDisplayed = SeleniumHelper.Get("save_continue_commit_dialog").Displayed;

            Assert.IsTrue(DialogDisplayed, "Failure to popup confirmation Dialog");
        }
Example #11
0
 public override void OnInstance()
 {
     base.OnInstance();
     panel = roomPage = RoomPage.Instance;
 }
Example #12
0
        public MainWindow(LoginWindow loginWindow)
        {
            // 这就是主窗口
            Application.Current.MainWindow = this;

            this.loginWindow = loginWindow;
            roomPage         = new RoomPage(this);

            InitializeComponent();

#if !DEBUG
            this.WindowState = System.Windows.WindowState.Maximized;
            this.Topmost     = true;

            // 防止超出第一屏幕在第二屏幕边缘也显示
            this.ResizeMode = System.Windows.ResizeMode.NoResize;
#endif


            // 添加处理事件
            this.AddHandler(PublicEvents.ForwardEvent, new RoutedEventHandler(HandleForward), true);


            MainViewModel viewModel = new MainViewModel(this, new Action(() =>
            {
                new Action(() =>
                {
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        loginWindow.Init();
                        loginWindow.Show();
                        this.Hide();
                        return;
                    }));
                }).BeginInvoke(null, null);
            }), new Action(() =>
            {
                roomPage.RefreshRoomList();
            }));

            viewModel.Init();
            this.DataContext = viewModel;



            //鼠标不需要显示
            if (!Res.Resources.GetRes().DisplayCursor)
            {
                Mouse.OverrideCursor = Cursors.None;
            }

            // 注册热键(开钱箱)
            //RegHotKey();
            RoutedCommand openCashCmd = new RoutedCommand();
            openCashCmd.InputGestures.Add(new KeyGesture(Key.Z, ModifierKeys.Alt));
            CommandBindings.Add(new CommandBinding(openCashCmd, (x, y) =>
            {
                Common.GetCommon().OpenCashDrawer();
            }));


            InitAnimation();



            Microsoft.Win32.SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);

            this.Loaded += (x, y) =>
            {
                if (!_isLoaded)
                {
                    _isLoaded = true;

                    // 注册热键
                    RegHotKey();
                    //RegHotKey2();

                    // 点歌系统设置呼叫器时间(消准)
                    if (Res.Resources.GetRes().IsRequired("Vod"))
                    {
                        // 设置设备(呼叫器)时间
                        System.Threading.Tasks.Task.Factory.StartNew(() =>
                        {
                            Common.GetCommon().SetDeviceTime();
                        });
                    }


                    // 加载第二屏幕
                    if (Res.Resources.GetRes().DisplaySecondMonitor)
                    {
                        FullScreenMonitor.Instance.Initial((int)this.Left, (int)this.Top, (int)this.Width, (int)this.Height);
                    }
                }
            };
        }
Example #13
0
        public void ClientTestInitialize()
        {
            bool pageInitialized         = false;
            bool isInitializingCompleted = false;

            EnqueueConditional(() => TestGlobals.Initialized);
            EnqueueCallback(() =>
            {
                roomPage         = new RoomPage();
                viewModelFactory = roomPage.ViewModelFactory;
                viewModelFactory.MessageService = new TestMessageService();
                viewModelFactory.RoomService.CreateClient();
                companyVm                   = viewModelFactory.GetViewModel <CompanyViewModel>();
                companyVm.Model             = TestGlobals.Company;
                authenticationGroupVm       = viewModelFactory.GetViewModel <AuthenticationGroupViewModel>();
                authenticationGroupVm.Model = TestGlobals.AuthenticationGroup;
                localUserVm                 = viewModelFactory.GetViewModel <LocalUserViewModel>();
                localUserVm.CompanyInfo     = new TestCompanyInfo();
                roomVm = viewModelFactory.GetViewModel <RoomViewModel>();

                // Simulates the results of the private InitializeAsync() method.
                roomVm.UserTag           = TestGlobals.OwnerUserTag;
                roomVm.RoomName          = TestGlobals.RoomName;
                DataGlobals.LoginSession = localUserVm.LoginSession;
                DataGlobals.OwnerUserTag = TestGlobals.OwnerUserTag;
                DataGlobals.RoomName     = TestGlobals.RoomName;

                localUserVm.Login(TestGlobals.UserTag, TestGlobals.Password, loginError => roomVm.JoinRoom(joinRoomError =>
                {
                    roomPage.PageInitialized += (page, initializedArgs) => Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        workspaceVm    = viewModelFactory.GetViewModel <WorkspaceViewModel>();
                        roomController = initializedArgs.Value;
                        Assert.IsNotNull(initializedArgs.Value, "RoomController is Null");
                        toolControl = roomPage.AlantaControls.SingleOrDefault(c => c is ToolControl) as ToolControl;
                        Assert.IsNotNull(toolControl, "ToolControl is Null");
                        workspacePanel = roomPage.AlantaControls.SingleOrDefault(c => c is WorkspacePanel) as WorkspacePanel;
                        Assert.IsNotNull(workspacePanel, "WorkspacePanel is Null");
                        webcamerasControl = roomPage.AlantaControls.SingleOrDefault(c => c is WebCamerasControl) as WebCamerasControl;
                        Assert.IsNotNull(webcamerasControl, "WebCamerasPanel is Null");
                        loginControl = roomPage.AlantaControls.SingleOrDefault(c => c is RoomHeaderControl) as RoomHeaderControl;
                        Assert.IsNotNull(loginControl, "LoginControl is Null");
                        pageInitialized = true;
                        TestInitializing(() => isInitializingCompleted = true);
                    });

                    //rb 7/7/2010 fix
                    roomPage.MinWidth  = 800;
                    roomPage.MinHeight = 600;
                    var parentPanel    = roomPage.Parent as Panel;
                    if (parentPanel != null)
                    {
                        parentPanel.Children.Remove(roomPage);
                    }
                    var scrll = new ScrollViewer {
                        HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Content = roomPage
                    };
                    TestPanel.Children.Add(scrll);
                    roomPage.Initialize(new TestRoomInfo());
                }));
            });
            EnqueueConditional(() => pageInitialized && isInitializingCompleted);
            EnqueueTestComplete();
        }
        public MainViewModel()
        {
            LoadedWindowCommand = new RelayCommand((p) => {
                if (p == null)
                {
                    MessageBox.Show(p.GetType().Name);
                }
                Window mainWindow = p as Window;
                mainWindow.Hide(); // main view hide in login window
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();
                isLoaded = true;

                //if (loginWindow.DataContext == null) return;
                //var loginVM = loginWindow.DataContext as LoginViewModel;
                //if (loginVM.isLogin)
                //{
                mainWindow.Show();
                //    LoadRemainsData(); // show remain table
                //}
                //else
                //{

                //}

                _timer          = new DispatcherTimer(DispatcherPriority.Render);
                _timer.Interval = TimeSpan.FromSeconds(1);
                _timer.Tick    += (sender, args) =>
                {
                    if (LoginViewModel.currentUser != null)
                    {
                        InitButtonsForUsing(LoginViewModel.currentUser);

                        _timer.Stop();
                    }
                };
                _timer.Start();

                FrameContent = new HomePage();
            });

            IsVisibleCanvas = Visibility.Hidden;
            FrameColumn     = 1;

            // initial page
            Title        = "Trang chủ";
            FrameContent = new HomePage();

            // commands
            Home_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Trang chủ";
                FrameContent             = new HomePage();
                FrameContent.DataContext = new HomePage_ViewModel();
            });

            TimeTable_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Lịch dạng TKB";
                FrameContent             = new TimeTablePage();
                FrameContent.DataContext = new TimeTableViewModel();
            });

            Room_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Lịch dạng phòng";
                FrameContent             = new RoomPage();
                FrameContent.DataContext = new RoomViewModel();
            });

            TimeTableInput_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Nhập phòng học";
                FrameContent             = new TimeTableInputPage();
                FrameContent.DataContext = new TimeTableInputViewModel();
            });

            EventInput_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Nhập sự kiện";
                FrameContent             = new EventInputPage();
                FrameContent.DataContext = new EventInputViewModel();
            });

            ExamInput_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Nhập phòng thi";
                FrameContent             = new ExamInputPage();
                FrameContent.DataContext = new ExamInputViewModel();
            });

            RoomManagement_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Quản lý phòng";
                FrameContent             = new RoomManagementPage();
                FrameContent.DataContext = new RoomManagementViewModel();
            });

            Report_Page_SelectedCommand = new RelayCommand((p) => {
                Title                    = "Lập báo cáo";
                FrameContent             = new ReportPage();
                FrameContent.DataContext = new ReportViewModel();
            });

            Menu_Click_Command = new RelayCommand((p) => {
                IsVisibleCanvas = Visibility.Visible;
                FrameColumn     = 6;
            });

            Canvas_MouseLeave_Command = new RelayCommand((p) => {
                IsVisibleCanvas = Visibility.Hidden;
                FrameColumn     = 1;
            });
        }