Exemple #1
0
        public ActionResult StatusList()
        {
            try
            {
                List <NippsParameter> nippsHosts         = NippsSiteHelper.ListNippsHost();
                NippsModuleRequest    nippsModuleRequest = new NippsModuleRequest();
                nippsModuleRequest.NippsModules = new List <NippsModule>();

                foreach (NippsParameter nippsHost in nippsHosts)
                {
                    foreach (string value in nippsHost.ParameterValue.Split('|'))
                    {
                        NippsSiteHelper.ListNippsSite(value)
                        .ForEach(delegate(NippsSite nippsSite)
                        {
                            nippsSite.NippsApplications
                            .ForEach(delegate(NippsApplication nippsApplication)
                            {
                                if (nippsApplication.Path.StartsWith("/Netas.Nipps.Service."))
                                {
                                    nippsModuleRequest.NippsModules.Add(
                                        new NippsModule {
                                        ModuleName = value + ">" + nippsSite.Name + ">" + nippsApplication.Path,
                                        ParentId   = 0
                                    });
                                }
                            });
                        });
                    }
                }

                NippsModuleResponse nippsModuleResponse;

                if (nippsModuleRequest.NippsModules.Count > 0)
                {
                    try
                    {
                        RestPostNippsModuleRequest("Add", nippsModuleRequest);
                    }
                    catch (Exception ex) { }
                }

                nippsModuleResponse = RestPostNippsModuleRequest("List", new NippsModuleRequest());
                ViewBag.ResultList  = nippsModuleResponse.NippsModules;
                SetViewBagResult(nippsModuleResponse, ViewBag);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                SetViewBagResult(new NippsModuleResponse {
                    Result = Result.FAIL, ResultMessages = new List <string> {
                        ex.ToString()
                    }
                }, ViewBag);
            }

            return(View());
        }
Exemple #2
0
 public JsonResult ListHost()
 {
     return(Json(NippsSiteHelper.ListNippsHost()));
 }