public List <SCD> GetStudentInfoWithDepartmentNameAndCourseTrue() { SqlConnection connection = new SqlConnection(connectionString); string query = "SELECT * FROM SCDx1x2 Where Status = '1' "; SqlCommand command = new SqlCommand(query, connection); List <SCD> aList = new List <SCD>(); connection.Open(); SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { SCD aScd = new SCD(); aScd.RegistrationNo = reader["RegistrationNo"].ToString(); aScd.Name = reader["Name"].ToString(); aScd.Email = reader["Email"].ToString(); aScd.CourseId = Convert.ToInt32(reader["CourseId"].ToString()); aScd.CourseCode = reader["CourseCode"].ToString(); aScd.CourseName = reader["CourseName"].ToString(); aList.Add(aScd); } reader.Close(); } connection.Close(); return(aList); }
///<summary> /// Returns first repetition of SCD (Anti-Microbial Cycle Data) - creates it if necessary ///</summary> public SCD GetSCD() { SCD ret = null; try { ret = (SCD)this.GetStructure("SCD"); } catch (HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred", e); } return(ret); }
///<summary> ///Removes the given SCD ///</summary> public void RemoveSCD(SCD toRemove) { this.RemoveStructure("SCD", toRemove); }