internal override bool LogMessage(chat Message) { bool ret = false; SqlConnection sqcon = GetCon(); try { SqlCommand com = new SqlCommand("CHAT_ADD", sqcon); com.Parameters.AddWithValue("message", Message.Message); com.Parameters.AddWithValue("username", Message.User); com.Parameters.AddWithValue("time", Message.Time); if (Message.UID != -1) { com.Parameters.AddWithValue("uid", Message.UID); } com.CommandType = CommandType.StoredProcedure; sqcon.Open(); com.ExecuteNonQuery(); ret = true; } catch { ret = false; } sqcon.Close(); return(ret); }
internal override bool LogMessage(chat Message) { bool ret = false; SqlConnection sqcon = GetCon(); try { SqlCommand com = new SqlCommand("CHAT_ADD", sqcon); com.Parameters.AddWithValue("message", Message.Message); com.Parameters.AddWithValue("username", Message.User); com.Parameters.AddWithValue("time", Message.Time); if (Message.UID != -1) com.Parameters.AddWithValue("uid", Message.UID); com.CommandType = CommandType.StoredProcedure; sqcon.Open(); com.ExecuteNonQuery(); ret = true; } catch { ret = false; } sqcon.Close(); return ret; }
//message internal abstract bool LogMessage(chat Message);
public chat ToChat() { chat tmp = new chat { Message = msg, Time = Ui.ToDateTime((time).ToString()), UID = long.Parse(from.user_id), User = from.user_name, Type = (to == null ? "" : "pm") }; return tmp; }