internal LateMessage MsgParser(IDataReader Reader) { LateMessage tmp = new LateMessage { }; tmp.FromUid = (int)Reader["msg_from"]; tmp.id = (int)Reader["id"]; tmp.ToUid = (int)Reader["msg_for"]; tmp.Message = (string)Reader["msg"]; tmp.pm = (bool)Reader["pm"]; tmp.Sent = (bool)Reader["sent"]; tmp.MessageTime = (DateTime)Reader["msg_time"]; return tmp; }
internal LateMessage MsgParser(IDataReader Reader) { LateMessage tmp = new LateMessage { }; tmp.FromUid = (int)Reader["msg_from"]; tmp.id = (int)Reader["id"]; tmp.ToUid = (int)Reader["msg_for"]; tmp.Message = (string)Reader["msg"]; tmp.pm = (bool)Reader["pm"]; tmp.Sent = (bool)Reader["sent"]; tmp.MessageTime = (DateTime)Reader["msg_time"]; return(tmp); }
internal override bool SentMessageForUser(LateMessage msg) { int tmp = 0; SqlConnection sqcon = GetCon(); try { sqcon.Open(); SqlCommand Command = new SqlCommand("MessageSent", sqcon); Command.CommandType = System.Data.CommandType.StoredProcedure; Command.Parameters.AddWithValue("id", msg.id); tmp = Command.ExecuteNonQuery(); } catch { } sqcon.Close(); return(tmp != 0); }
internal override bool AddMessageForUser(LateMessage msg) { int tmp = 0; SqlConnection sqcon = GetCon(); try { sqcon.Open(); SqlCommand Command = new SqlCommand("addLateMessage", sqcon); Command.CommandType = System.Data.CommandType.StoredProcedure; Command.Parameters.AddWithValue("uid", msg.FromUid); Command.Parameters.AddWithValue("toID", msg.ToUid); Command.Parameters.AddWithValue("message", msg.Message); Command.Parameters.AddWithValue("pm", msg.pm?1:0); Command.Parameters.AddWithValue("time", msg.MessageTime); tmp = Command.ExecuteNonQuery(); } catch { } sqcon.Close(); return tmp!=0; }
internal override bool AddMessageForUser(LateMessage msg) { int tmp = 0; SqlConnection sqcon = GetCon(); try { sqcon.Open(); SqlCommand Command = new SqlCommand("addLateMessage", sqcon); Command.CommandType = System.Data.CommandType.StoredProcedure; Command.Parameters.AddWithValue("uid", msg.FromUid); Command.Parameters.AddWithValue("toID", msg.ToUid); Command.Parameters.AddWithValue("message", msg.Message); Command.Parameters.AddWithValue("pm", msg.pm?1:0); Command.Parameters.AddWithValue("time", msg.MessageTime); tmp = Command.ExecuteNonQuery(); } catch { } sqcon.Close(); return(tmp != 0); }
internal override bool SentMessageForUser(LateMessage msg) { int tmp = 0; SqlConnection sqcon = GetCon(); try { sqcon.Open(); SqlCommand Command = new SqlCommand("MessageSent", sqcon); Command.CommandType = System.Data.CommandType.StoredProcedure; Command.Parameters.AddWithValue("id", msg.id); tmp = Command.ExecuteNonQuery(); } catch { } sqcon.Close(); return tmp != 0; }
internal abstract bool SentMessageForUser(LateMessage msg);
internal abstract bool AddMessageForUser(LateMessage msg);