コード例 #1
0
        private void AddEmployee_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var updatePage = new UpdatePage(repository);

            this.Hide();
            updatePage.Show();
        }
コード例 #2
0
        public MenuPresenter(MainWindow mw)
        {
            _mainWindow = mw;

            _updPage = new UpdatePage();
            new UpdatePagePresenter(_updPage);

            _postPage = new PostPage();
            new PostPresenter(_postPage);

            _getInfoPage = new GetInfoPage();
            new GetInfoPresenter(_getInfoPage);

            _deletePage = new DeletePage();
            new DeletePresenter(_deletePage);

            _mainWindow.Menu_PostButton.Click    += Menu_PostButton_Click;
            _mainWindow.Menu_GetDataButton.Click += Menu_GetDataButton_Click;
            _mainWindow.Menu_UpdateButton.Click  += Menu_UpdateButton_Click;
            _mainWindow.Menu_DeleteButton.Click  += Menu_DeleteButton_Click;
            _mainWindow.Menu_DeleteButton.Click  += Menu_DeleteButton_Click1;

            var globalMenu = new System.Windows.Controls.ContextMenu();
            var exit       = new MenuItem {
                Header = "Exit"
            };

            exit.Click += Exit_Click;
            globalMenu.Items.Add(exit);
        }
コード例 #3
0
        /// <summary>
        /// 初始化字典,内含键值对,键为page名的字符串,名为对应的page对象
        /// </summary>
        private void InitDictionary()
        {
            this._dicPage = new Dictionary <string, Page>();

            string strPagName = "PAGE_HOME";
            Page   objPage    = new HomePage();

            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);

            strPagName          = "PAGE_CONNECT";
            objPage             = new ConnectPage();
            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);

            strPagName          = "PAGE_CONTROL";
            objPage             = new ControlPage();
            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);

            strPagName          = "PAGE_UPDATE";
            objPage             = new UpdatePage();
            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);

            strPagName          = "PAGE_CALIBRATION";
            objPage             = new CalibrationPage();
            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);

            strPagName          = "PAGE_SETUP";
            objPage             = new SetupPage();
            objPage.DataContext = this._viewViewModel;
            this._dicPage.Add(strPagName, objPage);
        }
コード例 #4
0
        public void OnTapped(Object o)
        {
            var nextPage = new UpdatePage();

            nextPage.BindingContext = o;
            Nav.PushAsync(nextPage);
        }
コード例 #5
0
ファイル: PageSerVice.cs プロジェクト: war-man/OnlineShop-1
        public async Task <int> UpdatePage(UpdatePage request)
        {
            var page = await _context.Pages.FindAsync(request.Id);

            page.Alias       = request.Alias;
            page.Decripstion = request.Decripstion;
            return(await _context.SaveChangesAsync());
        }
コード例 #6
0
        public async Task <IActionResult> UpdatePage(UpdatePage request)
        {
            var page = await _pageConnectAPI.UpdatePage(request);

            return(Json(new
            {
                status = true
            }));
        }
コード例 #7
0
        public async Task <bool> UpdatePage(UpdatePage request)
        {
            var json       = JsonConvert.SerializeObject(request);
            var jsonstring = new StringContent(json, Encoding.UTF8, "application/json");
            var creat      = _httpClientFactory.CreateClient();

            creat.BaseAddress = new Uri(_configuration["URLAPI:Url"]);
            var post = await creat.PostAsync("api/Page/UpdatePage", jsonstring);

            return(post.IsSuccessStatusCode);
        }
コード例 #8
0
        public MainWindow()
        {
            _mainPage               = new MainPage(this);
            _systemPage             = new SystemPage(this);
            _selfTestPage           = new SelfTestPage(this);
            _factoryResetPage       = new FactoryResetPage(this);
            _findMyGearPage         = new FindMyGearPage(this);
            _touchpadPage           = new TouchpadPage(this);
            _ambientSoundPage       = new AmbientSoundPage(this);
            _equalizerPage          = new EqualizerPage(this);
            _connectionLostPage     = new ConnectionLostPage(this);
            _deviceSelectPage       = new DeviceSelectPage(this);
            _settingPage            = new SettingPage(this);
            _updatePage             = new UpdatePage(this);
            _advancedPage           = new AdvancedPage(this);
            _unsupportedFeaturePage = new UnsupportedFeaturePage(this);

            InitializeComponent();

            SPPMessageHandler.Instance.AnyMessageReceived           += InstanceOnAnyMessageReceived;
            BluetoothService.Instance.MessageReceived               += SPPMessageHandler.Instance.MessageReceiver;
            BluetoothService.Instance.InvalidDataException          += InstanceOnInvalidDataException;
            BluetoothService.Instance.SocketException               += InstanceOnSocketException;
            BluetoothService.Instance.PlatformNotSupportedException += InstanceOnPlatformNotSupportedException;
            BluetoothService.Instance.CreateClient();

            Closing                            += OnClosing;
            OptionsClicked                     += OnOptionsClicked;
            _mainPage.MainMenuClicked          += MainPageOnMainMenuClicked;
            _connectionLostPage.RetryRequested += ConnectionLostPageOnRetryRequested;

            BluetoothAddress savedAddress = GetRegisteredDevice();

            if (savedAddress == null)
            {
                PageControl.TransitionType = PageTransitionType.Fade;
                PageControl.ShowPage(new WelcomePage(this));
            }
            else
            {
                PageControl.TransitionType = PageTransitionType.Fade;
                PageControl.ShowPage(_mainPage);
                _mainPage.SetLoaderVisible(true);
                Task.Delay(100).ContinueWith((_) =>
                {
                    BluetoothService.Instance.Connect(savedAddress);
                    CheckForUpdates(manual: false);
                });
                _address = savedAddress;
            }
        }
コード例 #9
0
        public UpdatePagePresenter(UpdatePage postpage)
        {
            _uof        = new UnitOfWork();
            _updatePage = postpage;


            _updatePage.updateActor_Submit_Button.Click += UpdateActor_Submit_Button_Click;
            _updatePage.updateFilm_Submit_Button.Click  += UpdateFilm_Submit_Button_Click;
            _updatePage.updateUser_Submit_Button.Click  += UpdateUser_Submit_Button_Click;

            _updatePage.UpdateTabControl.SelectionChanged += UpdateTabControl_SelectionChanged;

            #region EvenHandlerCorrection
            //handler correctors
            _updatePage.updateActor_Films_ListBox.SelectionChanged     += UpdateActor_Films_ListBox_SelectionChanged;
            _updatePage.updateFilm_MainActors_ListBox.SelectionChanged += UpdateFilm_MainActors_ListBox_SelectionChanged;
            _updatePage.updateUser_TakenFilms_ListBox.SelectionChanged += UpdateUser_TakenFilms_ListBox_SelectionChanged;
            _updatePage.updateFilm_ratingCBox.SelectionChanged         += UpdateFilm_ratingCBox_SelectionChanged;
            #endregion

            //context menu
            MenuItem chooseMI = new MenuItem {
                Header = "Choose", Icon = new Image {
                    Source = new BitmapImage(new Uri(@"D:\PROGRAMMING\Програмне забезпечення\SoftwarePractice_10\SoftwarePractice_10\AddtitionalContent\push-512.png", UriKind.Relative))
                }
            };
            chooseMI.Click += ChooseMenuItem_Click;

            MenuItem clearValues = new MenuItem {
                Header = "Exit"
            };
            clearValues.Click += ClearValuesMenuItem_Click;

            _updatePage.ContextMenu = new ContextMenu();
            _updatePage.ContextMenu.Items.Add(chooseMI);
            _updatePage.ContextMenu.Items.Add(clearValues);
        }
コード例 #10
0
        public ContentPage GetPage(ViewName viewName, object o = null)
        {
            ContentPage page;

            switch (viewName)
            {
            case ViewName.LoginPage:
                page = new LoginPage();
                break;

            case ViewName.MainPage:
                if (o == null)
                {
                    throw new ArgumentNullException(nameof(o), "User parameter is null");
                }
                page = new MainPage((User)o);
                break;

            case ViewName.RegisterPage:
                page = new RegisterPage();
                break;

            case ViewName.UpdatePage:
                page = new UpdatePage();
                break;

            case ViewName.PlayPage:
                page = new PlayPage();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(viewName), viewName, null);
            }

            return(page);
        }
コード例 #11
0
        public MainWindow()
        {
            if (Settings.Default.DarkMode2 == DarkMode.Unset)
            {
                Settings.Default.DarkMode2 = (DarkMode)Convert.ToInt32(Settings.Default.DarkMode);
                Settings.Default.Save();
            }

            DarkModeHelper.Update();

            _mainPage               = new MainPage(this);
            _systemPage             = new SystemPage(this);
            _selfTestPage           = new SelfTestPage(this);
            _factoryResetPage       = new FactoryResetPage(this);
            _findMyGearPage         = new FindMyGearPage(this);
            _touchpadPage           = new TouchpadPage(this);
            _customActionPage       = new CustomActionPage(this);
            _ambientSoundPage       = new AmbientSoundPage(this);
            _equalizerPage          = new EqualizerPage(this);
            _connectionLostPage     = new ConnectionLostPage(this);
            _deviceSelectPage       = new DeviceSelectPage(this);
            _settingPage            = new SettingPage(this);
            _updatePage             = new UpdatePage(this);
            _advancedPage           = new AdvancedPage(this);
            _unsupportedFeaturePage = new UnsupportedFeaturePage(this);
            _popupSettingPage       = new PopupSettingPage(this);

            InitializeComponent();

            _tbi = new TaskbarIcon();
            Stream iconStream = Application.GetResourceStream(new Uri("pack://*****:*****@"CRITICAL: Unknown Win32 Bluetooth service error");
                Console.WriteLine(e);
            }
        }
コード例 #12
0
        public async Task <IActionResult> UpdatePage([FromBody] UpdatePage request)
        {
            var page = await _pageSerVice.UpdatePage(request);

            return(Ok());
        }
コード例 #13
0
ファイル: StartMode.cs プロジェクト: By-Onex/riel_wpf
 public UpdateCommand(UpdatePage updatePage)
 {
     _updatePage = updatePage;
 }