Exemple #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// <param name="strWhere">条件</param>
        /// <returns>AdPosition集合</returns>
        public List <ClassLibrary.Model.AdPosition> GetModelList(string strWhere)
        {
            DataTable dt = GetData(strWhere);
            List <ClassLibrary.Model.AdPosition> modelList = new List <ClassLibrary.Model.AdPosition>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ClassLibrary.Model.AdPosition model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ClassLibrary.Model.AdPosition();
                    if (dt.Rows[n]["ID"] != DBNull.Value)
                    {
                        model.ID = Convert.ToInt32(dt.Rows[n]["ID"]);
                    }
                    if (dt.Rows[n]["Name"] != DBNull.Value)
                    {
                        model.Name = Convert.ToString(dt.Rows[n]["Name"]);
                    }
                    if (dt.Rows[n]["Description"] != DBNull.Value)
                    {
                        model.Description = Convert.ToString(dt.Rows[n]["Description"]);
                    }
                    if (dt.Rows[n]["Size"] != DBNull.Value)
                    {
                        model.Size = Convert.ToString(dt.Rows[n]["Size"]);
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 /// <param name="model">model对象</param>
 public int Add(ClassLibrary.Model.AdPosition model)
 {
     return(dal.Add(model));
 }
Exemple #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model">model对象</param>
 /// <returns>影响行数</returns>
 public int Update(ClassLibrary.Model.AdPosition model)
 {
     return(dal.Update(model));
 }