private static string GetChangeHtml(int siteId, bool isHeadquarters) { var showPopWinString = ModalChangeSiteType.GetOpenWindowString(siteId); return(isHeadquarters == false ? $"<a href=\"javascript:;\" onClick=\"{showPopWinString}\">转移到根目录</a>" : $"<a href=\"javascript:;\" onClick=\"{showPopWinString}\">转移到子目录</a>"); }
private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) { return; } var siteId = (int)e.Item.DataItem; var siteInfo = SiteManager.GetSiteInfo(siteId); if (siteInfo == null) { return; } var ltlSiteName = (Literal)e.Item.FindControl("ltlSiteName"); var ltlSiteDir = (Literal)e.Item.FindControl("ltlSiteDir"); var ltlTableName = (Literal)e.Item.FindControl("ltlTableName"); var ltlTaxis = (Literal)e.Item.FindControl("ltlTaxis"); var ltlActions = (Literal)e.Item.FindControl("ltlActions"); ltlSiteName.Text = GetSiteNameHtml(siteInfo); ltlSiteDir.Text = siteInfo.SiteDir; ltlTableName.Text = siteInfo.TableName; ltlTaxis.Text = siteInfo.Taxis == 0 ? string.Empty : siteInfo.Taxis.ToString(); var builder = new StringBuilder(); builder.Append($@"<a href=""{PageSiteSave.GetRedirectUrl(siteId)}"" class=""m-r-5"">保存</a>"); builder.Append($@"<a href=""{PageSiteEdit.GetRedirectUrl(siteId)}"" class=""m-r-5"">修改</a>"); if (siteInfo.ParentId == 0 && (_hqSiteId == 0 || siteId == _hqSiteId)) { builder.Append($@"<a href=""javascript:;"" onClick=""{ModalChangeSiteType.GetOpenWindowString(siteId)}"" class=""m-r-5"">{(siteInfo.IsRoot ? "转移到子目录" : "转移到根目录")}</a>"); } if (siteInfo.IsRoot == false) { builder.Append($@"<a href=""{PageSiteDelete.GetRedirectUrl(siteId)}"" class=""m-r-5"">删除</a>"); } ltlActions.Text = builder.ToString(); }