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

            if (rowsCount > 0)
            {
                Maticsoft.Model.CMS_AdminRole model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.CMS_AdminRole();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    model.Name         = dt.Rows[n]["Name"].ToString();
                    model.AdminSetting = dt.Rows[n]["AdminSetting"].ToString();
                    model.Setting      = dt.Rows[n]["Setting"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.CMS_AdminRole model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.CMS_AdminRole model)
 {
     return(dal.Add(model));
 }