private int AddPermissionAndCharge(DataTable dataTable, bool enableCharge) { int generalId = GetGeneralId(dataTable); ContentPermissionInfo contentPermissionInfo = new ContentPermissionInfo(); contentPermissionInfo.GeneralId = generalId; contentPermissionInfo.PermissionType = DataConverter.CLng(this.RadlInfoPurview.SelectedValue); contentPermissionInfo.ArrGroupId = this.EChklUserGroupList.SelectList(); int num2 = DataConverter.CLng(this.TxtInfoPoint.Text); PermissionContent.Delete(generalId); if (PermissionContent.Add(contentPermissionInfo)) { EasyOne.Contents.ContentCharge.Delete(generalId); if (enableCharge && (num2 > 0)) { ContentChargeInfo contentChargeInfo = new ContentChargeInfo(); contentChargeInfo.GeneralId = generalId; contentChargeInfo.InfoPoint = num2; contentChargeInfo.ChargeType = this.ShowChargeType.ChargeType; contentChargeInfo.PitchTime = this.ShowChargeType.PitchTime; contentChargeInfo.ReadTimes = this.ShowChargeType.ReadTimes; contentChargeInfo.DividePercent = DataConverter.CLng(this.TxtDividePercent.Text); EasyOne.Contents.ContentCharge.Add(contentChargeInfo); } } return(num2); }
private void AddCharge(DataTable dataTable) { int generalId = DataConverter.CLng(dataTable.Select("FieldName = 'generalId'")[0]["FieldValue"].ToString()); NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(dataTable.Select("FieldName = 'nodeId'")[0]["FieldValue"].ToString())); ContentPermissionInfo contentPermissionInfo = new ContentPermissionInfo(); contentPermissionInfo.GeneralId = generalId; contentPermissionInfo.PermissionType = 0; PermissionContent.Delete(generalId); if (PermissionContent.Add(contentPermissionInfo)) { ContentCharge.Delete(generalId); if (cacheNodeById.Settings.DefaultItemPoint > 0) { ContentChargeInfo contentChargeInfo = new ContentChargeInfo(); contentChargeInfo.GeneralId = generalId; contentChargeInfo.InfoPoint = cacheNodeById.Settings.DefaultItemPoint; contentChargeInfo.ChargeType = cacheNodeById.Settings.DefaultItemChargeType; contentChargeInfo.PitchTime = cacheNodeById.Settings.DefaultItemPitchTime; contentChargeInfo.ReadTimes = cacheNodeById.Settings.DefaultItemReadTimes; contentChargeInfo.DividePercent = cacheNodeById.Settings.DefaultItemDividePercent; ContentCharge.Add(contentChargeInfo); } } }