Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 //message
 internal abstract bool LogMessage(chat Message);
Ejemplo n.º 4
0
 //message
 internal abstract bool LogMessage(chat Message);
Ejemplo n.º 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;
 }