public static void GetTotalAkgecianAndNonAkgecian(out int totalAkgecian, out int totalNonAkgecian) { totalAkgecian = 0; totalNonAkgecian = 0; DataSet participantDataSet = ParticipantRepository.GetAllParticipants(); DataTable participantDataTable = participantDataSet.Tables[0]; foreach (DataRow row in participantDataTable.Rows) { if (row["CollegeName"].ToString() == "Ajay Kumar Garg Engineering College") { totalAkgecian++; } else { totalNonAkgecian++; } } }
public static DataSet GetAllParticipants() { DataSet participantDataSet = ParticipantRepository.GetAllParticipants(); DataTable participantDataTable = participantDataSet.Tables[0]; DataColumn genderColumn = new DataColumn(); genderColumn.ColumnName = "Gender"; genderColumn.DataType = typeof(string); participantDataTable.Columns.Add(genderColumn); foreach (DataRow row in participantDataTable.Rows) { if (row["GenderID"].ToString() == "1") { row["Gender"] = "Male"; } else { row["Gender"] = "Female"; } } return(participantDataSet); }
public static void GetTotalMalesAndFemales(out int totalMales, out int totalFemales) { totalMales = 0; totalFemales = 0; DataSet participantDataSet = ParticipantRepository.GetAllParticipants(); DataTable participantDataTable = participantDataSet.Tables[0]; DataColumn genderColumn = new DataColumn(); genderColumn.ColumnName = "Gender"; genderColumn.DataType = typeof(string); participantDataTable.Columns.Add(genderColumn); foreach (DataRow row in participantDataTable.Rows) { if (row["GenderID"].ToString() == "1") { totalMales++; } else { totalFemales++; } } }
public static int GetTotalParticipation() { return(ParticipantRepository.GetAllParticipants().Tables[0].Rows.Count); }