/// <summary> /// ExamJoinDetails /// </summary> /// <param name="ExamSelect"></param> /// <returns></returns> public List <ExamDetails> ExamJoinDetails(ExamSelect ExamSelect) { SqlConnection connection = new SqlConnection(CONNECTION_STRING); connection.Open(); SqlCommand command = new SqlCommand("spExamJoinDetails", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@examId", ExamSelect.ExamId)); command.Parameters.Add(new SqlParameter("@pageSize", ExamSelect.PageSize)); command.Parameters.Add(new SqlParameter("@pageIndex", ExamSelect.PageIndex)); command.Parameters.Add(new SqlParameter("@sortWay", ExamSelect.SortWay)); command.Parameters.Add(new SqlParameter("@sortFields", ExamSelect.SortFields)); List <ExamDetails> CurrenExamDetails = new List <ExamDetails>(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { ExamDetails examDetail = new ExamDetails(); examDetail.RowNumber = reader.GetInt64(5); examDetail.UserName = reader.GetString(0); examDetail.PassCriteria = reader.GetInt32(1); examDetail.ExamScore = reader.GetInt32(2); examDetail.TotalScore = reader.GetInt32(3); examDetail.IsPass = reader.GetInt32(4); CurrenExamDetails.Add(examDetail); } } return(CurrenExamDetails); }
/// <summary> /// /// </summary> /// <param name="examSelect"></param> /// <returns></returns> public ExamDetails[] ExamJoinDetails(ExamSelect examSelect) { try { return(client.ExamJoinDetails(examSelect)); } catch (RequestExceprion ex) { throw ex; } }
public ExamDetail(int examId) { InitializeComponent(); examManager = new TeacherExamManage(); examSelect = new ExamSelect(); examSelect.ExamId = examId; examSelect.PageSize = 10; examSelect.PageIndex = 1; examSelect.SortWay = "asc"; examSelect.SortFields = ""; ExamJoinDetails(); this.StartPosition = FormStartPosition.CenterScreen; this.windowClose.Click += new EventHandler(WindowCloseClick); this.windowStatus.Click += new EventHandler(WindowStatusClick); this.windowMin.Click += new EventHandler(WindowMinClick); this.head.MouseDown += new MouseEventHandler(HeadMouseDown); this.head.MouseMove += new MouseEventHandler(HeadMouseMove); this.examDetailDataGridView.CellFormatting += new DataGridViewCellFormattingEventHandler(ExamDetailDataGridViewCellFormatting); }
/// <summary> /// /// </summary> /// <param name="examSelect"></param> /// <returns></returns> public List <ExamDetails> ExamJoinDetails(ExamSelect examSelect) { return(teacherDB.ExamJoinDetails(examSelect)); }