/// <summary> /// 取指定岗位下的所有角色 /// </summary> /// <param name="_postid"></param> /// <returns></returns> public static List <SinoRole> Get_RolesOfGW(string _postid) { string _sql = string.Format(" select a.jsid,a.jsmc,a.jssm,a.ssdwid from qx2_gwjsgxb t,qx_jsdyb a "); _sql += string.Format("where a.jsid = t.jsid and t.gwid = :GWID"); SqlParameter[] _param = { new SqlParameter(":GWID", SqlDbType.Decimal), }; _param[0].Value = decimal.Parse(_postid); List <SinoRole> roles = new List <SinoRole>(); SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringProfile, CommandType.Text, _sql, _param); while (dr.Read()) { SinoRole _sr = RightFunctions.CreateRoleItem(dr.GetDecimal(0).ToString(), dr.IsDBNull(1) ? "" : dr.GetString(1), dr.IsDBNull(2) ? "" : dr.GetString(2), dr.IsDBNull(3) ? "" : dr.GetDecimal(3).ToString() ); roles.Add(_sr); } dr.Close(); return(roles); }
/// <summary> /// 取用户的角色 /// </summary> /// <param name="yhid"></param> /// <returns></returns> public static ArrayList Get_RoleByYHID(string yhid) { string _sql = string.Format(" select a.jsid,a.jsmc,a.jssm,a.ssdwid from qx_yhjsgxb t,qx_jsdyb a "); _sql += string.Format("where a.jsid = t.jsid and yhid = {0}", yhid); DataTable _dt = SqlHelper.Get_Data(_sql, "ROLES"); ArrayList roles = new ArrayList(); foreach (DataRow _dr in _dt.Rows) { SinoRole _sr = RightFunctions.CreateRoleItem(_dr); roles.Add(_sr); } return(roles); }