예제 #1
0
        private void nuevoUsuario()
        {
            if (oDatos.siExiste("Users", "Usuario", txtUsuario.Text) == true || txtConfirmarPassword.Text != txtPassword.Text)
            {
                MessageBox.Show("El usuario ingresado ya existe, o las constraseñas no coinciden", "Datos Fallidos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtUsuario.Clear();
                txtPassword.Clear();
                txtConfirmarPassword.Clear();
                txtUsuario.Focus();
            }
            else
            {
                string str_sql = "INSERT INTO Users (Usuario, Password, id_perfil, Estado) values('"
                                 + txtUsuario.Text + "', '" + txtPassword.Text + "', '" + cmbPerfil.SelectedValue.ToString() + "','S')";

                if (oDatos.consultaSQL(str_sql) > 0)
                {
                    MessageBox.Show("Usuario agregado", "Nuevo Usuario", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                }

                lstUsuario.ResetText();
                deshabilitarCampos();
                newu                 = false;
                btnNuevo.Enabled     = true;
                btnModificar.Enabled = true;
            }
        }
        public bool actualizarPaciente(clsPaciente paci)
        {
            string str_sql = "UPDATE Pacientes SET";

            str_sql += "n_HistorialClinico=" + paci.historiaClinica.ToString();
            str_sql += ", Nombre='" + paci.nombre + "'";
            str_sql += ", Apellido='" + paci.apellido + "'";
            str_sql += ", Fecha_Nacimiento =" + paci.nacimiento.ToString();
            str_sql += ", id_obrasocial='" + paci.obra_Social + "'";
            str_sql += ", n_Afiliado=" + paci.nro_Afiliado;
            str_sql += ", Domicilio='" + paci.domicilio + "'";
            str_sql += ", Telefono=" + paci.telefono.ToString();
            str_sql += " WHERE dni=" + paci.dni.ToString();
            return(helper.consultaSQL(str_sql) == 1);
        }
        public bool agregarMedicamento(clsMedicamento medicine)
        {
            string sql = "Insert into Medicamentos (monodroga, farmaco, laboratorio) "
                         + "values ('" + medicine.Monodroga + "', '" + medicine.Farmaco + "', '" + medicine.Laboratorio + "')";

            return(helper.consultaSQL(sql) == 1);
        }
예제 #4
0
        private void nuevoMedico()
        {
            string sql = "INSERT INTO Medicos (Nombre, Apellido, Fecha_Ingreso, Estado) values ('" +
                         txtNombre.Text + "','" +
                         txtApellido.Text + "', '" +
                         dtpFecha.Value.ToString("yyyyMMdd") + "', 'S')";

            if (helper.consultaSQL(sql) > 0)
            {
                MessageBox.Show("Medico agregado", "Nuevo Medico", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }

            txtNombre.ResetText();
            txtApellido.ResetText();
            dtpFecha.ResetText();
            deshabilitarCampos();
            btnEliminar.Enabled  = true;
            btnModificar.Enabled = true;
            newm = false;
        }
예제 #5
0
        public bool agregarHistorial(clsHistorialClinico histo)
        {
            string str_sql = "INSERT INTO Historias_Clinicas (Nombre,Apellido,dni) VALUES ('" + histo.nombre + "','" + histo.apellido + "'," + histo.dni.ToString() + ")";

            return(helper.consultaSQL(str_sql) == 1);
        }
        public bool AgregarUsu(clsUsuario usu)
        {
            string str_sql = "INSERT INTO Users (Usuario,Password,id_perfil,Estado) VALUES ('" + usu.Usuarios + "','" + usu.Password + "'," + usu.id_perfil.ToString() + ",'" + usu.Estado + "')";

            return(helper.consultaSQL(str_sql) == 1);
        }