Exemple #1
0
        public static void AddQuery(string mess, SocketManagment sock, QueryElement.QueryType QType, string sql)
        {
            switch (QType)
            {
            case QueryElement.QueryType.SysError:
                SysErrors++;
                break;

            case QueryElement.QueryType.DBError:
                DBErrors++;
                break;

            case QueryElement.QueryType.ClientError:
                ClientErrors++;
                break;

            case QueryElement.QueryType.Error:
                break;

            case QueryElement.QueryType.None:
                break;
            }
            QueryElement query = new QueryElement(mess, sock, QType, sql, DateTime.Now, ErrorsCounter++);

            link.AddLast(query);
            AddQueryHandle();
        }
Exemple #2
0
 public QueryElement(string Mess, SocketManagment sock, QueryType QType, DateTime tie, int indx)
 {
     Message = Mess;
     socket  = sock;
     Type    = QType;
     time    = tie;
     index   = indx;
 }
Exemple #3
0
        private void DeleteClient(SocketManagment client)
        {
            string ip = client.Sock.RemoteEndPoint.ToString();
            int    id = client.Clientid;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (row.Cells[0].Value.Equals(id))
                {
                    dataGridView1.Rows.RemoveAt(row.Index);
                    break;
                }
            }
            label6.Text = Convert.ToString(m_aryClients.Count);
        }
Exemple #4
0
        public void AddRows()
        {
            LinkedListNode <QueryElement> node;

            for (node = link.Last; node != null; node = node.Previous)
            {
                switch (node.Value.GetQType())
                {
                case QueryElement.QueryType.None: break;

                case QueryElement.QueryType.Error: break;

                case QueryElement.QueryType.DBError:
                {
                    SocketManagment client = node.Value.GetSocket();
                    string          name   = client.name;
                    int             id     = client.Clientid;
                    dataGridView1.Rows.Add(Properties.Resources.CacheWarning_16x, node.Value.GetIndex(), node.Value.GetTime(), "DBError", node.Value.GetMessage(), name, id, "Выполнить перезапись в базу данных", "Исправить", "Пропустить");
                    break;
                }

                case QueryElement.QueryType.SysError:
                {
                    dataGridView1.Rows.Add(Properties.Resources.Important_16x, node.Value.GetIndex(), node.Value.GetTime(), "SysError", node.Value.GetMessage(), "", "", "", "", "Пропустить");
                    break;
                }

                case QueryElement.QueryType.ClientError:
                {
                    SocketManagment client = node.Value.GetSocket();
                    string          name   = client.name;
                    int             id     = client.Clientid;
                    dataGridView1.Rows.Add(Properties.Resources.RouteServiceError_16x, node.Value.GetIndex(), node.Value.GetTime(), "ClientError", node.Value.GetMessage(), name, id, "", "", "Пропустить");
                    break;
                }

                case QueryElement.QueryType.ClientWarning:
                {
                    dataGridView1.Rows.Add(Properties.Resources.AddUser_16x, node.Value.GetIndex(), node.Value.GetTime(), "ClientWarning", node.Value.GetMessage(), "", "", "", "Исправить", "Пропустить");
                    break;
                }
                }
            }
            dataGridView1.AutoResizeColumns();
        }
Exemple #5
0
 public void Dispose()
 {
     Message  = null;
     socket   = null;
     sqlquery = null;
 }