Exemplo n.º 1
0
 public Log_message(string str, Message_level level, Message_type type)
 {
     message    = str;
     this.level = level;
     this.type  = type;
     datetime   = DateTime.Now;
 }
Exemplo n.º 2
0
        public List <Message_type> getAllMessageType()
        {
            try
            {
                List <Message_type> lu = new List <Message_type>();
                string sql             = @"SELECT * FROM message_type";

                SqlCommand cmd = new SqlCommand(sql, sqlConnection);
                sqlConnection.Open();
                SqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    Message_type u = new Message_type();
                    u.id_message_type     = reader.GetInt32(0);
                    u.message_code        = SafeGetString(reader, 1);
                    u.message_description = SafeGetString(reader, 2);

                    lu.Add(u);
                }
                sqlConnection.Close();
                return(lu);
            }
            catch (Exception ex)
            {
                sqlConnection.Close();
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void ShowMessage(string title, string message, Message_type type)
        {
            MessageBoxIcon msgIco;

            switch (type)
            {
            case Message_type.error:
                msgIco = MessageBoxIcon.Error;
                break;

            case Message_type.info:
                msgIco = MessageBoxIcon.Asterisk;
                break;

            case Message_type.warning:
                msgIco = MessageBoxIcon.Warning;
                break;

            default:
                msgIco = MessageBoxIcon.None;
                break;
            }
            MessageBox.Show(message, title, MessageBoxButtons.OK, msgIco);
        }
Exemplo n.º 4
0
 public static void AddText(string new_messag, Message_level level, Message_type type)
 {
     log_text.Add(new Log_message(new_messag, level, type));
     OnRefresh?.Invoke(log_text);
 }