示例#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);
            };
        }
        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;
            };
        }