예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Information.Tb_Information_AboutUs> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Information.Tb_Information_AboutUs> modelList = new List <MobileSoft.Model.Information.Tb_Information_AboutUs>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Information.Tb_Information_AboutUs model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Information.Tb_Information_AboutUs();
                    //model.AboutId=dt.Rows[n]["AboutId"].ToString();
                    //model.BussId=dt.Rows[n]["BussId"].ToString();
                    model.Title          = dt.Rows[n]["Title"].ToString();
                    model.AboutPublisher = dt.Rows[n]["AboutPublisher"].ToString();
                    if (dt.Rows[n]["PubulishDate"].ToString() != "")
                    {
                        model.PubulishDate = DateTime.Parse(dt.Rows[n]["PubulishDate"].ToString());
                    }
                    model.AboutContent = dt.Rows[n]["AboutContent"].ToString();
                    model.AboutImage   = dt.Rows[n]["AboutImage"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Information.Tb_Information_AboutUs model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(MobileSoft.Model.Information.Tb_Information_AboutUs model)
 {
     return(dal.Add(model));
 }