예제 #1
0
        // ダミーボタン処理
        public HomeView GetDummy(HomeView view)
        {
            HomeView result = this.InitView();

            result.InfoMessage = "ボタンクリック";
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="window"></param>
        public WindowViewModel(Window window)
        {
            mWindow = window;

            // Listen out for the window resizing
            mWindow.StateChanged += (sender, e) =>
            {
                //Fire off events for all properties that are affected by a resize
                OnPropertyChanged(nameof(ResizeBorderThickness));
                OnPropertyChanged(nameof(OuterMarginSize));
                OnPropertyChanged(nameof(OuterMarginSizeThickness));
            };

            //Create commands
            AcceuilCommand  = new RelayCommand(AcceuilExecute);
            Page1Command    = new RelayCommand(Page1Execute);
            Page2Command    = new RelayCommand(Page2Execute);
            Page3Command    = new RelayCommand(Page3Execute);
            Page4Command    = new RelayCommand(Page4Execute);
            Page5Command    = new RelayCommand(Page5Execute);
            MinimizeCommand = new RelayCommand(() => mWindow.WindowState = WindowState.Minimized);
            MaximizeCommand = new RelayCommand(() => mWindow.WindowState ^= WindowState.Maximized);
            CloseCommand    = new RelayCommand(() => mWindow.Close());
            MenuCommand     = new RelayCommand(() => SystemCommands.ShowSystemMenu(mWindow, GetMousePosition()));

            //Assign the content
            CurrentPage = new HomeView();
        }
예제 #3
0
        /// <summary>
        /// Metoda sluzaca do wyswietlania ogloszen, grup i ich sekcji, liczby zarejestrowanych uzytkownikow.
        /// </summary>
        /// <returns>Widok z ogloszeniami, grupami, sekcjami, liczba zarejestrowanych uzytkownikow.</returns>
        public ActionResult Index()
        {
            var announcements = unitOfWork.Repository <Announcement>().GetAll();

            foreach (var ann in announcements)
            {
                if (ann.ExpirationDate <= DateTime.Now)
                {
                    unitOfWork.Repository <Announcement>().Remove(ann);
                }
            }
            unitOfWork.Complete();

            var registeredUsers = "Number of registered users:  " + unitOfWork.Users.GetAll().Count();

            var viewModel = new HomeView()
            {
                Groups              = unitOfWork.Repository <Group>().GetAll(),
                Sections            = unitOfWork.Sections.OrderBy(x => x.Order),
                Announcements       = announcements,
                RegisteredUsersInfo = registeredUsers,
            };


            return(View(viewModel));
        }
예제 #4
0
        public App()
        {
            InitializeComponent();

            _viewInstance = new HomeView();
            MainPage      = _viewInstance;
        }
        public MainViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService,
                             IHomeViewModel homeViewModel,
                             IAddMenuViewModel addMenuViewModel, IGoogleLoginViewModel googleLoginViewModel,
                             RegisterViewModel registerViewModel,
                             BottomChartViewModel bottomChartViewModel,
                             IBlRouter blRouter)
        {
            IsLoad               = true;
            RegisterViewModel    = registerViewModel;
            AddMenuViewModel     = addMenuViewModel;
            GoogleLoginViewModel = googleLoginViewModel;

            _eventAggregator      = eventAggregator;
            _messageDialogService = messageDialogService;
            _blRouter             = blRouter;
            getDateTime           = DateTime.Now;

            GetIsLogOn = false;

            Subscribe();
            CheckIsLogOn();
            _homeViewModel       = homeViewModel;
            HomeView             = new HomeView();
            HomeView.DataContext = _homeViewModel;
            OpenHome();
        }
        public IActionResult Home(bool?error)
        {
            TempData.Clear();
            int?SessionUserId = HttpContext.Session.GetInt32("user_id");

            if (SessionUserId == null)
            {
                return(RedirectToAction("Login", "Login"));
            }

            User user = dbContext.users
                        .Include(u => u.Participating)
                        .ThenInclude(p => p.Event)
                        .FirstOrDefault(u => u.UserId == SessionUserId);

            List <Event> modelList = dbContext.events
                                     .Include(e => e.Participants)
                                     .ThenInclude(p => p.User).ToList();

            HomeView model = new HomeView()
            {
                events   = modelList,
                LoggedIn = user
            };

            if (error != null)
            {
                TempData["JoinErrorMessage"] = "You cannot join this even as it overlaps a current event your already attending!";
            }
            return(View(model));
        }
예제 #7
0
 private void InitializeViews()
 {
     BasesViewModel = new BasesViewModel(db);
     BasesView      = new BasesView {
         DataContext = BasesViewModel
     };
     PlatformViewModel = new PlatformViewModel(db);
     PlatformView      = new PlatformView {
         DataContext = PlatformViewModel
     };
     ActionsViewModel = new ActionsViewModel(db);
     ActionsView      = new ActionsView {
         DataContext = ActionsViewModel
     };
     DistributionViewModel = new DistributionViewModel(db);
     DistributionView      = new DistributionView {
         DataContext = DistributionViewModel
     };
     HomeViewModel = new HomeViewModel(db);
     HomeView      = new HomeView {
         DataContext = HomeViewModel
     };
     TelegramViewModel = new TelegramViewModel(db);
     TelegramView      = new TelegramView {
         DataContext = TelegramViewModel
     };
 }
        public static void openHome()
        {
            HomeView homeView = new HomeView(driver);

            driver.Url = "http://automatizacion.herokuapp.com/acastaneda/";
            driver.Manage().Window.Maximize();
        }
예제 #9
0
        public ActionResult Mensaje()
        {
            HomeView hv = new HomeView();

            hv.Mensaje = String.Empty;
            return(View("Mensaje", hv));
        }
예제 #10
0
        public ActionResult Navigate(NavigationView view)
        {
            var home = new HomeView();

            home.NavView.SelectedMenuItem = view.SelectedMenuItem;
            return(PartialView("_Navigation", home));
        }
        public ActionResult Footer()
        {
            HomeView accountView = new HomeView();

            accountView.NavView.SelectedMenuItem = "nav-home";
            return(PartialView("Footer", accountView));
        }
예제 #12
0
        private async void Login()
        {
            if (CheckUserName())
            {
                if (applicationService.IsConnected())
                {
                    Page       HomePage   = new HomeView();
                    UserManger usermanger = new UserManger();
                    int        userId     = await usermanger.AddUser(username);

                    Task.WaitAll();
                    applicationService.AddAppProperty <string>("UserName", username);
                    applicationService.AddAppProperty <int>("UserId", userId);
                    await pageService.PushAsync(HomePage, () => { MessagingCenter.Send <LoginViewModel>(this, "SyncApplication"); });
                }
                else
                {
                    await pageService.DisplayAlert("Network", "Please turn on internet connectivity", "Ok");
                }
            }
            else
            {
                await pageService.DisplayAlert("Invalid User Name", "User Name Must Not Contain Any Spaces Or Special Characters.", "Ok");
            }
        }
예제 #13
0
        public RefreshingTweets()
        {
            HomeView = Create.TestObjectFor<HomeView>();

            HomePresenter = PresenterFactory.NewHomePresenter(HomeView);
            HomePresenter.Timer = new TestTimer();
        }
예제 #14
0
        public ActionResult SelectDia(int?id)
        {
            var      menus    = new List <Menu>();
            var      lisCDias = new List <CDias>();
            var      HomeView = new HomeView();
            DateTime Fecha    = DateTime.Now.Date.Date;
            var      listDias = db.Dias.ToList();

            if (id != null)
            {
                var daymenu = db.DayMenu.Where(dm => dm.Cod_Dia == id).ToList();
                foreach (var item in daymenu)
                {
                    var Menus = db.Menus.Find(item.Cod_Menu);
                    menus.Add(Menus);
                }
            }
            foreach (var item in listDias)
            {
                var Cdias = new CDias
                {
                    Cantidad = db.DayMenu.Where(t => t.Cod_Dia == item.Cod_Dia).Count(),
                    IdDia    = item.Cod_Dia
                };
                lisCDias.Add(Cdias);
            }
            ViewBag.SeleDia    = id;
            HomeView.Menu      = new Menu();
            HomeView.Menus     = menus;
            HomeView.Dias      = listDias;
            HomeView.CantidadD = lisCDias;
            ViewBag.CMesas     = CantidadMesas.CMesas(db);
            return(View("Index", HomeView));
        }
        void ReleaseDesignerOutlets()
        {
            if (btnInfo != null)
            {
                btnInfo.Dispose();
                btnInfo = null;
            }

            if (GreetingsLabel != null)
            {
                GreetingsLabel.Dispose();
                GreetingsLabel = null;
            }

            if (HomeView != null)
            {
                HomeView.Dispose();
                HomeView = null;
            }

            if (rightPanelView != null)
            {
                rightPanelView.Dispose();
                rightPanelView = null;
            }

            if (tblViewRightPanel != null)
            {
                tblViewRightPanel.Dispose();
                tblViewRightPanel = null;
            }
        }
예제 #16
0
        public MainWindowVM()
        {
            myBl = new Bl();

            _eventAggregator = new Prism.Events.EventAggregator();
            _myMessageDialog = new MyMessageDialog();

            _eventAggregator.GetEvent <PL.Events.OpenLoginEvent>()
            .Subscribe(OpenLogin);
            _eventAggregator.GetEvent <PL.Events.OpenRegistrationEvent>()
            .Subscribe(OpenRegistration);
            _eventAggregator.GetEvent <PL.Events.OpenHomeEvent>()
            .Subscribe(OpenHome);

            OpenMyHomeCommand             = new DelegateCommand <Type>(RunOpenHome, CanOpen);
            OpenMyAddFoodCommand          = new DelegateCommand <Type>(RunOpenAddFood, CanOpen);
            OpenMyGoalsCommand            = new DelegateCommand <Type>(RunOpenGoals, CanOpen);
            OpenMyBodyMeasurementsCommand = new DelegateCommand <Type>(RunOpenBodyMeasurements, CanOpen);
            OpenMyProfilCommand           = new DelegateCommand <Type>(RunOpenProfil, CanOpen);
            OpenMyStatisticCommand        = new DelegateCommand <Type>(RunOpenStatistic, CanOpen);
            OpenMyLogoutCommand           = new DelegateCommand <Type>(RunMakeLogout, CanOpen);



            LoginView = new LoginView(_eventAggregator, _myMessageDialog);
            HomeView  = new HomeView();

            SelectedView = LoginView;
        }
예제 #17
0
 private void OnHomeShowed(HomeView view)
 {
     home = view;
     home.OnTicTacToeBtnAction = OnTTTClick;
     home.OnCarouselBtnAction  = OnCarouselClick;
     TriggerNotify(NotifyIds.PLAY_AUDIO, new AudioNotifyArg(true, "Assets/ExternalAsset/Audio/bgm/BGM_0.mp3"));
 }
예제 #18
0
        public void ShowSection(int id, Bundle bundle = null)
        {
            Fragment fragment = null;

            switch (id)
            {
            case Resource.Id.TabNavigation1:
                fragment = new HomeView();
                break;

            case Resource.Id.TabNavigation2:
                fragment = new MyTicketsView();
                break;

            case Resource.Id.TabNavigation3:
                fragment = new GettingHereView();
                break;

            case Resource.Id.TabNavigation4:
                fragment = new WhenHereView();
                break;

            case Resource.Id.TabNavigation5:
                fragment = new MoreView();
                break;

            default:
                return;
            }

            CurrentSection = id;
            ShowSection(fragment: fragment, bundle: bundle);
        }
예제 #19
0
        public IActionResult Index()
        {
            //Get Top
            var homeviewMD = new HomeView();

            homeviewMD.ProductImagePath = PathConfiguration.GetProductImgStoreFolder();
            homeviewMD.AvatarPath       = PathConfiguration.GetAvatarStoreFolder();

            homeviewMD.BestProducts  = _unitOfWork.SP.ReturnList <ProductSimpleView>(SP.SelectTop4Product);
            homeviewMD.CategoryList  = _unitOfWork.Category.GetAll();
            homeviewMD.NewProducts   = _unitOfWork.SP.ReturnList <ProductSimpleView>(SP.SelectTop4NewProduct);
            homeviewMD.BestSuppliers = _unitOfWork.SP.ReturnList <AppUserView>(SP.SelectTop10Seller);

            //Check pics if not existed , replaced by default pic
            foreach (ProductSimpleView p in homeviewMD.BestProducts)
            {
                SetDefaultValueForProductAvatar(p);
            }
            foreach (ProductSimpleView p in homeviewMD.NewProducts)
            {
                SetDefaultValueForProductAvatar(p);
            }

            foreach (AppUserView s in homeviewMD.BestSuppliers)
            {
                var      filePath = PathConfiguration.GetAvatarStoreFolder(_hostEnvironment) + "\\" + s.AvartarUrl;
                FileInfo file     = new FileInfo(filePath);
                if (!file.Exists)//check file exsit or not
                {
                    //p.FileName =
                    s.AvartarUrl = PathConfiguration.GetDefaultSupplierImg(_configuration);
                }
            }
            return(View(homeviewMD));
        }
예제 #20
0
        public ActionResult Index(string sortOrder, string searchString, string Owned, string Assigned, string Project, int?page)
        {
            var tickets    = db.Tickets.Include(t => t.AssignedUser).Include(t => t.OwnerUser).Include(t => t.Project).Include(t => t.TicketStatus).Include(t => t.TicketType);
            var sortParams = new Dictionary <string, string>();

            tickets = tickets.search(searchString);
            tickets = tickets.filterBigguns(Owned, Assigned, Project);
            tickets = tickets.SortColumns(sortOrder);

            if (page == null)
            {
                page = 1;
            }
            else
            {
                int pageNumber = (int)page;
            }

            var pageSize = 5;
            var model    = new HomeView()
            {
                Tickets   = tickets.ToPagedList((int)page, pageSize),
                SortOrder = sortOrder
            };

            model.Users    = db.Users.ToList();
            model.Projects = db.Projects.ToList();
            return(View(model));
        }
예제 #21
0
 public ShowConversation()
 {
     HomeView = Create.TestObjectFor<HomeView>();
     StatusPresenter = PresenterFactory.NewStatusPresenter(Create.TestObjectFor<UpdateStatusView>());
     ConvoPresenter = PresenterFactory.NewHomePresenter(HomeView);
     ConvoPresenter.Load();
 }
예제 #22
0
        public App()
        {
            InitializeComponent();

            Resources = StylesFactory.GenerateStyles(Resources);

            ContentPage startPage             = null;
            var         authenticationService = _container.Resolve <IAuthenticationService>();

            if (authenticationService.IsLoggedIn)
            {
                startPage = new HomeView();
            }
            else
            {
                startPage = new SignInView();
            }

            var navigationPage = new TransitionNavigationPage(startPage)
            {
                BarTextColor = Color.White,
            };

            MainPage = navigationPage;
        }
예제 #23
0
파일: HomeWebView.cs 프로젝트: lkuich/FRLF
        public void ValidateCode(NameValueCollection parameters, WebView webView)
        {
            var code = parameters["CodeEntry"].ToUpper();

            switch (code)
            {
            case "MGCL2":
                OpenPPTRemote(webView, 1);
                requestedView = HomeView.GRID1;
                break;

            case "BECL2":
                OpenPPTRemote(webView, 1);
                requestedView = HomeView.GRID2;
                break;

            case "MGF2":
                OpenPPTRemote(webView, 1);
                requestedView = HomeView.GRID3;
                break;

            default:
                RunJsMethod(webView, "invalidCodeEntry");
                return;
            }
        }
예제 #24
0
        public IActionResult Index()
        {
            using (SqlConnection conn = Connection)
            {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandText = @"
                                       SELECT d.Id, d.Name FROM Department d";
                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Department> departments = new List <Department>();
                    while (reader.Read())
                    {
                        Department department = new Department
                        {
                            Id   = reader.GetInt32(reader.GetOrdinal("Id")),
                            Name = reader.GetString(reader.GetOrdinal("Name"))
                        };

                        departments.Add(department);
                    }

                    var viewModel = new HomeView
                    {
                        Departments = departments
                    };

                    reader.Close();

                    return(View(viewModel));
                }
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateViewCommand" /> class.
 /// </summary>
 /// <param name="viewModel">The view model.</param>
 /// <param name="main">The main.</param>
 public UpdateViewCommand(MainViewModel viewModel, MainWindow main)
 {
     this.viewModel = viewModel;
     MF             = main;
     IV             = new InitializeView();
     HV             = new HomeView();
 }
        public ActionResult TopNavigation()
        {
            HomeView accountView = new HomeView();

            accountView.NavView.SelectedMenuItem = "nav-home";
            return(PartialView("TopNavigation", accountView));
        }
예제 #27
0
        public MainWindowViewModel()
        {
            PageContent  = new HomeView();
            fileSelector = new FileSelector();

            InitializeCommands();
        }
예제 #28
0
        public HomeView ListDetail(int?id)
        {
            if (db.TinViecLams.Find(id) == null)
            {
                return(null);
            }
            TinViecLam tinViecLam = db.TinViecLams.Find(id);
            var        congty     = db.CongTies.Find(tinViecLam.ID_CongTy);
            var        thanhPho   = db.ThanhPhoes.Find(congty.ID_ThanhPho);
            var        nganhNghe  = db.NganhNghes.Find(tinViecLam.ID_NganhNghe);
            var        trinhdo    = db.TrinhDoes.Find(tinViecLam.ID_TrinhDo);
            var        kinhnghiem = db.KinhNghiems.Find(tinViecLam.ID_KinhNghiem);
            var        vitri      = db.ViTriUngTuyens.Find(tinViecLam.ID_ViTri);

            CongTyDAO     congTyDAO      = new CongTyDAO();
            NganhNgheDAO  ngheDAO        = new NganhNgheDAO();
            ThanhPhoDAO   thanhPhoDAO    = new ThanhPhoDAO();
            TinViecLamDAO tinViecLamDAO  = new TinViecLamDAO();
            var           CongTyList     = congTyDAO.dsCongTy();
            var           tinviecLamList = tinViecLamDAO.dsTinViecLam();
            var           model          = new HomeView
            {
                CongTy        = congty,
                ThanhPho      = thanhPho,
                NganhNghe     = nganhNghe,
                TrinhDo       = trinhdo,
                KinhNghiem    = kinhnghiem,
                ViTriUngTuyen = vitri,
                TinViecLam    = tinViecLam,
                TinViecLams   = tinviecLamList,
                CongTies      = CongTyList,
            };

            return(model);
        }
예제 #29
0
        public IActionResult Index(Guid?id)
        {
            var homeView = new HomeView();

            homeView.Categorias    = _categoriaRepository.Read();
            homeView.ProdutosGroup = new List <ProdutoGroup>();
            var produtos     = _produtoRepository.ReadDisponivel(id);
            var produtoGroup = new ProdutoGroup();
            var contador     = 0;

            foreach (var produto in produtos)
            {
                contador++;
                produtoGroup.Produtos.Add(produto);

                if (produtoGroup.Produtos.Count == 6 || contador == produtos.Count)
                {
                    homeView.ProdutosGroup.Add(produtoGroup);
                    produtoGroup = new ProdutoGroup();
                }
            }

            if (id.HasValue)
            {
                var categoria = homeView.Categorias.FirstOrDefault(x => x.Id == id);
                ViewBag.Title = categoria.Descricao;
            }
            else
            {
                ViewBag.Title = "Home";
            }

            return(View(homeView));
        }
 public CreateBlogSteps(BlogListView blogListView, LoginView loginView, BlogCreateView blogCreateView, HomeView homeView)
 {
     _blogCreateView = blogCreateView;
     _blogListView   = blogListView;
     _loginView      = loginView;
     _homeView       = homeView;
 }
예제 #31
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form home = new HomeView();

            home.Show();
            this.Hide();
        }
예제 #32
0
        async void ShowLogin()
        {
            MessageDialog message = new MessageDialog();
            var           res     = await message.ShowAsync();

            if (res == ContentDialogResult.Secondary)
            {
                Application.Current.Exit();
            }
            else if (res == ContentDialogResult.Primary)
            {
                if (await message.IsLogin())
                {
                    this.InitializeComponent();
                    HomeView home = new HomeView();
                    FrameMain.Navigate(home.GetType());
                }
                else
                {
                    ContentDialog Error = new ContentDialog();
                    Error.Title = "Sai mật khẩu";
                    Error.SecondaryButtonText = "OK";
                    var contentResult = await Error.ShowAsync();

                    if (contentResult == ContentDialogResult.Secondary)
                    {
                        ShowLogin();
                    }
                }
            }
        }
예제 #33
0
        public SearchTweets()
        {
            HomeView = Create.TestObjectFor<HomeView>();
            HomeView.Tweets = new ObservableCollection<Tweet>();

            HomePresenter = PresenterFactory.NewHomePresenter(HomeView);
            HomePresenter.Load();
        }
예제 #34
0
 public static HomePresenter NewHomePresenter(HomeView View)
 {
     return new HomePresenter {
         View = View,
         TweetService = Domain.ObjectFactory.NewTweetService,
         Timer = ObjectFactory.NewTimer
     };
 }
예제 #35
0
 public HomeViewModel(HomeView view)
     : base(view.Dispatcher)
 {
     PostTuple.SetViewCommand(ViewCommand);
     favorites = new PostTupleCollection();
 }
예제 #36
0
        public ActionResult Index()
        {
            // Fetch the featured/new/best-selling products for display
            var newProducts = _productService.GetNewProducts()
                .Where(m => m.ImageId.HasValue())
                .Select(Mapper.Map<Product, ProductSummaryView>)
                .Take(MaxRecordsOnHomePage);

            var homeModel = new HomeView
            {
                NewProducts = newProducts.ToList(),
                NewWreckers = GetProviders(ProviderType.Wreckers),
                NewOthers = GetProviders(ProviderType.Others),
                NewRepairers = GetProviders(ProviderType.Repairers),
            };

            return View(homeModel);
        }
예제 #37
0
파일: ShowHome.cs 프로젝트: msuarz/zunzun
        public ShowHome()
        {
            HomeView = Create.TestObjectFor<HomeView>();

            HomePresenter = PresenterFactory.NewHomePresenter(HomeView);
        }
예제 #38
0
        public virtual ActionResult Index()
        {
            var layoutchart = CreateLayoutChart();
            var dgchart = CreateDgchart();

            var viewmodel = new HomeView() { LayoutChart = layoutchart,DgProjectChart = dgchart};
               // var str = viewmodel.Values;
            return View(viewmodel);
        }