Exemplo n.º 1
0
        /// <summary>
        /// save user resource data
        /// </summary>
        /// <param name="entity"></param>
        public void SaveUserResourceList(List <UserResourceEntity> entityList)
        {
            int           userID = entityList[0].UserID;
            StringBuilder sbXml  = new StringBuilder();

            try
            {
                sbXml.Append("<data>");
                entityList.ForEach(info => {
                    sbXml.Append("<item>");
                    sbXml.Append("<UserID>" + info.UserID.ToString() + "</UserID>");
                    sbXml.Append("<ResourceID>" + info.ResourceID.ToString() + "</ResourceID>");
                    sbXml.Append("<PermissionType>" + info.PermissionType + "</PermissionType>");
                    sbXml.Append("<IsInherited>" + info.IsInherited + "</IsInherited>");
                    sbXml.Append("</item>");
                });
                sbXml.Append("</data>");
                var param = new DynamicParameters();
                param.Add("@userID", userID);
                param.Add("@permissionXML", sbXml.ToString());

                QuickRepository.ExecuteProc("dbo.pr_sys_UserResourceListSaveBatch", param);
            }
            catch (System.Exception ex)
            {
                //NLogWriter.Error("获取用户资源权限列表(用于用户管理,显示有效权限)失败!", ex);
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// delete role
        /// </summary>
        /// <param name="entity"></param>
        public void DeleteRole(RoleEntity entity)
        {
            var param = new DynamicParameters();
            param.Add("@roleID", entity.ID);

            using (var conn = SessionFactory.CreateConnection())
            {
                QuickRepository.ExecuteProc(conn, "pr_sys_RoleDelete", param);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// save user
        /// </summary>
        /// <param name="entity"></param>
        public void SaveUser(UserEntity entity)
        {
            var param = new DynamicParameters();
            param.Add("@userID", entity.ID);
            param.Add("@userName", entity.UserName);

            using (var conn = SessionFactory.CreateConnection())
            {
                QuickRepository.ExecuteProc(conn, "pr_sys_UserSave", param);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// clear user resource data
 /// </summary>
 /// <param name="entity"></param>
 public void ClearUserResourceList(int userID)
 {
     try
     {
         var param = new DynamicParameters();
         param.Add("@userID", userID);
         QuickRepository.ExecuteProc("dbo.pr_sys_UserResourceListClear", param);
     }
     catch (System.Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// delete resource
 /// </summary>
 /// <param name="xmlEntity"></param>
 public void DeleteResource(XmlTransferEntity xmlEntity)
 {
     try
     {
         var param = new DynamicParameters();
         param.Add("@strXml", xmlEntity.xmlBody);
         QuickRepository.ExecuteProc("pr_prd_DeleteResourceBeth", param);
     }
     catch (System.Exception ex)
     {
         //NLogWriter.Error("删除资源数据,并且删除相关联的表中数据失败!", ex);
         throw;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// delete resource
 /// </summary>
 /// <param name="resourceID">资源ID</param>
 public void DeleteResource(int resourceID)
 {
     try
     {
         var param = new DynamicParameters();
         param.Add("@resourceID", resourceID);
         QuickRepository.ExecuteProc("pr_sys_ResourceListDeleteByID", param);
     }
     catch (System.Exception ex)
     {
         //NLogWriter.Error("删除资源数据,并且删除相关联的表中数据失败!", ex);
         throw;
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// clear role resource
        /// </summary>
        /// <param name="entity"></param>
        public void ClearRoleResourceList(RoleResourceEntity entity)
        {
            int roleID = entity.RoleID;

            try
            {
                var param = new DynamicParameters();
                param.Add("@roleID", roleID);
                QuickRepository.ExecuteProc("dbo.pr_sys_RoleResourceListClear", param);
            }
            catch (System.Exception ex)
            {
                throw;
            }
        }