1 14 package org.compiere.model; 15 16 import java.util.*; 17 import java.sql.*; 18 import java.math.*; 19 import java.io.*; 20 21 import org.compiere.util.*; 22 23 29 public class MAdvertisement extends X_W_Advertisement 30 { 31 36 public MAdvertisement (Properties ctx, int W_Advertisement_ID) 37 { 38 super (ctx, W_Advertisement_ID); 39 47 } 49 54 public MAdvertisement (Properties ctx, ResultSet rs) 55 { 56 super (ctx, rs); 57 } 59 60 private MClickCount m_clickCount = null; 61 62 private MCounterCount m_counterCount = null; 63 64 private int m_SalesRep_ID = 0; 65 66 67 68 72 public MClickCount getMClickCount() 73 { 74 if (getW_ClickCount_ID() == 0) 75 return null; 76 if (m_clickCount == null) 77 m_clickCount = new MClickCount (getCtx(), getW_ClickCount_ID()); 78 return m_clickCount; 79 } 81 public String getClickTargetURL() 82 { 83 getMClickCount(); 84 if (m_clickCount == null) 85 return "-"; 86 return m_clickCount.getTargetURL(); 87 } 89 93 public ValueNamePair[] getClickCountWeek () 94 { 95 getMClickCount(); 96 if (m_clickCount == null) 97 return new ValueNamePair[0]; 98 return m_clickCount.getCountWeek(); 99 } 101 102 106 public MCounterCount getMCounterCount() 107 { 108 if (getW_CounterCount_ID() == 0) 109 return null; 110 if (m_counterCount == null) 111 m_counterCount = new MCounterCount (getCtx(), getW_CounterCount_ID()); 112 return m_counterCount; 113 } 115 120 public int getSalesRep_ID() 121 { 122 if (m_SalesRep_ID == 0) 123 m_SalesRep_ID = DB.getSQLValue("SELECT AD_User_ID FROM AD_User " 124 + "WHERE C_BPartner_ID=? AND IsActive='Y' ORDER BY 1", getC_BPartner_ID()); 125 return m_SalesRep_ID; 126 } 128 }
| Popular Tags
|