Beispiel #1
0
        public HtmlDocument get_instrumentation(HomeInputModel inputModel)
        {
            _document.Title = "Instrumentation Samples";
            _document.Add("h1").Text("Hello!");
            _document.Add("a").Attr("href", "/_fubu#instrumentation").Text("Go to instrumentation");

            _document.Push("ul");

            _document.Add("li/a")
            .Text("Make a really long request")
            .Attr("href", _urls.UrlFor <InstrumentationEndpoint>(x => x.get_really_long_request()));

            _document.Add("li/a")
            .Text("Throw an exception")
            .Attr("href", _urls.UrlFor <ErrorEndpoint>(x => x.get_exception()));

            _document.Add("li/a")
            .Text("Make a request with a custom behavior")
            .Attr("href", _urls.UrlFor(new OtherInputModel {
                HelloText = "Nothing"
            }));

            _document.Add("li/a")
            .Text("Make a request that occasionally throws an error")
            .Attr("href", _urls.UrlFor(new OccasionalInput {
                HelloText = "Hello"
            }));


            return(_document);
        }
        public HtmlDocument get_instrumentation(HomeInputModel inputModel)
        {
            _document.Title = "Instrumentation Samples";
            _document.Add("h1").Text("Hello!");
            _document.Add("a").Attr("href", "/_fubu#instrumentation").Text("Go to instrumentation");

            _document.Push("ul");

            _document.Add("li/a")
                .Text("Make a really long request")
                .Attr("href", _urls.UrlFor<InstrumentationEndpoint>(x => x.get_really_long_request()));

            _document.Add("li/a")
                .Text("Throw an exception")
                .Attr("href", _urls.UrlFor<ErrorEndpoint>(x => x.get_exception()));

            _document.Add("li/a")
                .Text("Make a request with a custom behavior")
                .Attr("href", _urls.UrlFor(new OtherInputModel{HelloText = "Nothing"}));

            _document.Add("li/a")
                .Text("Make a request that occasionally throws an error")
                .Attr("href", _urls.UrlFor(new OccasionalInput{HelloText = "Hello"}));

            return _document;
        }
Beispiel #3
0
 public HomeViewModel Home(HomeInputModel model)
 {
     return new HomeViewModel
     {
         Text = "Hello, world."
     };
 }
Beispiel #4
0
 public HomeViewModel Get(HomeInputModel input)
 {
     //var tasks = _session.Query<CreateTodoInputModel>();
     return new HomeViewModel()
     {
         Message = "Person!"
     };
 }
Beispiel #5
0
 public HomeViewModel Get(HomeInputModel model)
 {
     return(new HomeViewModel
     {
         ID = model.ID,
         Name = "Andy",
         Age = 27
     });
 }
Beispiel #6
0
 public HomeViewModel Post(HomeInputModel model)
 {
     return(new HomeViewModel
     {
         ID = model.ID,
         Name = "Ali",
         Age = 32,
     });
 }
Beispiel #7
0
 public HomeViewModel Get(HomeInputModel input)
 {
     var languages = _service.GetAll()
         .Select(x => new LanguageHomeModel
             {
                 Name = x.Id,
                 Title = "{0} - {1}".ToFormat(x.NeutralName, x.NativeName),
                 TargetModel = new ByLangInputModel {Id = x.Id},
             });
     return new HomeViewModel { Languages = languages };
 }
 public ActionResult Edit(HomeInputModel model, int id)
 {
     if (ModelState.IsValid)
     {
         _models.Remove(_models.Get(id));
         model.Id = id;
         _models.Add(model);
         Success("The model was updated!");
         return(RedirectToAction("index"));
     }
     return(View("Create", model));
 }
Beispiel #9
0
 public ActionResult Create(HomeInputModel model)
 {
     if (ModelState.IsValid)
     {
         model.Id = _models.Count == 0 ? 1 : _models.Select(x => x.Id).Max() + 1;
         _models.Add(model);
         Success("保存成功!");
         return(RedirectToAction("Index"));
     }
     Error("表单中存在一些错误.");
     return(View(model));
 }
Beispiel #10
0
 public ActionResult Create(HomeInputModel model)
 {
     if (ModelState.IsValid)
     {
         model.Id = _models.Count == 0?1:_models.Select(x => x.Id).Max() + 1;
         _models.Add(model);
         Success("Your information was saved!");
         return(RedirectToAction("Index"));
     }
     Error("there were some errors in your form.");
     return(View(model));
 }
 public ActionResult Create(HomeInputModel model)
 {
     if (ModelState.IsValid)
     {
         model.Id = Items.Count == 0 ? 1 : Items.Select(x => x.Id).Max() + 1;
         Items.Add(model);
         Success("Your information was saved!");
         return RedirectToAction("Index");
     }
     LoadCountriesIntoViewData();
     Error("there were some errors in your form.");
     return View(model);
 }
Beispiel #12
0
        public async Task <IActionResult> Index(HomeInputModel model)
        {
            if (this.ModelState.IsValid)
            {
                var pin = model.PIN;

                var student = await this.studentService.GetStudentToDisplayAsync(pin);

                if (student == null)
                {
                    return(this.RedirectToAction("Index"));
                }

                student.School = await this.schoolService.GetSchoolAsync();

                var viewModel = student.To <DisplayStudentViewModel>();

                this.ViewBag.Index = 1;

                return(this.View("DisplayStudent", viewModel));
            }

            return(this.View(model));
        }
 public HomeViewModel Get(HomeInputModel input)
 {
     return(new HomeViewModel {
         Message = "Dave"
     });
 }
 public HomeViewModel Index(HomeInputModel inputModel)
 {
     return new HomeViewModel();
 }
Beispiel #15
0
 public HomeViewModel Execute(HomeInputModel inputModel)
 {
   return new HomeViewModel();
 }
 public ActionResult Edit(HomeInputModel model, int id)
 {
     if (ModelState.IsValid)
     {
         Items.Remove(Items.Get(id));
         model.Id = id;
         Items.Add(model);
         Success("The model was updated!");
         return RedirectToAction("index");
     }
     return View("Create", model);
 }
Beispiel #17
0
 public HomeViewModel Get(HomeInputModel input)
 {
     return new HomeViewModel();
 }
Beispiel #18
0
 public HomeViewModel get_home(HomeInputModel input)
 {
     return new HomeViewModel();
 }
Beispiel #19
0
 public IActionResult Index(HomeInputModel input)
 {
     return(this.RedirectToAction("Listing", "Place",
                                  new { searchWord = input.SearchWord, city = input.City }));
 }
 public HomeViewModel Execute(HomeInputModel inputModel)
 {
     return(new HomeViewModel());
 }
Beispiel #21
0
 public HomeViewModel Get(HomeInputModel input)
 {
     return(new HomeViewModel());
 }
 public HomeOutputModel Home(HomeInputModel inputModel)
 {
     return new HomeOutputModel();
 }