Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.NicheTypeInfo> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.NicheTypeInfo> modelList = new List <Maticsoft.Model.NicheTypeInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.NicheTypeInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.NicheTypeInfo();
                    if (dt.Rows[n]["NicheTypeID"].ToString() != "")
                    {
                        model.NicheTypeID = int.Parse(dt.Rows[n]["NicheTypeID"].ToString());
                    }
                    model.NicheTypeTitle = dt.Rows[n]["NicheTypeTitle"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.NicheTypeInfo model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.NicheTypeInfo model)
 {
     return(dal.Add(model));
 }