public PersonEntity GetPersonInfo(string userName, string passWord) { PersonEntity pe = new PersonEntity(); string strSql = @" SELECT * FROM TBLPERSON where personaccount=@UserName and personpassword=@PassWord"; string[] paramName=new string[2]; object[] paramValue = new object[2]; paramName[0]="UserName"; paramName[1] = "PassWord"; paramValue[0] = userName; paramValue[1] = passWord; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSql,CommandType.Text,paramName,paramValue); broker.Close(); if (dst != null && dst.Tables[0] != null && dst.Tables[0].Rows.Count > 0) { return this.DataRow2Person(dst.Tables[0].Rows[0]); } else { return null; } }
public DataSet GetAllFunctions() { string strSql = " SELECT * FROM TBLFUNCTION ORDER BY functionorder "; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSql); broker.Close(); return dst; }
/// <summary> /// 根据群组查询权限 /// </summary> /// <param name="groupID"></param> /// <returns></returns> public DataTable GetFuncByGroup(string groupID) { string strSQL = @" SELECT * FROM dbo.TBLGroupFunctionMap WHERE groupID=@GroupID "; string[] paramNames = new string[1]; object[] paramValues = new object[1]; paramNames[0] = "GroupID"; paramValues[0] = groupID; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSQL, CommandType.Text, paramNames, paramValues); broker.Close(); return dst.Tables[0]; }
public FunctionEntity GetFunc(string oid) { string strSQL = @" SELECT * FROM TBLFUNCTION WHERE oid=@OID "; string[] paramNames = new string[1]; object[] paramValues = new object[1]; paramNames[0] = "OID"; paramValues[0] = oid; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSQL,CommandType.Text,paramNames,paramValues); broker.Close(); if (dst != null && dst.Tables[0] != null && dst.Tables[0].Rows.Count > 0) { return Datarow2Entity(dst.Tables[0].Rows[0]); } else { return null; } }
public PermissionGroupEntity GetGroupInfo(string personID) { PermissionGroupEntity pe = new PermissionGroupEntity(); string strSql = @" SELECT * FROM TBLPermissionGroup WHERE oid=@OID "; string[] paramName = new string[1]; object[] paramValue = new object[1]; paramName[0] = "OID"; paramValue[0] = personID; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSql, CommandType.Text, paramName, paramValue); broker.Close(); if (dst != null && dst.Tables[0] != null && dst.Tables[0].Rows.Count > 0) { return this.DataRow2Group(dst.Tables[0].Rows[0]); } else { return null; } }
/// <summary> /// 查询功能列表 /// </summary> /// <param name="funcCode"></param> /// <param name="funcName"></param> /// <returns></returns> public DataSet QueryFunctions(string funcCode,string funcName) { string strSql = @" SELECT * FROM dbo.TBLFUNCTION WHERE 1 = 1 "; if (!string.IsNullOrEmpty(funcCode)) { strSql += " and p.functionkey = FunCode "; } if (!string.IsNullOrEmpty(funcName)) { strSql += " and p.functionname = FunName "; } strSql += " ORDER BY functionorder "; string[] paramNames = new string[2]; object[] paramValues = new object[2]; paramNames[0] = "FunCode"; paramNames[1] = "FunName"; paramValues[0] = funcCode; paramValues[1] = funcName; SqlDBBroker broker = new SqlDBBroker(); broker.Open(); DataSet dst = broker.ExecuteDataset(strSql); broker.Close(); return dst; }