Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <eChartProject.Model.eChart.Server_Contents_Folders> DataTableToList(DataTable dt)
        {
            List <eChartProject.Model.eChart.Server_Contents_Folders> modelList = new List <eChartProject.Model.eChart.Server_Contents_Folders>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                eChartProject.Model.eChart.Server_Contents_Folders model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new eChartProject.Model.eChart.Server_Contents_Folders();
                    if (dt.Rows[n]["FolderID"] != null && dt.Rows[n]["FolderID"].ToString() != "")
                    {
                        model.FolderID = int.Parse(dt.Rows[n]["FolderID"].ToString());
                    }
                    if (dt.Rows[n]["Foldername"] != null && dt.Rows[n]["Foldername"].ToString() != "")
                    {
                        model.Foldername = dt.Rows[n]["Foldername"].ToString();
                    }
                    if (dt.Rows[n]["ParentID"] != null && dt.Rows[n]["ParentID"].ToString() != "")
                    {
                        model.ParentID = int.Parse(dt.Rows[n]["ParentID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(eChartProject.Model.eChart.Server_Contents_Folders model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(eChartProject.Model.eChart.Server_Contents_Folders model)
 {
     return(dal.Add(model));
 }