I can not save the [closed]

-3

Every time I click on the program, send it to me

    internal void Insert(int p, string p_2, string p_3, int p_4, string p_5, System.Drawing.Image image, string p_6)
    {
        throw new System.NotImplementedException();
    }

But I have no idea how to solve, my code is soon to follow, if anyone knows how to help me, I would appreciate it very much, this is just a program I'm trying to make for my mother to use in her work to facilitate >

I'm using Visual Studio 2010 C # with SQL Server, if that makes any difference

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ficha_de_Anamnese.anamneseDBDataSetTableAdapters;
using System.IO;

namespace Ficha_de_Anamnese
{
    public partial class cadastrodeusuario : Form
    {
        public cadastrodeusuario()
        {
            InitializeComponent();
        }

        void Limpar()
        {
            imgpath.Clear();
            senha.Clear();
            confsenha.Clear();
            resposta.Clear();
            email.Clear();
            login.Clear();
            nome.Clear();
            pergunta.SelectedIndex = -1;
            if (imgbox.Image != null)
            {
                imgbox.Image.Dispose();
                imgbox.Image = null;
            }
        }

        private void cadastrodeusuario_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'anamneseDBDataSet.userDB' table. You can move, or remove it, as needed.
            this.userDBTableAdapter.Fill(this.anamneseDBDataSet.userDB);
            // TODO: This line of code loads data into the 'anamneseDBDataSet.pergDB' table. You can move, or remove it, as needed.
            this.pergDBTableAdapter.Fill(this.anamneseDBDataSet.pergDB);
            Limpar();

        }

        private void btn_voltar_Click(object sender, EventArgs e)
        {
            this.Close();
            Inicio back = new Inicio();
            back.Show();
        }

        private void btn_cadastrar_Click(object sender, EventArgs e)
        {
            System.Text.RegularExpressions.Regex rEMail = new System.Text.RegularExpressions.Regex(@"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
            if (nome.Text.Trim() == "")
            {
                MessageBox.Show("O campo NOME deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                nome.Focus();
            }
            else if (email.Text.Trim() == "")
            {
                MessageBox.Show("O campo E-MAIL deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                email.Focus();
            }
            else if (!rEMail.IsMatch(email.Text))
            {
                MessageBox.Show("E-Mail inválido!", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                email.SelectAll();
                email.Focus();
            }
            else if (login.Text.Trim() == "")
            {
                MessageBox.Show("O campo LOGIN deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                login.Focus();
            }
            else if ((login.Text.Length < 6) || (login.Text.Length > 10))
            {
                MessageBox.Show("O login deve ter entre 6 e 10 dígitos");
                login.Focus();
            }
            else if (senha.Text.Trim() == "")
            {
                MessageBox.Show("O campo SENHA deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                senha.Focus();
            }
            else if ((senha.Text.Length < 5) || (senha.Text.Length > 15))
            {
                MessageBox.Show("A senha deve ter entre 5 e 15 dígitos");
                senha.Focus();
            }
            else if (confsenha.Text.Trim() == "")
            {
                MessageBox.Show("O campo REPETIR SENHA deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                confsenha.Focus();
            }
            else if (senha.Text != confsenha.Text)
            {
                MessageBox.Show("As senhas não são iguais!", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                confsenha.Focus();
            }
            else if (pergunta.Text.Trim() == "")
            {
                MessageBox.Show("Você deve escolher uma pergunta", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                pergunta.Focus();
            }
            else if (resposta.Text.Trim() == "")
            {
                MessageBox.Show("O campo RESPOSTA deve ser preenchido", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                resposta.Focus();
            }
            else
            {
                userDBTableAdapter uta = new userDBTableAdapter();
                uta.Insert(int.Parse(login.Text.ToString()), nome.Text, senha.Text, int.Parse(pergunta.SelectedValue.ToString()), resposta.Text, imgbox.Image, email.Text);
                MessageBox.Show("Usuário Registrado com sucesso!", "Ficha de Anamnese - Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void btn_limpar_Click(object sender, EventArgs e)
        {
            Limpar();
        }

        private void imgbox_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                imgpath.Text = openFileDialog1.FileName;
                imgbox.ImageLocation = openFileDialog1.FileName;
                //Read Image File into Image object.
                Image img = Image.FromFile(imgbox.ImageLocation);
                //ImageConverter Class convert Image object to Byte array.
                byte[] bytes = (byte[])(new ImageConverter()).ConvertTo(img, typeof(byte[]));
            }
        }

        private void login_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) && e.KeyChar != 08 && e.KeyChar != (char)Keys.Delete)
            {
               e.Handled = true;
               MessageBox.Show("O campo LOGIN só aceita números.", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}
    
asked by anonymous 04.01.2018 / 03:05

1 answer

1

Henry, this is not a mistake. The exception is purposely just to indicate that your program is not complete.

internal void Insert(int p, string p_2, string p_3, int p_4, string p_5, System.Drawing.Image image, string p_6)
{
    throw new System.NotImplementedException();
}

This is a method that seems very much to have been generated automatically and you need to implement your logic. Or it might be a feature not implemented in any library you are using. (It is more likely to be the first option)

    
04.01.2018 / 03:24