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

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