Beispiel #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());
                    }
                    if (dt.Rows[n]["isDeleted"] != null && dt.Rows[n]["isDeleted"].ToString() != "")
                    {
                        model.isDeleted = dt.Rows[n]["isDeleted"].ToString() == "TRUE" ? 1 : 0;
                    }
                    if (dt.Rows[n]["isOffline"] != null && dt.Rows[n]["isOffline"].ToString() != "")
                    {
                        model.isOffline = dt.Rows[n]["isOffline"].ToString() == "TRUE" ? 1 : 0;
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据(只跟新ISoffline)
 /// </summary>
 public bool UpdateByIsOffline(eChartProject.Model.eChart.server_contents_folders model)
 {
     return(dal.UpdateByIsoffline(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(eChartProject.Model.eChart.server_contents_folders model)
 {
     dal.Add(model);
 }