public static System.Collections.Generic.List <AED_Redning> GetRedningListCompany(int CompanyID) { System.Collections.Generic.List <AED_Redning> result = new System.Collections.Generic.List <AED_Redning>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectByCompany)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Redning.GetRedning(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static System.Collections.Generic.List <AED_Redning> GetRedningList(int AED_FK) { System.Collections.Generic.List <AED_Redning> result = new System.Collections.Generic.List <AED_Redning>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("AED_FK", AED_FK); SqlDataReader dr = default(SqlDataReader); //Try dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectByAED)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Redning.GetRedning(ID)); } } dr.Close(); //Catch ex As Exception //Throw ex //End Try return(result); }