public virtual int SCPost(int pe_id, string uid, string uname) { SMC_CollectDao colDao = new SMC_CollectDao(AppConfig.statisticDBKey); SMC_Collect coll = colDao.GetEntity(uid, pe_id); int result = 10; if (coll == null) { coll = new SMC_Collect(); coll.pe_id = pe_id; coll.uid = uid; coll.uname = uname; coll.clt_CollectDate = DateTime.Now; try { colDao.Insert(coll); result = 11; } catch { result = 10; } } else { colDao.Delete(coll); result = 21; } return result; }
public virtual bool IsCollected(int pe_id, string uid) { SMC_CollectDao colDao = new SMC_CollectDao(AppConfig.statisticDBKey); SMC_Collect coll = colDao.GetEntity(uid, pe_id); if (coll != null) { return true; } else { return false; } }