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

            if (rowsCount > 0)
            {
                LPWeb.Model.Template_RuleCollection model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Template_RuleCollection();
                    if (dt.Rows[n]["RuleCollectionlId"].ToString() != "")
                    {
                        model.RuleCollectionlId = int.Parse(dt.Rows[n]["RuleCollectionlId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();
                    if (dt.Rows[n]["Enabled"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Enabled"].ToString() == "1") || (dt.Rows[n]["Enabled"].ToString().ToLower() == "true"))
                        {
                            model.Enabled = true;
                        }
                        else
                        {
                            model.Enabled = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.Template_RuleCollection model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.Template_RuleCollection model)
 {
     return(dal.Add(model));
 }