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

            if (rowsCount > 0)
            {
                LearnSite.Model.English model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.English();
                    if (dt.Rows[n]["Eid"].ToString() != "")
                    {
                        model.Eid = int.Parse(dt.Rows[n]["Eid"].ToString());
                    }
                    model.Eword    = dt.Rows[n]["Eword"].ToString();
                    model.Emeaning = dt.Rows[n]["Emeaning"].ToString();
                    if (dt.Rows[n]["Elevel"].ToString() != "")
                    {
                        model.Elevel = int.Parse(dt.Rows[n]["Elevel"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LearnSite.Model.English model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LearnSite.Model.English model)
 {
     return(dal.Add(model));
 }