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

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