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

            if (rowsCount > 0)
            {
                LPWeb.Model.MarketingCampaignEvents model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.MarketingCampaignEvents();
                    if (dt.Rows[n]["CampaignEventId"].ToString() != "")
                    {
                        model.CampaignEventId = int.Parse(dt.Rows[n]["CampaignEventId"].ToString());
                    }
                    if (dt.Rows[n]["WeekNo"].ToString() != "")
                    {
                        model.WeekNo = int.Parse(dt.Rows[n]["WeekNo"].ToString());
                    }
                    model.Action       = dt.Rows[n]["Action"].ToString();
                    model.EventContent = dt.Rows[n]["EventContent"].ToString();
                    model.EventURL     = dt.Rows[n]["EventURL"].ToString();
                    model.GlobalId     = dt.Rows[n]["GlobalId"].ToString();
                    if (dt.Rows[n]["CampaignId"].ToString() != "")
                    {
                        model.CampaignId = int.Parse(dt.Rows[n]["CampaignId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.MarketingCampaignEvents model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.MarketingCampaignEvents model)
 {
     return(dal.Add(model));
 }