예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <BookShop.Model.SysFun> DataTableToList(DataTable dt)
        {
            List <BookShop.Model.SysFun> modelList = new List <BookShop.Model.SysFun>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                BookShop.Model.SysFun model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BookShop.Model.SysFun();
                    if (dt.Rows[n]["NodeId"].ToString() != "")
                    {
                        model.NodeId = int.Parse(dt.Rows[n]["NodeId"].ToString());
                    }
                    model.DisplayName = dt.Rows[n]["DisplayName"].ToString();
                    model.NodeURL     = dt.Rows[n]["NodeURL"].ToString();
                    if (dt.Rows[n]["DisplayOrder"].ToString() != "")
                    {
                        model.DisplayOrder = int.Parse(dt.Rows[n]["DisplayOrder"].ToString());
                    }
                    if (dt.Rows[n]["ParentNodeId"].ToString() != "")
                    {
                        model.ParentNodeId = int.Parse(dt.Rows[n]["ParentNodeId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(BookShop.Model.SysFun model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(BookShop.Model.SysFun model)
 {
     dal.Add(model);
 }
예제 #4
0
파일: SysFun.cs 프로젝트: JayZeeWen/Book
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(BookShop.Model.SysFun model)
 {
     return(dal.Add(model));
 }