Пример #1
0
        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);
        }
Пример #2
0
        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;
        }
Пример #3
0
 //message
 internal abstract bool LogMessage(chat Message);
Пример #4
0
 //message
 internal abstract bool LogMessage(chat Message);
Пример #5
0
 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;
 }