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(); }
public QueryElement(string Mess, SocketManagment sock, QueryType QType, DateTime tie, int indx) { Message = Mess; socket = sock; Type = QType; time = tie; index = indx; }
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); }
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(); }
public void Dispose() { Message = null; socket = null; sqlquery = null; }