예제 #1
0
        public DownloadDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/download/{TrainingMatchcode}"] = _ => { 
                OnDownloadRequest(_.TrainingMatchcode);
                return _portal.SharedResponse;
            };
        }
예제 #2
0
        public TrainingDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/training/{TrainingId}"] = _ =>
            {
                OnShowRequest(_.TrainingId);
                return _portal.SharedResponse;
            };
        }
예제 #3
0
        public RootDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/"] = _ => _portal.View["Root.Main.html"]; 

            _portal.Post["/"] = _ => {
                var trainingMatchcode = _portal.Request.Form.TrainingMatchcode;
                return new RedirectResponse(string.Format("/{0}/{1}", _portal.Request.Form.Submit, trainingMatchcode), RedirectResponse.RedirectType.SeeOther);
            };
        }
예제 #4
0
        public RegistrationDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/register/{TrainingMatchcode}"] = _ => {
                OnShowRequest(_.TrainingMatchcode);
                return _portal.SharedResponse;
            };

            _portal.Post["/register"] = _ => {
                var vm = _portal.Bind<RegistrationVM>();
                OnRegistrationRequest(vm.TrainingMatchcode, vm.Name, vm.Email);
                return _portal.SharedResponse;
            };
        }
        public TrainingsübersichtDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/trainings/{TrainerMatchcode}"] = _ =>
            {
                OnShowRequest(_.TrainerMatchcode);
                return _portal.SharedResponse;
            };

            _portal.Post["/trainings/{TrainerMatchcode}"] = _ => {
                OnTrainingCreationRequest(_.TrainerMatchcode, _portal.Request.Form.NewTrainingMatchcode);
                return _portal.SharedResponse;
            };
        }
예제 #6
0
        public FeedbackDialog(NancyPortal portal)
        {
            _portal = portal;

            _portal.Get["/feedback/{TrainingMatchcode}"] = _ => {
                OnShowRequest(_.TrainingMatchcode);
                return _portal.SharedResponse;
            };

            _portal.Post["/feedback"] = _ =>
            {
                var vm = _portal.Bind<FeedbackVM>();
                OnFeedbackRequest(vm.TrainingMatchcode, vm.Email, vm.Score, vm.Suggestions);
                return _portal.SharedResponse;
            };
        }