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

            if (rowsCount > 0)
            {
                MobileSoft.Model.Information.Tb_Information_BussPromotion model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Information.Tb_Information_BussPromotion();
                    //model.ProID=dt.Rows[n]["ProID"].ToString();
                    //model.BussId=dt.Rows[n]["BussId"].ToString();
                    model.Project   = dt.Rows[n]["Project"].ToString();
                    model.Publisher = dt.Rows[n]["Publisher"].ToString();
                    if (dt.Rows[n]["PublishDate"].ToString() != "")
                    {
                        model.PublishDate = DateTime.Parse(dt.Rows[n]["PublishDate"].ToString());
                    }
                    model.Reason   = dt.Rows[n]["Reason"].ToString();
                    model.ProImage = dt.Rows[n]["ProImage"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    //model.NumID=dt.Rows[n]["NumID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Information.Tb_Information_BussPromotion model)
 {
     dal.Update(model);
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(MobileSoft.Model.Information.Tb_Information_BussPromotion model)
 {
     return(dal.Add(model));
 }