コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.Role_permission> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.Role_permission> modelList = new List <university.Model.CCOM.Role_permission>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.Role_permission model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Role_permission();
                    if (dt.Rows[n]["Rp_id"].ToString() != "")
                    {
                        model.Rp_id = int.Parse(dt.Rows[n]["Rp_id"].ToString());
                    }
                    if (dt.Rows[n]["Role_id"].ToString() != "")
                    {
                        model.Role_id = int.Parse(dt.Rows[n]["Role_id"].ToString());
                    }
                    if (dt.Rows[n]["Sf_id"].ToString() != "")
                    {
                        model.Sf_id = int.Parse(dt.Rows[n]["Sf_id"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.Role_permission model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(university.Model.CCOM.Role_permission model)
 {
     return(dal.Add(model));
 }