Esempio n. 1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<DSJL.Model.TB_AdminInfo> DataTableToList(DataTable dt)
 {
     List<DSJL.Model.TB_AdminInfo> modelList = new List<DSJL.Model.TB_AdminInfo>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         DSJL.Model.TB_AdminInfo model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new DSJL.Model.TB_AdminInfo();
             if(dt.Rows[n]["ID"].ToString()!="")
             {
                 model.ID=int.Parse(dt.Rows[n]["ID"].ToString());
             }
             model.AdminName=dt.Rows[n]["AdminName"].ToString();
             model.AdminPwd=dt.Rows[n]["AdminPwd"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DSJL.Model.TB_AdminInfo> DataTableToList(DataTable dt)
        {
            List <DSJL.Model.TB_AdminInfo> modelList = new List <DSJL.Model.TB_AdminInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DSJL.Model.TB_AdminInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DSJL.Model.TB_AdminInfo();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    model.AdminName = dt.Rows[n]["AdminName"].ToString();
                    model.AdminPwd  = dt.Rows[n]["AdminPwd"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DSJL.Model.TB_AdminInfo model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(DSJL.Model.TB_AdminInfo model)
 {
     dal.Add(model);
 }