📄 contentcharge.cs
字号:
namespace PowerEasy.WebSite.Controls
{
using PowerEasy.Common;
using PowerEasy.CommonModel;
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Model.CommonModel;
using PowerEasy.Model.Contents;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI.WebControls;
public class ContentCharge : BaseUserControl
{
protected DataTable contentDataTable;
protected ExtendedCheckBoxList EChklUserGroupList;
private int m_GeneralId;
protected RadioButtonList RadlInfoPurview;
protected ChargeTypeSetting ShowChargeType;
protected TextBox TxtDividePercent;
protected TextBox TxtInfoPoint;
private void InitCharge(int generalId, bool enableCharge)
{
if (enableCharge)
{
ContentPermissionInfo contentPermissionInfoById = PermissionContent.GetContentPermissionInfoById(generalId);
if (!contentPermissionInfoById.IsNull)
{
this.RadlInfoPurview.SelectedValue = contentPermissionInfoById.PermissionType.ToString();
if (!string.IsNullOrEmpty(contentPermissionInfoById.ArrGroupId))
{
string[] strArray = contentPermissionInfoById.ArrGroupId.Split(new char[] { ',' });
for (int i = 0; i < strArray.Length; i++)
{
this.EChklUserGroupList.Items.FindByValue(strArray[i]).Selected = true;
}
}
}
ContentChargeInfo contentChargeInfoById = PowerEasy.Contents.ContentCharge.GetContentChargeInfoById(generalId);
if (!contentChargeInfoById.IsNull)
{
this.TxtInfoPoint.Text = contentChargeInfoById.InfoPoint.ToString();
this.ShowChargeType.ChargeType = contentChargeInfoById.ChargeType;
this.ShowChargeType.PitchTime = contentChargeInfoById.PitchTime;
this.ShowChargeType.ReadTimes = contentChargeInfoById.ReadTimes;
this.TxtDividePercent.Text = contentChargeInfoById.DividePercent.ToString();
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
this.m_GeneralId = BaseUserControl.RequestInt32("GeneralID");
this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId);
if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0))
{
BaseUserControl.WriteErrMsg("指定的项目不存在!");
}
ModelInfo modelInfoById = ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString()));
IList<UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
this.EChklUserGroupList.DataSource = userGroupList;
this.EChklUserGroupList.DataBind();
this.InitCharge(this.m_GeneralId, modelInfoById.EnableCharge);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -