示例#1
0
        /// <summary>
        /// 增加一个角色,带操作权限,roleMenu 是以逗号分隔的ui_menu_id
        /// </summary>
        public bool Add(YJUI.Model.ui_role model, string roleMenu)
        {
            Guid role_id = Guid.NewGuid();

            model.id = role_id;
            List <Model.ui_role_menu> T_role_menu = new List <ui_role_menu>();

            if (!string.IsNullOrEmpty(roleMenu.Trim(',')))
            {
                string[] strs = roleMenu.Trim(',').Split(',');

                for (int i = 0; i < strs.Length; i++)
                {
                    Model.ui_role_menu m_role_menu = new ui_role_menu();

                    m_role_menu.ui_role_id = role_id;
                    m_role_menu.ui_menu_id = int.Parse(strs[i]);
                    m_role_menu.crdate     = DateTime.Now;
                    T_role_menu.Add(m_role_menu);
                }
            }
            return(dal.Add(model, T_role_menu));
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(YJUI.Model.ui_role model)
 {
     return(dal.Update(model));
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(YJUI.Model.ui_role model)
 {
     return(dal.Add(model));
 }