internal void criarAresta(int idOrigem, int idDestino, int peso) { GrafoLinqDataContext dt = new GrafoLinqDataContext(); tb_Aresta novaAresta = new tb_Aresta(); novaAresta.id_origem = idOrigem; novaAresta.id_destino = idDestino; novaAresta.peso = peso; dt.tb_Arestas.InsertOnSubmit(novaAresta); dt.SubmitChanges(); }
public void criarVertice(int idGrafo, string valor, int posX, int posY) { GrafoLinqDataContext dt = new GrafoLinqDataContext(); tb_Vertice novoVertice = new tb_Vertice(); novoVertice.id_grafo = idGrafo; novoVertice.nome = valor; novoVertice.posX = posX; novoVertice.posY = posY; dt.tb_Vertices.InsertOnSubmit(novoVertice); dt.SubmitChanges(); }
public void criarGrafo(string nome, int width, int height) { GrafoLinqDataContext dt = new GrafoLinqDataContext(); tb_Grafo novoGrafo = new tb_Grafo(); novoGrafo.nome = nome; novoGrafo.width = width; novoGrafo.height = height; dt.tb_Grafos.InsertOnSubmit(novoGrafo); try { dt.SubmitChanges(); } catch (Exception ex) { throw ex; } }