public static System.Collections.Generic.List <AED_Battery> GetBatteryListExpiredEmail(int CompanyID) { System.Collections.Generic.List <AED_Battery> result = new System.Collections.Generic.List <AED_Battery>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectAllExpiredEmail)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Battery.GetBattery(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static System.Collections.Generic.List <AED_Battery> GetBatteryList(int AED_FK) { System.Collections.Generic.List <AED_Battery> result = new System.Collections.Generic.List <AED_Battery>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("AED_FK", AED_FK); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); 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_Battery.GetBattery(ID)); } } dr.Close(); //Catch ex As Exception //Throw ex //End Try return(result); }