Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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;
            }
        }