/// <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); }
public string PutMainAuthorityByAID([FromBody] MainAuthority mainAuthority) { MainAuthorityBLL mainAuthorityBLL = new MainAuthorityBLL(); mainAuthorityBLL.PutMainAuthorityByAID(mainAuthority); return("ok"); }
/// <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> /// 根据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); }
public string CreateMainAuthority([FromBody] MainAuthority mainAuthority) { MainAuthorityBLL mainAuthorityBLL = new MainAuthorityBLL(); mainAuthorityBLL.CreateMainAuthority(mainAuthority); return("ok"); }
public string CreateMainAuthorityByOthers([FromBody] MainAuthority mainAuthority) { MainAuthorityBLL mainAuthorityBLL = new MainAuthorityBLL(); mainAuthorityBLL.CreateMainAuthorityByOthers(mainAuthority); return("OK"); }
/// <summary> /// 根据AID修改主体权限 /// </summary> /// <param name="mainAuthority">主体权限对象</param> /// <param name="dt">最后修改时间</param> public void PutMainAuthorityByAID(MainAuthority mainAuthority) { ///获取当前时间 DateTime dt = NewData.NewDate(); //新增主体权限 MainAuthorityDAL mainAuthorityDAL = new MainAuthorityDAL(); mainAuthorityDAL.PutMainAuthorityByAID(mainAuthority, dt); //新增人员权限 PersonnelAuthorityDAL personnelAuthorityDAL = new PersonnelAuthorityDAL(); personnelAuthorityDAL.CreatePersonnelAuthority(mainAuthority.AID); }
/// <summary> /// 新增主体权限 /// </summary> /// <param name="mainAuthority">主体权限对象</param> /// <param name="dt">最后修改时间</param> /// <param name="nid">新GUID</param> public void CreateMainAuthority(MainAuthority mainAuthority) { //获取当前时间 DateTime dt = NewData.NewDate(); //获取新的GUID string nid = NewData.NewGuid(); //新增主体权限 MainAuthorityDAL mainAuthorityDAL = new MainAuthorityDAL(); mainAuthorityDAL.CreateMainAuthority(mainAuthority, dt, nid); //新增人员权限 PersonnelAuthorityDAL personnelAuthorityDAL = new PersonnelAuthorityDAL(); personnelAuthorityDAL.CreatePersonnelAuthority(nid); }
/// <summary> /// 角色权限管理页面其他权限管理新增主体权限 同步人员权限 /// </summary> /// <param name="mainAuthority">主体权限实体</param> /// <param name="dt">最后修改时间</param> public void CreateMainAuthorityByOthers(MainAuthority mainAuthority) { //获取当前时间 DateTime dt = NewData.NewDate(); MainAuthorityDAL mainAuthorityDAL = new MainAuthorityDAL(); PersonnelAuthorityDAL personnelAuthorityDAL = new PersonnelAuthorityDAL(); //主体权限新增 string ifsuccess = mainAuthorityDAL.CreateMainAuthorityByOthers(mainAuthority, dt); if (ifsuccess == "OK") { //人员权限同步 personnelAuthorityDAL.CreatePersonnelAuthority(mainAuthority.AID); } }
/// <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"); }