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

            if (rowsCount > 0)
            {
                LPWeb.Model.MarketingCategory model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.MarketingCategory();
                    if (dt.Rows[n]["CategoryId"].ToString() != "")
                    {
                        model.CategoryId = int.Parse(dt.Rows[n]["CategoryId"].ToString());
                    }
                    model.CategoryName = dt.Rows[n]["CategoryName"].ToString();
                    model.GlobalId     = dt.Rows[n]["GlobalId"].ToString();
                    model.Description  = dt.Rows[n]["Description"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.MarketingCategory model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.MarketingCategory model)
 {
     return(dal.Add(model));
 }