Ejemplo n.º 1
0
        /// <summary>
        /// 给角色添加权限
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int AddRole(OA.Model.RFRelation info)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.AppendLine(" insert into OA_RFRelation( ");
            strSql.AppendLine(" ID,RoleID,FunID) ");
            strSql.AppendLine(" values ( ");
            strSql.AppendLine(" @ID,@RoleID,@FunID) ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",     SqlDbType.VarChar, 36),
                new SqlParameter("@RoleID", SqlDbType.VarChar, 36),
                new SqlParameter("@FunID",  SqlDbType.Int)
            };
            parameters[0].Value = info.ID;
            parameters[1].Value = info.RoleID;
            parameters[2].Value = info.FunID;

            int obj = DBAccess.ExecuteNonQuery(DB.Type, DB.ConnectionString, CommandType.Text, strSql.ToString(), parameters);

            if (obj == 0)
            {
                return(0);
            }
            else
            {
                return(obj);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 给角色添加权限
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public int AddRole(OA.Model.RFRelation info)
 {
     return(iRFRelationDAL.AddRole(info));
 }