Example #1
0
        public ActionResult UploadPost([Bind(Include = "PostId, PostContent, Timestamp, ProfileId")] Post post, string page)
        {
            post.ProfileId = db.GetProfile(db.GetCurrentAccountId(User)).ProfileId;
            post.Timestamp = DateTime.Now;

            if (ModelState.IsValid && !string.IsNullOrWhiteSpace(post.PostContent))
            {
                db.Add(post);
                db.Save();
            }

            return(RedirectToAction("Member", new { id = post.ProfileId }));
        }
Example #2
0
        public static void SetupServices(IServiceProvider serviceProvider)
        {
            var setupService = serviceProvider.GetService <ISetupService>();

            if (!setupService.IsConnectionPossible() || !setupService.IsDatabaseSetup())
            {
                return;
            }
            _emailService            = new EmailApplicationService();
            _userSessionService      = new UserSessionApplicationService();
            _searchIndexService      = new SearchIndexApplicationService();
            _awardCalcService        = new AwardCalculatorApplicationService();
            _closeAgedTopicsService  = new CloseAgedTopicsApplicationService();
            _tibiaApplicationService = new TibiaApplicationService();
            _emailService.Start(serviceProvider);
            _userSessionService.Start(serviceProvider);
            _searchIndexService.Start(serviceProvider);
            _awardCalcService.Start(serviceProvider);
            _closeAgedTopicsService.Start(serviceProvider);
            _tibiaApplicationService.Start(serviceProvider);
            ApplicationServices.Add(_emailService);
            ApplicationServices.Add(_userSessionService);
            ApplicationServices.Add(_searchIndexService);
            ApplicationServices.Add(_awardCalcService);
            ApplicationServices.Add(_closeAgedTopicsService);
            ApplicationServices.Add(_tibiaApplicationService);
        }
        public ActionResult Create([Bind(Include = "SubscriptionID, Name, Email")] Subscription subscription)
        {
            if (ModelState.IsValid)
            {
                db.Add(subscription);
                db.Save();
                return(RedirectToAction("Index", "Home"));
            }

            return(View(subscription));
        }
Example #4
0
 private static void SetupServices()
 {
     _emailService.Start(Container);
     _userSessionService.Start(Container);
     _searchIndexService.Start(Container);
     _awardCalcService.Start(Container);
     ApplicationServices.Add(_emailService);
     ApplicationServices.Add(_userSessionService);
     ApplicationServices.Add(_searchIndexService);
     ApplicationServices.Add(_awardCalcService);
 }
Example #5
0
 private void DropApplicationServices(ProvisionedService provisionedService)
 {
     ApplicationServices.Add(provisionedService);
     foreach (ProvisionedService service in ApplicationServices)
     {
         if (!SelectedApplication.Services.Contains(service.Name))
         {
             SelectedApplication.Services.Add(service.Name);
             RaisePropertyChanged("ApplicationServices");
         }
     }
 }
Example #6
0
        private void AddAppService()
        {
            Messenger.Default.Register <NotificationMessageAction <Cloud> >(this,
                                                                            message =>
            {
                if (
                    message.Notification.Equals(
                        Messages.
                        SetAddApplicationServiceData))
                {
                    message.Execute(SelectedCloud);
                }
            });

            Messenger.Default.Send(new NotificationMessageAction <bool>(Messages.AddApplicationService, (confirmed) =>
                                                                        Messenger.Default
                                                                        .Send(
                                                                            new NotificationMessageAction
                                                                            <
                                                                                AddApplicationServiceViewModel
                                                                            >(
                                                                                Messages
                                                                                .
                                                                                GetAddApplicationServiceData,
                                                                                (
                                                                                    viewModel)
                                                                                =>
            {
                if
                (
                    !ApplicationServices
                    .
                    Contains
                        (viewModel
                        .
                        SelectedService,
                        new ProvisionedServiceEqualityComparer
                            ()))
                {
                    ApplicationServices
                    .
                    Add
                        (viewModel
                        .
                        SelectedService);
                }
            }))));
        }
Example #7
0
        public static void SetupServices(IServiceProvider serviceProvider)
        {
            var setupService = serviceProvider.GetService <ISetupService>();

            if (!setupService.IsConnectionPossible() || !setupService.IsDatabaseSetup())
            {
                return;
            }
            _emailService.Start(serviceProvider);
            _userSessionService.Start(serviceProvider);
            _searchIndexService.Start(serviceProvider);
            _awardCalcService.Start(serviceProvider);
            ApplicationServices.Add(_emailService);
            ApplicationServices.Add(_userSessionService);
            ApplicationServices.Add(_searchIndexService);
            ApplicationServices.Add(_awardCalcService);
        }
Example #8
0
        public ActionResult Create(Profile profile)
        {
            if (ModelState.IsValid)
            {
                ViewBag.AccountId = applicationServices.GetCurrentAccountId(User);
                Image profilePic = new Image {
                    FileName = "../../Content/images/helmet-avatar.png"
                };
                profile.ProfileImage = profilePic;
                Image mcPic = new Image {
                    FileName = "../../Content/images/motorcycle-image-avatar.png"
                };
                profile.MotorcycleImage = mcPic;
                applicationServices.Add(profile);
                applicationServices.Save();
                return(RedirectToAction("Index", "Wall")); // Redirect to Wall (profile page) following profile creation
            }

            return(View(profile));
        }