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

            if (rowsCount > 0)
            {
                StudentMS.Model.Tree model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model           = new StudentMS.Model.Tree();
                    model.TNO       = dt.Rows[n]["TNO"].ToString();
                    model.TName     = dt.Rows[n]["TName"].ToString();
                    model.TNOParent = dt.Rows[n]["TNOParent"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(StudentMS.Model.Tree model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(StudentMS.Model.Tree model)
 {
     dal.Add(model);
 }