
3 changed files with 114 additions and 0 deletions
-
63SiteServer.BackgroundPages/Cms/ModalChannelTaxis.cs
-
4SiteServer.BackgroundPages/Cms/PageChannel.cs
-
47SiteServer.Web/SiteServer/Cms/ModalChannelTaxis.aspx
@ -0,0 +1,63 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.Specialized; |
|||
using System.Web.UI.WebControls; |
|||
using SiteServer.Utils; |
|||
using SiteServer.CMS.Core; |
|||
using SiteServer.CMS.Core.Create; |
|||
using SiteServer.CMS.DataCache; |
|||
using SiteServer.CMS.Model; |
|||
using SiteServer.CMS.Model.Attributes; |
|||
using SiteServer.Utils.Enumerations; |
|||
|
|||
namespace SiteServer.BackgroundPages.Cms |
|||
{ |
|||
public class ModalChannelTaxis : BasePageCms |
|||
{ |
|||
protected DropDownList DdlTaxisType; |
|||
protected TextBox TbTaxisNum; |
|||
|
|||
private int _channelId; |
|||
private string _returnUrl; |
|||
private List<int> _contentIdList; |
|||
private string _tableName; |
|||
|
|||
public static string GetOpenWindowString(int siteId) |
|||
{ |
|||
return LayerUtils.GetOpenScriptWithCheckBoxValue("栏目排序", PageUtils.GetCmsUrl(siteId, nameof(ModalChannelTaxis), null), "ChannelIDCollection", "请选择需要排序的内容!", 400, 280); |
|||
} |
|||
|
|||
public void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (IsForbidden) return; |
|||
|
|||
PageUtils.CheckRequestParameter("siteId", "ChannelIDCollection"); |
|||
|
|||
_channelId = AuthRequest.GetQueryInt("ChannelIDCollection"); |
|||
_contentIdList = TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("ChannelIDCollection")); |
|||
_tableName = ChannelManager.GetTableName(SiteInfo, _channelId); |
|||
|
|||
if (IsPostBack) return; |
|||
|
|||
DdlTaxisType.Items.Add(new ListItem("上升", "Up")); |
|||
DdlTaxisType.Items.Add(new ListItem("下降", "Down")); |
|||
ControlUtils.SelectSingleItem(DdlTaxisType, "Up"); |
|||
} |
|||
|
|||
public override void Submit_OnClick(object sender, EventArgs e) |
|||
{ |
|||
var isUp = DdlTaxisType.SelectedValue == "Up"; |
|||
var taxisNum = TranslateUtils.ToInt(TbTaxisNum.Text); |
|||
|
|||
foreach (var contentId in _contentIdList) |
|||
{ |
|||
DataProvider.ChannelDao.UpdateTaxis(SiteId, _channelId, isUp); |
|||
|
|||
AuthRequest.AddSiteLog(SiteId, _channelId, 0, "栏目排序" + (isUp ? "上升" : "下降"), |
|||
$"栏目:{ChannelManager.GetChannelName(SiteId, _channelId)}"); |
|||
} |
|||
LayerUtils.CloseAndRedirect(Page, PageChannel.GetRedirectUrl(SiteId, _channelId)); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
<%@ Page Language="C#" Inherits="SiteServer.BackgroundPages.Cms.ModalChannelTaxis" Trace="false"%> |
|||
<%@ Register TagPrefix="ctrl" Namespace="SiteServer.BackgroundPages.Controls" Assembly="SiteServer.BackgroundPages" %> |
|||
<!DOCTYPE html> |
|||
<html class="modalPage"> |
|||
|
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<!--#include file="../inc/head.html"--> |
|||
</head> |
|||
|
|||
<body> |
|||
<form runat="server"> |
|||
<ctrl:alerts runat="server" /> |
|||
|
|||
<div class="form-group form-row"> |
|||
<label class="col-3 text-right col-form-label">排序方向</label> |
|||
<div class="col-8"> |
|||
<asp:DropDownList ID="DdlTaxisType" class="form-control" runat="server"></asp:DropDownList> |
|||
</div> |
|||
<div class="col-1"></div> |
|||
</div> |
|||
|
|||
<div class="form-group form-row"> |
|||
<label class="col-3 text-right col-form-label">移动数目</label> |
|||
<div class="col-8"> |
|||
<asp:TextBox class="form-control" Text="1" MaxLength="50" id="TbTaxisNum" runat="server" /> |
|||
</div> |
|||
<div class="col-1"> |
|||
<asp:RequiredFieldValidator ControlToValidate="TbTaxisNum" errorMessage=" *" foreColor="red" Display="Dynamic" runat="server" |
|||
/> |
|||
<asp:RegularExpressionValidator runat="server" ControlToValidate="TbTaxisNum" ValidationExpression="^([1-9]|[1-9][0-9]{1,})$" |
|||
errorMessage=" *" foreColor="red" Display="Dynamic" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<hr /> |
|||
|
|||
<div class="text-right mr-1"> |
|||
<asp:Button class="btn btn-primary m-l-5" text="确 定" runat="server" onClick="Submit_OnClick" /> |
|||
<button type="button" class="btn btn-default m-l-5" onclick="window.parent.layer.closeAll()">取 消</button> |
|||
</div> |
|||
|
|||
</form> |
|||
</body> |
|||
|
|||
</html> |
|||
<!--#include file="../inc/foot.html"--> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue