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

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