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); } } }
protected void EgvContent_RowCommand(object sender, CommandEventArgs e) { if (e.CommandName == "DeleteContent") { int generalId = DataConverter.CLng(e.CommandArgument.ToString()); CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); this.m_IsInput = this.CheckUserConentInputPurview(commonModelInfoById.NodeId); if (!this.m_IsInput) { DynamicPage.WriteUserErrMsg("<li>没有删除权限!</li>"); } if (ContentManage.UpdateStatusByUserName(e.CommandArgument.ToString(), -3)) { PermissionContent.Delete(generalId); ContentCharge.Delete(generalId); DynamicPage.WriteUserSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID")); } else { DynamicPage.WriteUserErrMsg("<li>删除失败!</li>"); } } }