public static long SaveTopic(string Name) { if (string.IsNullOrEmpty(Name)) { return(-1); } Topic t = GetTopicByName(Name); if (t == null) { t = new Topic(); t.Name = Name; t.ID = CreateTopic(t); if (t.ID <= 0) { return(-1); } } UpdateTopicForRefCount(t.ID); StatisticTopic st = new StatisticTopic(); st.TopicID = t.ID; st.TopicName = t.Name; st.ID = CreateStatisticTopic(st); return(t.ID); }
public long CreateStatisticTopic(StatisticTopic st) { DbParameter[] parms = { DbHelper.MakeInParam("@TopicID", (DbType)SqlDbType.BigInt, 8, st.TopicID), DbHelper.MakeInParam("@TopicName", (DbType)SqlDbType.NVarChar, 100, st.TopicName) }; return(TypeConverter.ObjectToLong(DbHelper.ExecuteScalar(CommandType.StoredProcedure, "CreateStatisticTopic", parms), -1)); }
public static long CreateStatisticTopic(StatisticTopic st) { try { if (st == null) { return(-1); } return(Data.Topics.CreateStatisticTopic(st)); } catch (Exception ex) { Logs.WriteErrorLog(ex); return(-1); } }
public static long CreateStatisticTopic(StatisticTopic st) { return(DatabaseProvider.GetInstance().CreateStatisticTopic(st)); }