public ActionResult Index()
        {
            var model = new LoginSubmitViewModel();
            model.CommandActions.Add("Login", "Submit");
            model.CommandActions.Add("Cancel", "Index");

            return View(model);
        }
示例#2
0
        public ActionResult Index()
        {
            var model = new LoginSubmitViewModel();

            model.CommandActions.Add("Login", "Submit");
            model.CommandActions.Add("Cancel", "Index");

            return(View(model));
        }
        public ActionResult Submit(LoginSubmitViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var command = new LoginSubmit
                                  {
                                      Password = viewModel.Password,
                                      UserName = viewModel.UserName
                                  };
                var response = ProcessCommand<TypedMessageResponse<string>>(command);

                return Content(response.Data);
            }

            return Content("TODO: handle errors properly here.");
        }
示例#4
0
        public ActionResult Submit(LoginSubmitViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var command = new LoginSubmit
                {
                    Password = viewModel.Password,
                    UserName = viewModel.UserName
                };
                var response = ProcessCommand <TypedMessageResponse <string> >(command);

                return(Content(response.Data));
            }

            return(Content("TODO: handle errors properly here."));
        }