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

            if (rowsCount > 0)
            {
                LPWeb.Model.Template_Group_N_Rules model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Template_Group_N_Rules();
                    if (dt.Rows[n]["RuleGroupId"].ToString() != "")
                    {
                        model.RuleGroupId = int.Parse(dt.Rows[n]["RuleGroupId"].ToString());
                    }
                    if (dt.Rows[n]["RuleId"].ToString() != "")
                    {
                        model.RuleId = int.Parse(dt.Rows[n]["RuleId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.Template_Group_N_Rules model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(LPWeb.Model.Template_Group_N_Rules model)
 {
     dal.Add(model);
 }