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

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