예제 #1
0
 public ActionResult Index()
 {
     EndPointIndexVM vm = new EndPointIndexVM();
     vm.ServiceInstance = new ServiceInstanceVM();
     vm.AvailableInstances = endpointSrvc.GetAllAvailableEndPoints();
     return View(vm); ;
 }
예제 #2
0
        public ActionResult submit(EndPointIndexVM vm)
        {
            if (ModelState.IsValid)
            {
                EndPointService endpointSrvc = new EndPointService();
                ServiceInstanceVM sivm = endpointSrvc.GetAllAvailableEndPoints().Where(x => x.Url == vm.ServiceInstance.Url).First();
                endpointSrvc.SetEndPoint(sivm);

                if (!Request.IsAjaxRequest())
                {
                    return RedirectToAction("Index", "Home", null);
                }
                else
                {
                    return Content("success");
                }
            }
            return View("Index",vm);
        }