Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <SmartTeaching.Entity.Base_User> DataTableToList(DataTable dt)
        {
            List <SmartTeaching.Entity.Base_User> modelList = new List <SmartTeaching.Entity.Base_User>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                SmartTeaching.Entity.Base_User model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SmartTeaching.Entity.Base_User();
                    if (dt.Rows[n]["UserId"].ToString() != "")
                    {
                        model.UserId = int.Parse(dt.Rows[n]["UserId"].ToString());
                    }
                    model.UserName = dt.Rows[n]["UserName"].ToString();
                    model.Userpwd  = dt.Rows[n]["Userpwd"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SmartTeaching.Entity.Base_User model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(SmartTeaching.Entity.Base_User model)
 {
     return(dal.Add(model));
 }