foreach (DataRow row in dtSub.Rows) { objSubExamSubjectMarks = new SpGetAllStudentSubExamMarks_Result(); if (row["ExamSubMapId"] != DBNull.Value) objSubExamSubjectMarks.ExamSubMapId = Convert.ToInt32(row["ExamSubMapId"]); if (row["CourseId"] != DBNull.Value) objSubExamSubjectMarks.CourseId = Convert.ToInt32(row["CourseId"]); if (row["ExamCourseMappingId"] != DBNull.Value) objSubExamSubjectMarks.ExamCourseMappingId = Convert.ToInt32(row["ExamCourseMappingId"]); if (row["ExamTypeId"] != DBNull.Value) objSubExamSubjectMarks.ExamTypeId = Convert.ToInt32(row["ExamTypeId"]); if (row["SubjectId"] != DBNull.Value) objSubExamSubjectMarks.SubjectId = Convert.ToInt32(row["SubjectId"]); if (row["SubSectionId"] != DBNull.Value) objSubExamSubjectMarks.SubSectionId = Convert.ToInt32(row["SubSectionId"]); if ((row["Description"] != DBNull.Value) && (!string.IsNullOrEmpty(row["Description"].ToString()))) objSubExamSubjectMarks.Description = Convert.ToString(row["Description"]); List<student> lstStudents = objGenlogic.getAllStudents(Convert.ToDateTime(ddlBulkAcad.SelectedValue)) .FindAll( F =>F.SectionId == Convert.ToInt32(ddlBulkSec.SelectedValue) && F.CourseId == Convert.ToInt32(row["CourseId"])); objSubExamSubjectMarks.AcademicYear = ddlBulkAcad.SelectedValue; foreach (Student objStudent in lstStudents) { if (row[objStudent.FullName + "-" + objStudent.StudentId] != DBNull.Value) objSubExamSubjectMarks.MarksObtained = Convert.ToString(row[objStudent.FullName + "-" + objStudent.StudentId]); objSubExamSubjectMarks.StudentId = objStudent.StudentId; lstSubExamData.Add(objSubExamSubjectMarks); } }
foreach (Student objStudent in lstStudents) { foreach (DataRow row in dtSub.Rows) { objSubExamSubjectMarks = new SpGetAllStudentSubExamMarks_Result(); if (row["ExamSubMapId"] != DBNull.Value) objSubExamSubjectMarks.ExamSubMapId = Convert.ToInt32(row["ExamSubMapId"]); if (row["CourseId"] != DBNull.Value) objSubExamSubjectMarks.CourseId = Convert.ToInt32(row["CourseId"]); if (row["ExamCourseMappingId"] != DBNull.Value) objSubExamSubjectMarks.ExamCourseMappingId = Convert.ToInt32(row["ExamCourseMappingId"]); if (row["ExamTypeId"] != DBNull.Value) objSubExamSubjectMarks.ExamTypeId = Convert.ToInt32(row["ExamTypeId"]); if (row["SubjectId"] != DBNull.Value) objSubExamSubjectMarks.SubjectId = Convert.ToInt32(row["SubjectId"]); if (row["SubSectionId"] != DBNull.Value) objSubExamSubjectMarks.SubSectionId = Convert.ToInt32(row["SubSectionId"]); if ((row["Description"] != DBNull.Value) && (!string.IsNullOrEmpty(row["Description"].ToString()))) objSubExamSubjectMarks.Description = Convert.ToString(row["Description"]); objSubExamSubjectMarks.AcademicYear = ddlBulkAcad.SelectedValue; if (row[objStudent.FullName + "-" + objStudent.StudentId] != DBNull.Value) objSubExamSubjectMarks.MarksObtained = Convert.ToString(row[objStudent.FullName + "-" + objStudent.StudentId]); objSubExamSubjectMarks.StudentId = objStudent.StudentId; lstSubExamData.Add(objSubExamSubjectMarks); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)