?? indexservice.cs
字號:
using System;
using System.Collections.Generic;
using System.Text;
using MyCRM.DBUtility;
using MyCRM.IDAL;
using MyCRM.Models;
using System.Data;
using System.Data.SqlClient;
//該源碼下載自www.51aspx.com(51aspx.com)
namespace MyCRM.DAL
{
/// <summary>
/// 主頁數據層
/// </summary>
public class IndexService:IIndex
{
/// <summary>
/// 根據父節點Id得到所有文件信息
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
public List<Sys_right> GetTreeByParentId(string parentId)
{
string sql = "select * from Sys_right where Right_parent_code='" + parentId + "'";
return GetListBySql(sql);
}
/// <summary>
/// 根據SQL語句查詢
/// </summary>
/// <param name="safeSql"></param>
/// <returns></returns>
private List<Sys_right> GetListBySql(string safeSql)
{
List<Sys_right> list = new List<Sys_right>();
try
{
DataTable table = DBHelper.GetDataSet(safeSql);
foreach (DataRow row in table.Rows)
{
Sys_right right = new Sys_right();
right.Right_code = (string)row["Right_code"];
right.Right_parent_code = (string)row["Right_parent_code"];
right.Right_text =(string)row["Right_text"];
right.Right_tip = (string)row["Right_tip"];
right.Right_type = (string)row["Right_type"];
right.Right_url= (string)row["Right_url"];
list.Add(right);
}
return list;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
throw e;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -