public ActionResult OperateSite() { //NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); InvokeResult result = new InvokeResult(); var siteName = PageReq.GetForm("siteName"); var opType = PageReq.GetForm("opType"); var path = PageReq.GetForm("path"); var serverId = PageReq.GetFormInt("serverId"); var server = dataOp.FindOneByQuery("ServerInfo", Query.EQ("serverId", serverId.ToString())); MZ.BusinessLogicLayer.WebService.RemoteIISSites client = new BusinessLogicLayer.WebService.RemoteIISSites(server.String("serverAddress")); var isSuccess = client.OperateWebSite(siteName, opType); if (isSuccess) { result.Status = Status.Successful; } else { result.Status = Status.Failed; } return(Json(TypeConvert.InvokeResultToPageJson(result))); }
/// <summary> /// 服务器站点列表 /// </summary> /// <returns></returns> public ActionResult ServerIISSiteList() { var serverId = PageReq.GetParamInt("serverId"); var server = dataOp.FindOneByQuery("ServerInfo", Query.EQ("serverId", serverId.ToString())); log4net.LogManager.GetLogger("").Error("1111"); MZ.BusinessLogicLayer.WebService.RemoteIISSites client = new BusinessLogicLayer.WebService.RemoteIISSites(server.String("serverAddress")); var getStr = client.GetSites(); var sitesList = MongoDB.Bson.Serialization.BsonSerializer.Deserialize <List <BsonDocument> >(getStr); ViewData["sitesList"] = sitesList; ViewData["server"] = server; return(View()); }