Beispiel #1
0
 public frmHacerDiagnostico()
 {
     InitializeComponent();
     _tableName   = "Diagnostico";
     _idColName   = "ID_DIAGNOSTICO";
     basicService = new BasicService(_tableName, _idColName);
     SetDataList(basicService.MostrarTodo());
 }
Beispiel #2
0
        //Funciones
        private void agregar()
        {
            if (Validador())
            {
                string      cod         = txtCodigo.Text;
                string      diag        = txtDiagnostico.Text;
                int         sumaId      = basicService.GetUltimoID() + 1;
                Diagnostico diagnostico = new Diagnostico(sumaId.ToString(), int.Parse(cod), diag);

                string query = "INSERT INTO " + _tableName + " (" + _idColName + ", ID_PACIENTE1, DESCRIPCION_DIAGNOSTICO)"
                               + "VALUES ('" + diagnostico.Id + "','" + diagnostico.IdPaciente + "', '" + diagnostico.DiagnosticoFinal + "' )";

                if (basicService.Crear(query))
                {
                    SetDataList(basicService.MostrarTodo());
                }
            }
        }