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

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