public List <VO.RoleListVO> SelectRoleList() { DAO.SelectorDAO mySelectorDAO = new ACMS.DAO.SelectorDAO(); List <VO.RoleListVO> myRoleListVOList = new List <ACMS.VO.RoleListVO>(); myRoleListVOList = mySelectorDAO.SelectRoleList(); VO.RoleListVO myRoleListVO = new ACMS.VO.RoleListVO(); myRoleListVO.id = null; myRoleListVO.role_name = "請選擇"; myRoleListVOList.Insert(0, myRoleListVO); return(myRoleListVOList); }
public List<VO.RoleListVO> SelectRoleList() { DAO.SelectorDAO mySelectorDAO = new ACMS.DAO.SelectorDAO(); List<VO.RoleListVO> myRoleListVOList = new List<ACMS.VO.RoleListVO>(); myRoleListVOList = mySelectorDAO.SelectRoleList(); VO.RoleListVO myRoleListVO = new ACMS.VO.RoleListVO(); myRoleListVO.id = null; myRoleListVO.role_name = "請選擇"; myRoleListVOList.Insert(0, myRoleListVO); return myRoleListVOList; }
//7-2 主辦單位設定 角色 DDL DataSource /// <summary> /// 取得角色對應資料 /// </summary> /// <returns>取得角色對應資料</returns> public List<VO.RoleListVO> SelectRoleList() { StringBuilder sb = new StringBuilder(); sb.AppendLine("SELECT *"); sb.AppendLine("FROM RoleList A "); SqlConnection aconn = MyConn(); IDataReader myIDataReader = SqlHelper.ExecuteReader(aconn, CommandType.Text, sb.ToString(), null); List<VO.RoleListVO> myRoleListVOList = new List<ACMS.VO.RoleListVO>(); while (myIDataReader.Read()) { VO.RoleListVO myRoleListVO = new ACMS.VO.RoleListVO(); myRoleListVO.id = (int)myIDataReader["id"]; myRoleListVO.role_name = (string)myIDataReader["role_name"]; myRoleListVOList.Add(myRoleListVO); } myIDataReader.Close(); aconn.Close(); if (myIDataReader != null) myIDataReader.Dispose(); if (aconn != null) aconn.Dispose(); return myRoleListVOList; }