/// <summary> /// 根据AID修改主体权限 /// </summary> /// <param name="MainAuthority">主体权限对象</param> /// <param name="dt">最后修改时间</param> public void PutMainAuthorityByAID(MainAuthority mainAuthority, DateTime dt) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"update 主体权限 set 主体ID = :主体ID, 主体名称=:主体名称, 类型= :类型, 角色ID=:角色ID, 权限类型=:权限类型, 最后修改人=:最后修改人, 最后修改时间=:最后修改时间 where 主体权限ID=:主体权限ID"; OracleParameter[] oracleParameters = { new OracleParameter(":主体ID", OracleDbType.Varchar2, mainAuthority.MID == null?"":mainAuthority.MID, ParameterDirection.Input), new OracleParameter(":主体名称", OracleDbType.Varchar2, mainAuthority.MainName == null?"":mainAuthority.MainName, ParameterDirection.Input), new OracleParameter(":类型", OracleDbType.Varchar2, mainAuthority.Type, ParameterDirection.Input), new OracleParameter(":角色ID", OracleDbType.Varchar2, mainAuthority.RoleID, ParameterDirection.Input), new OracleParameter(":权限类型", OracleDbType.Varchar2, mainAuthority.AuthorityType == null?"":mainAuthority.AuthorityType, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, mainAuthority.LastModify == null?"":mainAuthority.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":主体权限ID", OracleDbType.Varchar2, mainAuthority.AID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 新增资源目录 /// </summary> /// <param name="resource">资源目录对象</param> /// <param name="dt">最后修改时间</param> /// <param name="nid">新GUID</param> public void CreateResource(Resource resource, DateTime dt, string nid) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"insert into 资源目录( 资源ID, 上级资源ID, 资源名称, 类型, 备注, 最后修改人, 最后修改时间, 显示名称, 是否树形, 关系资源ID) values(:资源ID,:上级资源ID,:资源名称,:类型,:备注,:最后修改人,:最后修改时间,:显示名称,:是否树形,:关系资源ID)"; OracleParameter[] oracleParameters = { new OracleParameter(":资源ID", OracleDbType.Varchar2, nid, ParameterDirection.Input), new OracleParameter(":上级资源ID", OracleDbType.Varchar2, resource.PID == null?"":resource.PID, ParameterDirection.Input), new OracleParameter(":资源名称", OracleDbType.Varchar2, resource.Name, ParameterDirection.Input), new OracleParameter(":类型", OracleDbType.Varchar2, resource.Type, ParameterDirection.Input), new OracleParameter(":备注", OracleDbType.Varchar2, resource.Note == null?"":resource.Note, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, resource.LastModify == null?"":resource.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":显示名称", OracleDbType.Varchar2, resource.ShowName, ParameterDirection.Input), new OracleParameter(":是否树形", OracleDbType.Long, resource.TreeForm, ParameterDirection.Input), new OracleParameter(":关系资源ID", OracleDbType.Varchar2, resource.RelationID == null?"":resource.RelationID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 根据要素ID修改要素信息 /// </summary> /// <param name="element"></param> /// <param name="dt">最后修改时间</param> public void UpdateElementByEID(Element element, DateTime dt) { string sql = "p_要素目录修改_core"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter("v_要素id", OracleDbType.Varchar2, element.EID, ParameterDirection.Input), new OracleParameter("v_资源id", OracleDbType.Varchar2, element.RID, ParameterDirection.Input), new OracleParameter("v_要素名称", OracleDbType.Varchar2, element.Name, ParameterDirection.Input), new OracleParameter("v_要素类型", OracleDbType.Varchar2, element.Type, ParameterDirection.Input), new OracleParameter("v_单位", OracleDbType.Varchar2, element.Unit, ParameterDirection.Input), new OracleParameter("v_备注", OracleDbType.Varchar2, element.Note, ParameterDirection.Input), new OracleParameter("v_最后修改人", OracleDbType.Varchar2, element.LastModify, ParameterDirection.Input), new OracleParameter("v_最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter("v_长度", OracleDbType.Long, element.Length, ParameterDirection.Input), new OracleParameter("v_精度", OracleDbType.Long, element.Precision, ParameterDirection.Input), new OracleParameter("v_默认值", OracleDbType.Varchar2, element.Defaulta, ParameterDirection.Input), new OracleParameter("v_分类id", OracleDbType.Varchar2, element.CID, ParameterDirection.Input), new OracleParameter("v_是否必填", OracleDbType.Int32, element.IFRequired, ParameterDirection.Input), new OracleParameter("v_选项类型", OracleDbType.Varchar2, element.OptionType, ParameterDirection.Input), new OracleParameter("v_序号", OracleDbType.Varchar2, element.Numbera, ParameterDirection.Input), new OracleParameter("v_值域资源id", OracleDbType.Varchar2, element.DRID, ParameterDirection.Input), new OracleParameter("v_是否展示主目录", OracleDbType.Int32, element.IFZSZML, ParameterDirection.Input), new OracleParameter("v_名称是否展示", OracleDbType.Int32, element.IFZSMC, ParameterDirection.Input), new OracleParameter("v_编码目录id", OracleDbType.Varchar2, element.CDID, ParameterDirection.Input), new OracleParameter("v_要素分类", OracleDbType.Varchar2, element.ElementClassify, ParameterDirection.Input) }; oracleDataAccess.ExecuteProcdure(sql, oracleParameters); }
/// <summary> /// 角色权限管理页面其他权限管理新增主体权限 /// </summary> /// <param name="mainAuthority"></param> /// <param name="dt">最后修改时间</param> public string CreateMainAuthorityByOthers(MainAuthority mainAuthority, DateTime dt) { string sql = @"insert into 主体权限( 主体权限ID, 类型, 主体ID, 角色ID, 权限类型, 最后修改人, 最后修改时间, 主体名称) values(:主体权限ID,:类型,:主体ID,:角色ID,:权限类型,:最后修改人,:最后修改时间,:主体名称)"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":主体权限ID", OracleDbType.Varchar2, mainAuthority.AID, ParameterDirection.Input), new OracleParameter(":类型", OracleDbType.Varchar2, mainAuthority.Type, ParameterDirection.Input), new OracleParameter(":主体ID", OracleDbType.Varchar2, mainAuthority.MID, ParameterDirection.Input), new OracleParameter(":角色ID", OracleDbType.Varchar2, mainAuthority.RoleID, ParameterDirection.Input), new OracleParameter(":权限类型", OracleDbType.Varchar2, mainAuthority.AuthorityType, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, mainAuthority.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":主体名称", OracleDbType.Varchar2, mainAuthority.MainName, ParameterDirection.Input) }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); return("OK"); }
/// <summary> /// 根据角色ID获取主体权限 /// </summary> /// <param name="RID"></param> /// <returns></returns> public List <MainAuthority> GetAllMainAuthoritiesByRID(string RID) { string sql = @"select a.主体权限id AID , a.角色id RoleID , a.主体id MID , a.主体名称 MainName , a.类型 Type , a.权限类型 AuthorityType , a.关联资源ID RID , a.关联资源明细ID DID , a.最后修改人 LastModify , a.最后修改时间 LastDate from 主体权限 a where a.角色ID = :RID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":RID", OracleDbType.Varchar2, RID, ParameterDirection.Input) }; DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, oracleParameters); List <MainAuthority> mainAuthorities = ModelConvert.DataTableToIList <MainAuthority>(dataTable).ToList(); return(mainAuthorities); }
/// <summary> /// 根据ID修改统计指标 /// </summary> /// <param name="CountNorm">统计指标对象</param> /// <param name="dt">最后修改时间</param> public void PutCountNormByID(CountNorm countNorm, DateTime dt) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"update 统计指标定义 set 指标名称 = :指标名称, 计算类型 = :计算类型, 运算符 = :运算符, 运算值 = :运算值, 关联类型 = :关联类型, 关联ID = :关联ID, 备注 = :备注, 最后修改人 = :最后修改人, 最后修改时间 = :最后修改时间, 资源ID = :资源ID where 指标定义ID=:指标定义ID"; OracleParameter[] oracleParameters = { new OracleParameter(":指标名称", OracleDbType.Varchar2, countNorm.NormName == null?"":countNorm.NormName, ParameterDirection.Input), new OracleParameter(":计算类型", OracleDbType.Varchar2, countNorm.CalculateType == null?"":countNorm.CalculateType, ParameterDirection.Input), new OracleParameter(":运算符", OracleDbType.Varchar2, countNorm.Operator == null?"":countNorm.Operator, ParameterDirection.Input), new OracleParameter(":运算值", OracleDbType.Varchar2, countNorm.Ovalue == null?"":countNorm.Ovalue, ParameterDirection.Input), new OracleParameter(":关联类型", OracleDbType.Varchar2, countNorm.AssociationType == null?"":countNorm.AssociationType, ParameterDirection.Input), new OracleParameter(":关联ID", OracleDbType.Varchar2, countNorm.GLID == null?"":countNorm.GLID, ParameterDirection.Input), new OracleParameter(":备注", OracleDbType.Varchar2, countNorm.Note == null?"":countNorm.Note, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, countNorm.LastModify == null?"":countNorm.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":资源ID", OracleDbType.Varchar2, countNorm.RID == null?"":countNorm.RID, ParameterDirection.Input), new OracleParameter(":指标定义ID", OracleDbType.Varchar2, countNorm.ID == null?"":countNorm.ID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 根据ID修改资源目录 /// </summary> /// <param name="resource">资源目录对象</param> /// <param name="dt">最后修改时间</param> public void PutResourceByID(Resource resource, DateTime dt) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"update 资源目录 set 上级资源ID=:上级资源ID, 资源名称=:资源名称, 类型=:类型, 备注=:备注, 最后修改人=:最后修改人, 最后修改时间=:最后修改时间, 显示名称=:显示名称, 是否树形=:是否树形, 关系资源ID=:关系资源ID where 资源ID=:资源ID"; OracleParameter[] oracleParameters = { new OracleParameter(":上级资源ID", OracleDbType.Varchar2, resource.PID == null?"":resource.PID, ParameterDirection.Input), new OracleParameter(":资源名称", OracleDbType.Varchar2, resource.Name, ParameterDirection.Input), new OracleParameter(":类型", OracleDbType.Varchar2, resource.Type, ParameterDirection.Input), new OracleParameter(":备注", OracleDbType.Varchar2, resource.Note == null?"":resource.Note, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, resource.LastModify == null?"":resource.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":显示名称", OracleDbType.Varchar2, resource.ShowName, ParameterDirection.Input), new OracleParameter(":是否树形", OracleDbType.Long, resource.TreeForm, ParameterDirection.Input), new OracleParameter(":关系资源ID", OracleDbType.Varchar2, resource.RelationID == null?"":resource.RelationID, ParameterDirection.Input), new OracleParameter(":资源ID", OracleDbType.Varchar2, resource.ID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 新增主体权限 /// </summary> /// <param name="mainAuthority">主体权限对象</param> /// <param name="dt">最后修改时间</param> /// <param name="nid">新GUID</param> public void CreateMainAuthority(MainAuthority mainAuthority, DateTime dt, string nid) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"insert into 主体权限( 主体权限ID, 主体ID, 主体名称, 类型, 角色ID, 权限类型, 最后修改人, 最后修改时间, 关联资源ID, 关联资源明细ID) values(:主体权限ID,:主体ID,:主体名称,:类型,:角色ID,:权限类型,:最后修改人,:最后修改时间,:关联资源ID,:关联资源明细ID)"; OracleParameter[] oracleParameters = { new OracleParameter(":主体权限ID", OracleDbType.Varchar2, nid, ParameterDirection.Input), new OracleParameter(":主体ID", OracleDbType.Varchar2, mainAuthority.MID == null?"":mainAuthority.MID, ParameterDirection.Input), new OracleParameter(":主体名称", OracleDbType.Varchar2, mainAuthority.MainName == null?"":mainAuthority.MainName, ParameterDirection.Input), new OracleParameter(":类型", OracleDbType.Varchar2, mainAuthority.Type == null?"":mainAuthority.Type, ParameterDirection.Input), new OracleParameter(":角色ID", OracleDbType.Varchar2, mainAuthority.RoleID == null?"":mainAuthority.RoleID, ParameterDirection.Input), new OracleParameter(":权限类型", OracleDbType.Varchar2, mainAuthority.AuthorityType == null?"":mainAuthority.AuthorityType, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, mainAuthority.LastModify == null?"":mainAuthority.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":关联资源ID", OracleDbType.Varchar2, mainAuthority.RID == null?"":mainAuthority.RID, ParameterDirection.Input), new OracleParameter(":关联资源明细ID", OracleDbType.Varchar2, mainAuthority.DID == null?"":mainAuthority.DID, ParameterDirection.Input) }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 获取 要素目录/资源目录/资源分类/统计指标定义/计算要素条件 联合查询 /// </summary> /// <param name="RID"></param> /// <returns></returns> public List <Element> GetAllElementByResourceID(string RID) { string sql = @"select a.要素id EID, a.资源id RID, a.要素名称 Name, a.要素类型 Type, a.单位 Unit, a.备注 Note, a.最后修改人 LastModify, a.最后修改时间 LastDate, a.默认值 Defaulta, a.选项类型 OptionType, a.序号 Numbera, a.长度 Length, a.精度 Precision, a.是否必填 IFRequired, a.是否展示主目录 IFZSZML, a.名称是否展示 IFZSMC, a.要素分类 ElementClassify, b.资源名称 ResourceName, c.分类名称 ClassifyName, count(d.指标定义id) DYZBGS, e.表达式文本 Text FROM 要素目录 a,资源目录 b,资源分类 c,统计指标定义 d,计算要素条件 e where a.资源id= '{0}' and a.资源id=b.资源id(+) and a.分类id=c.资源分类id(+) and a.要素id=d.关联id(+) and a.要素id=e.要素id(+) group by a.要素id, a.资源id, a.要素名称, a.要素类型, a.单位, a.备注, a.最后修改人, a.最后修改时间, a.默认值, a.选项类型, a.序号, a.长度, a.精度, a.是否必填, a.是否展示主目录, a.名称是否展示, a.要素分类, b.资源名称, c.分类名称, e.表达式文本 order by a.序号"; sql = string.Format(sql, RID); //数据库连接 OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <Element> elements = ModelConvert.DataTableToIList <Element>(dataTable).ToList(); return(elements); }
/// <summary> /// 获取v_要素资源值域 /// </summary> /// <returns></returns> public List <DR> GetAllDR() { string sql = @"select 资源名称 Name,资源ID RID,类型 Type from V_要素资源值域 "; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <DR> dr = ModelConvert.DataTableToIList <DR>(dataTable).ToList(); return(dr); }
/// <summary> /// 删除角色权限同步人员权限 /// </summary> /// <param name="MAID">主体权限ID</param> public void DeletePerPersonnelAuthority(string MAID) { string sql = "delete from 人员权限 where 主体权限ID = :MAID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":MAID", OracleDbType.Varchar2, MAID, ParameterDirection.Input) }; oracleDataAccess.ExecuteNonQuery(sql, oracleParameters); }
/// <summary> /// 根据主体权限ID同步人员权限 /// </summary> /// <param name="MAID">主体权限ID</param> public void CreatePersonnelAuthority(string MAID) { string sql = "p_人员权限同步_core"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter("主体权限id_In", OracleDbType.Varchar2, MAID, ParameterDirection.Input) }; oracleDataAccess.ExecuteProcdure(sql, oracleParameters); }
/// <summary> /// 根据ID删除文本值域选项 /// </summary> /// <param name="ID">选项值域ID</param> public void DeleteElementRangeByID(string ID) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"delete from 文本选项值域 where 选项值域ID=:选项值域ID"; OracleParameter[] oracleParameters = { new OracleParameter(":选项值域ID", OracleDbType.Varchar2, ID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 根据ID删除统计指标 /// </summary> /// <param name="countNormID">指标定义ID</param> public void DeleteCountNormByID(string countNormID) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"delete from 统计指标定义 where 指标定义ID=:指标定义ID"; OracleParameter[] oracleParameters = { new OracleParameter(":指标定义ID", OracleDbType.Varchar2, countNormID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 根据ID删除资源目录 /// </summary> /// <param name="ID">资源ID</param> public void DeleteResourceByID(string ResourceID) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"delete from 资源目录 where 资源ID=:资源ID"; OracleParameter[] oracleParameters = { new OracleParameter(":资源ID", OracleDbType.Varchar2, ResourceID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 获取角色信息 /// </summary> /// <returns></returns> public List <MainAuthority> GetAllRoleInfo() { string sql = @"Select distinct a.角色ID RoleID,a.角色名称 RoleName From 角色信息 a ,角色用户信息 b Where a.角色ID = b.角色ID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <MainAuthority> mainAuthority = ModelConvert.DataTableToIList <MainAuthority>(dataTable).ToList(); return(mainAuthority); }
/// <summary> /// 根据要素ID删除要素信息 /// </summary> /// <param name="EID">要素ID</param> public void DeleteElementByEID(string EID) { string sql = @"delete 要素目录 where 要素ID = :EID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":EID", OracleDbType.Varchar2, EID, ParameterDirection.Input) }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 根据AID删除主体权限 /// </summary> /// <param name="AID">主体权限ID</param> public void DeleteMainAuthorityByAID(string AID) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"delete from 主体权限 where 主体权限ID=:AID"; OracleParameter[] oracleParameters = { new OracleParameter(":AID", OracleDbType.Varchar2, AID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }
/// <summary> /// 删除角色用户同步人员权限 /// </summary> /// <param name="UserID">用户ID</param> /// <param name="RoleID">角色ID</param> public void DeletePA(string UserID, string RoleID) { string sql = "delete from 人员权限 where 用户ID = :UserID and 角色ID = :RoleID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":UserID", OracleDbType.Varchar2, UserID, ParameterDirection.Input), new OracleParameter(":RoleID", OracleDbType.Varchar2, RoleID, ParameterDirection.Input) }; oracleDataAccess.ExecuteNonQuery(sql, oracleParameters); }
/// <summary> /// 获取设计页面信息 /// </summary> /// <returns></returns> public List <Designpage> GetAllDesignpage() { string sql = @"select 编码 Code, 名称 Name, 描述 Description, 最后修改人 LastModify, 最后修改时间 LastDate from 设计页面"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <Designpage> designpages = ModelConvert.DataTableToIList <Designpage>(dataTable).ToList(); return(designpages); }
/// <summary> /// 根据角色ID获取主体权限ID /// </summary> /// <param name="RoleID">角色ID</param> /// <returns></returns> public List <MainAuthority> GetAllAIDByRoleID(string RoleID) { string sql = @"select 主体权限ID AID from 主体权限 where 角色ID = :RoleID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":RoleID", OracleDbType.Varchar2, RoleID, ParameterDirection.Input), }; DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, oracleParameters); List <MainAuthority> mainAuthority = ModelConvert.DataTableToIList <MainAuthority>(dataTable).ToList(); return(mainAuthority); }
/// <summary> /// 获取全部角色信息 /// </summary> /// <returns></returns> public List <RoleInformation> GetAllRoleInformation() { string sql = @"select 角色ID ID, 角色名称 Name, 备注 Note, 最后修改人 LastModify, 最后修改时间 LastDate from 角色信息"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <RoleInformation> roleInformation = ModelConvert.DataTableToIList <RoleInformation>(dataTable).ToList(); return(roleInformation); }
/// <summary> /// 根据资源ID获取资源类型 /// </summary> /// <param name="RID"></param> /// <returns></returns> public List <Resource> GetTypeByRID(string RID) { string sql = @"select 类型 Type from 资源目录 where 资源ID = :RID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":RID", OracleDbType.Varchar2, RID, ParameterDirection.Input) }; DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, oracleParameters); List <Resource> resourcesType = ModelConvert.DataTableToIList <Resource>(dataTable).ToList(); return(resourcesType); }
/// <summary> /// 获取通用编码目录 /// </summary> /// <returns></returns> public List <GCodedir> GetAllGCodedir() { string sql = @"select 目录ID ID, 目录名称 Name, 备注 Note, 最后修改人 LastModify, 最后修改时间 LastDate, 是否树形 TreeForm from 通用编码目录"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <GCodedir> gCodedir = ModelConvert.DataTableToIList <GCodedir>(dataTable).ToList(); return(gCodedir); }
/// <summary> /// 角色权限管理页面新增主体权限 /// </summary> /// <param name="mainAuthority">主体权限实体类</param> /// <param name="dt">最后修改时间</param> /// <param name="uid">主体权限ID</param> public string CreateMainAuthorities(MainAuthority mainAuthority, DateTime dt) { string sql = "p_主体权限_core"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter("主体权限id_In", OracleDbType.Varchar2, mainAuthority.AID, ParameterDirection.Input), new OracleParameter("角色id_In", OracleDbType.Varchar2, mainAuthority.RoleID, ParameterDirection.Input), new OracleParameter("主体id_In", OracleDbType.Varchar2, mainAuthority.MID, ParameterDirection.Input), new OracleParameter("主体名称_In", OracleDbType.Varchar2, mainAuthority.MainName, ParameterDirection.Input), new OracleParameter("权限类型_In", OracleDbType.Varchar2, mainAuthority.AuthorityType, ParameterDirection.Input), new OracleParameter("最后修改人_In", OracleDbType.Varchar2, mainAuthority.LastModify, ParameterDirection.Input), new OracleParameter("最后修改时间_In", OracleDbType.Date, dt, ParameterDirection.Input) }; oracleDataAccess.ExecuteProcdure(sql, oracleParameters); return("OK"); }
/// <summary> /// 获取资源目录 /// </summary> /// <returns></returns> public List <Resource> GetAll() { string sql = @"select 资源ID ID, 上级资源ID PID, 资源名称 Name, 类型 Type, 备注 Note, 最后修改人 LastModify, 最后修改时间 LastDate, 显示名称 ShowName, 是否树形 TreeForm, 关系资源ID RelationID from 资源目录 order by 资源名称"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, null); List <Resource> resources = ModelConvert.DataTableToIList <Resource>(dataTable).ToList(); return(resources); }
/// <summary> /// 根据选项值域ID获取文本值域选项 /// </summary> /// <param name="ID">选项值域ID</param> /// <returns></returns> public List <ElementRange> GetAllElementRangeByID(string ID) { string sql = @"select 选项值域ID ID, 选项名称 Name, 备注 Note, 最后修改人 LastModify, 最后修改时间 LastDate, 要素ID EID from 文本选项值域 where 选项值域ID = :选项值域ID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameter = { new OracleParameter(":选项值域ID", OracleDbType.Varchar2, ID, ParameterDirection.Input) }; DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, CommandType.Text, oracleParameter); List <ElementRange> list = ModelConvert.DataTableToIList <ElementRange>(dataTable).ToList(); return(list); }
/// <summary> /// 根据资源分类ID获取要素分类 /// </summary> /// <param name="ClassifyID">资源分类ID</param> /// <returns></returns> public List <ElementClassify> GetElementClassifyByID(string CID) { string sql = @"select 资源分类ID ID, 资源ID RID, 分类名称 Name, 备注 Note, 最后修改人 LastModify, 最后修改时间 LastDate from 资源分类 where 资源分类ID = :ID"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter(":ID", OracleDbType.Varchar2, CID, ParameterDirection.Input) }; DataTable dataTable = oracleDataAccess.ExecuteDataTable(sql, System.Data.CommandType.Text, oracleParameters); List <ElementClassify> elementClassifies = ModelConvert.DataTableToIList <ElementClassify>(dataTable).ToList(); return(elementClassifies); }
/// <summary> /// 新增角色用户 /// </summary> /// <param name="roleUesr">角色用户实体</param> /// <param name="dt">时间</param> /// <returns></returns> public string CreateRoleUser(RoleUesr roleUesr, DateTime dt) { string sql = "p_角色用户_core"; OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); OracleParameter[] oracleParameters = { new OracleParameter("角色用户id_In", OracleDbType.Varchar2, roleUesr.RUID, ParameterDirection.Input), new OracleParameter("角色id_In", OracleDbType.Varchar2, roleUesr.RID, ParameterDirection.Input), new OracleParameter("用户id_In", OracleDbType.Varchar2, roleUesr.UserID, ParameterDirection.Input), new OracleParameter("最后修改人_In", OracleDbType.Varchar2, roleUesr.LastModify, ParameterDirection.Input), new OracleParameter("最后修改时间_In", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter("用户名_In", OracleDbType.Varchar2, roleUesr.UserName, ParameterDirection.Input), new OracleParameter("编码_In", OracleDbType.Varchar2, roleUesr.Code, ParameterDirection.Input), new OracleParameter("组织机构_In", OracleDbType.Varchar2, roleUesr.Organization, ParameterDirection.Input), new OracleParameter("邮箱地址_In", OracleDbType.Varchar2, roleUesr.EmailAddress, ParameterDirection.Input) }; oracleDataAccess.ExecuteProcdure(sql, oracleParameters); return("OK"); }
/// <summary> /// 根据ID修改文本值域选项 /// </summary> /// <param name="elementRange">ElementClassify对象</param> /// <param name="dt">最后修改时间</param> public void PutElementRangeByID(ElementRange elementRange, DateTime dt) { OracleDataAccess oracleDataAccess = new OracleDataAccess(SiteConfig.OracleConn); string sql = @"update 文本选项值域 set 选项名称=:选项名称, 备注=:备注, 最后修改人=:最后修改人, 最后修改时间=:最后修改时间, 要素ID=:要素ID where 选项值域ID=:选项值域ID"; OracleParameter[] oracleParameters = { new OracleParameter(":选项名称", OracleDbType.Varchar2, elementRange.Name == null?"":elementRange.Name, ParameterDirection.Input), new OracleParameter(":备注", OracleDbType.Varchar2, elementRange.Note, ParameterDirection.Input), new OracleParameter(":最后修改人", OracleDbType.Varchar2, elementRange.LastModify, ParameterDirection.Input), new OracleParameter(":最后修改时间", OracleDbType.Date, dt, ParameterDirection.Input), new OracleParameter(":要素ID", OracleDbType.Varchar2, elementRange.EID, ParameterDirection.Input), new OracleParameter(":选项值域ID", OracleDbType.Varchar2, elementRange.ID, ParameterDirection.Input), }; oracleDataAccess.ExecuteNonQuery(sql, System.Data.CommandType.Text, oracleParameters); }