//編輯團隊活動時,要帶入該團隊的所有成員 /// <summary> /// 編輯團隊活動時,要帶入該團隊的所有成員 /// </summary> /// <param name="activity_id">活動代號</param> /// <param name="RegistBy">報名人</param> /// <returns>編輯團隊活動時,要帶入該團隊的所有成員</returns> public List <VO.ActivityTeamMemberVO> SelectActivityTeamMember(Guid activity_id, string RegistBy) { SqlParameter[] sqlParams = new SqlParameter[2]; sqlParams[0] = new SqlParameter("@activity_id", SqlDbType.UniqueIdentifier); sqlParams[0].Value = activity_id; sqlParams[1] = new SqlParameter("@RegistBy", SqlDbType.NVarChar, 200); sqlParams[1].Value = RegistBy; StringBuilder sb = new StringBuilder(); sb.AppendLine("SELECT A.*,B.WORK_ID,B.NATIVE_NAME,B.C_DEPT_NAME,B.C_DEPT_ABBR "); sb.AppendLine("FROM ActivityTeamMember A "); sb.AppendLine("left join V_ACSM_USER2 B on A.emp_id=B.ID "); sb.AppendLine("WHERE A.activity_id=@activity_id "); sb.AppendLine("and A.boss_id=@RegistBy "); SqlConnection aconn = MyConn(); SqlDataReader MyDataReader = SqlHelper.ExecuteReader(aconn, CommandType.Text, sb.ToString(), sqlParams); List <VO.ActivityTeamMemberVO> myActivityTeamMemberVOList = new List <ACMS.VO.ActivityTeamMemberVO>(); while (MyDataReader.Read()) { VO.ActivityTeamMemberVO myActivityTeamMemberVO = new ACMS.VO.ActivityTeamMemberVO(); myActivityTeamMemberVO.activity_id = (Guid)MyDataReader["activity_id"]; myActivityTeamMemberVO.emp_id = (string)MyDataReader["emp_id"]; myActivityTeamMemberVO.boss_id = (string)MyDataReader["boss_id"]; myActivityTeamMemberVO.idno_type = Convert.ToInt16(MyDataReader["idno_type"]); myActivityTeamMemberVO.idno = (string)MyDataReader["idno"]; myActivityTeamMemberVO.remark = (string)MyDataReader["remark"]; myActivityTeamMemberVO.check_status = (int)MyDataReader["check_status"]; myActivityTeamMemberVO.WritePersonInfo = "是"; myActivityTeamMemberVO.WORK_ID = (string)MyDataReader["WORK_ID"]; myActivityTeamMemberVO.NATIVE_NAME = (string)MyDataReader["NATIVE_NAME"]; myActivityTeamMemberVO.C_DEPT_ABBR = (string)MyDataReader["C_DEPT_ABBR"]; myActivityTeamMemberVO.C_DEPT_NAME = (string)MyDataReader["C_DEPT_NAME"]; myActivityTeamMemberVOList.Add(myActivityTeamMemberVO); } MyDataReader.Close(); aconn.Close(); if (MyDataReader != null) { MyDataReader.Dispose(); } if (aconn != null) { aconn.Dispose(); } return(myActivityTeamMemberVOList); }
//編輯團隊活動時,要帶入該團隊的所有成員 /// <summary> /// 編輯團隊活動時,要帶入該團隊的所有成員 /// </summary> /// <param name="activity_id">活動代號</param> /// <param name="RegistBy">報名人</param> /// <returns>編輯團隊活動時,要帶入該團隊的所有成員</returns> public List<VO.ActivityTeamMemberVO> SelectActivityTeamMember(Guid activity_id, string RegistBy) { SqlParameter[] sqlParams = new SqlParameter[2]; sqlParams[0] = new SqlParameter("@activity_id", SqlDbType.UniqueIdentifier); sqlParams[0].Value = activity_id; sqlParams[1] = new SqlParameter("@RegistBy", SqlDbType.NVarChar, 200); sqlParams[1].Value = RegistBy; StringBuilder sb = new StringBuilder(); sb.AppendLine("SELECT A.*,B.WORK_ID,B.NATIVE_NAME,B.C_DEPT_NAME,B.C_DEPT_ABBR "); sb.AppendLine("FROM ActivityTeamMember A "); sb.AppendLine("left join V_ACSM_USER2 B on A.emp_id=B.ID "); sb.AppendLine("WHERE A.activity_id=@activity_id "); sb.AppendLine("and A.boss_id=@RegistBy "); SqlConnection aconn = MyConn(); SqlDataReader MyDataReader = SqlHelper.ExecuteReader(aconn, CommandType.Text, sb.ToString(), sqlParams); List<VO.ActivityTeamMemberVO> myActivityTeamMemberVOList = new List<ACMS.VO.ActivityTeamMemberVO>(); while (MyDataReader.Read()) { VO.ActivityTeamMemberVO myActivityTeamMemberVO = new ACMS.VO.ActivityTeamMemberVO(); myActivityTeamMemberVO.activity_id = (Guid)MyDataReader["activity_id"]; myActivityTeamMemberVO.emp_id = (string)MyDataReader["emp_id"]; myActivityTeamMemberVO.boss_id = (string)MyDataReader["boss_id"]; myActivityTeamMemberVO.idno_type = Convert.ToInt16(MyDataReader["idno_type"]); myActivityTeamMemberVO.idno = (string)MyDataReader["idno"]; myActivityTeamMemberVO.remark = (string)MyDataReader["remark"]; myActivityTeamMemberVO.check_status = (int)MyDataReader["check_status"]; myActivityTeamMemberVO.WritePersonInfo = "是"; myActivityTeamMemberVO.WORK_ID = (string)MyDataReader["WORK_ID"]; myActivityTeamMemberVO.NATIVE_NAME = (string)MyDataReader["NATIVE_NAME"]; myActivityTeamMemberVO.C_DEPT_ABBR = (string)MyDataReader["C_DEPT_ABBR"]; myActivityTeamMemberVO.C_DEPT_NAME = (string)MyDataReader["C_DEPT_NAME"]; myActivityTeamMemberVOList.Add(myActivityTeamMemberVO); } MyDataReader.Close(); aconn.Close(); if (MyDataReader != null) MyDataReader.Dispose(); if (aconn != null) aconn.Dispose(); return myActivityTeamMemberVOList; }