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

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