sysfunservice.cs
来自「will let you know the result once they r」· CS 代码 · 共 56 行
CS
56 行
using System;
using System.Collections.Generic;
using System.Text;
using MyOffice.Models;
using MyOffice.DBUtility;
using System.Data;
using System.Data.SqlClient;
namespace MyOffice.DAL
{
public class SysFunService
{
public IList<SysFun> GetSysFunByParentNodeID(int parentID)
{
IList<SysFun> list = new List<SysFun>();
string sql = string.Format(@"select * from sysfun where parentnodeid={0}",parentID);
using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, sql, null))
{
while (reader.Read())
{
SysFun sysFun = new SysFun();
sysFun.NodeID = reader.GetInt32(0);
sysFun.DesplayName = reader.GetString(1);
sysFun.NodeURL =reader.GetString(2);
sysFun.DisplayOrder = reader.GetInt32(3);
sysFun.ParentNodeID = reader.GetInt32(4);
list.Add(sysFun);
}
}
return list;
}
public SysFun GetSysFunByNodeID(int nodeID)
{
string sql = string.Format(@"select * from sysfun where nodeid={0}",nodeID);
using (SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, sql, null))
{
if (reader.Read())
{
SysFun sysFun = new SysFun();
sysFun.NodeID = reader.GetInt32(0);
sysFun.DesplayName = reader.GetString(1);
sysFun.NodeURL = reader.GetString(2);
sysFun.DisplayOrder = reader.GetInt32(3);
sysFun.ParentNodeID = reader.GetInt32(4);
return sysFun;
}
else
{
return null;
}
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?