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

            if (rowsCount > 0)
            {
                Hownet.Model.PermissionsJobs model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.PermissionsJobs();
                    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());
                    }
                    if (dt.Rows[n]["PermissionsPropertyID"].ToString() != "")
                    {
                        model.PermissionsPropertyID = int.Parse(dt.Rows[n]["PermissionsPropertyID"].ToString());
                    }
                    if (dt.Rows[n]["JobsID"].ToString() != "")
                    {
                        model.JobsID = int.Parse(dt.Rows[n]["JobsID"].ToString());
                    }
                    model.A = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.PermissionsJobs model)
 {
     dal.Update(model);
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.PermissionsJobs model)
 {
     return(dal.Add(model));
 }