SQLServerDAL/sys_RolePermission.cs
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using WMPT.Model;
using WMPT.DBUtility;
namespace WMPT.SQLServerDAL
{
/// <summary>
/// 数据访问类sys_RolePermission。
/// </summary>
public class sys_RolePermission
{
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(sys_RolePermissionInfo model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into sys_RolePermission(");
strSql.Append("P_RoleID,P_ApplicationID,P_PageCode,P_Value)");
strSql.Append(" values (");
strSql.Append("@P_RoleID,@P_ApplicationID,@P_PageCode,@P_Value)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters =
{
new SqlParameter("@P_RoleID", SqlDbType.Int,4),
new SqlParameter("@P_ApplicationID", SqlDbType.Int,4),
new SqlParameter("@P_PageCode", SqlDbType.VarChar,20),
new SqlParameter("@P_Value", SqlDbType.Int,4)
};
parameters[0].Value = model.P_RoleID;
parameters[1].Value = model.P_ApplicationID;
parameters[2].Value = model.P_PageCode;
parameters[3].Value = model.P_Value;
return SQLHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), parameters);
}
/// <summary>
/// 更新一条数据
/// </summary>
public int Update(sys_RolePermissionInfo model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update sys_RolePermission set ");
strSql.Append("P_Value=@P_Value");
strSql.Append(" where P_RoleID=@P_RoleID and P_ApplicationID=@P_ApplicationID and P_PageCode=@P_PageCode and PermissionID=@PermissionID ");
SqlParameter[] parameters =
{
new SqlParameter("@PermissionID", SqlDbType.Int,4),
new SqlParameter("@P_RoleID", SqlDbType.Int,4),
new SqlParameter("@P_ApplicationID", SqlDbType.Int,4),
new SqlParameter("@P_PageCode", SqlDbType.VarChar,20),
new SqlParameter("@P_Value", SqlDbType.Int,4)
};
parameters[0].Value = model.PermissionID;
parameters[1].Value = model.P_RoleID;
后面还有 175 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
