public static System.Collections.Generic.List <AED_Service> GetBatteryListExpiredEmail(int CompanyID) { System.Collections.Generic.List <AED_Service> result = new System.Collections.Generic.List <AED_Service>(); 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_Service.GetService(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static List <AED_Service> GetServicesByAED(int AED_FK) { List <AED_Service> result = new List <AED_Service>(); 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_Service.GetService(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }