public static String EXPEDIENTE_RECETAS_MAX_ID() { String Max = "0"; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append(" SELECT MAX(ID) FROM expedientes_recetas;"); OperacionBD oOperacion = new OperacionBD(); try { DataTable Aux = oOperacion.Consultar(Sentencia.ToString()); if (Aux != null) { Max = Aux.Rows[Aux.Rows.Count - 1][0].ToString(); return(Max); } else { return(Max); } } catch { return(Max); } }
//ACTUALIZAR public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE especialidades SET"); Sentencia.Append(" especialidad = '" + this.Especildad + "'"); Sentencia.Append("WHERE IDespecialidad = " + this.IDEspecialidad + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
//ELIMINAR public Boolean Eliminar() { Boolean Eliminado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("DELETE FROM empleados"); Sentencia.Append(" WHERE IDEmpleado = " + this.IDEmpleado + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Eliminar(Sentencia.ToString()) > 0) { Eliminado = true; } else { Eliminado = false; } } catch { Eliminado = false; } return(Eliminado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE usuarios SET "); Sentencia.Append("IDEmpleado = '" + this.IDEmpleado + "',"); Sentencia.Append("IDGrupo = '" + this.IDGrupo + "',"); Sentencia.Append("Usuario = '" + this.Usuario + "',"); Sentencia.Append("Credencial= '" + this.Credencial + "'"); Sentencia.Append("WHERE IDUsuario = " + this.IDUsuario + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
/*MEDTODO GUARDAR ,ACTUALIZAR,ELIMINAR*/ public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO medicinas(Medicamento,Concentrado,Forma,Via,Estado) VALUES("); Sentencia.Append("'" + this.Medicamento + "', "); Sentencia.Append("'" + this.Concentrado + "', "); Sentencia.Append("'" + this.Forma + "', "); Sentencia.Append("'" + this.Via + "', "); Sentencia.Append("'" + this.Estado + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO doctores(IDEmpleado,IDEspecialidad,Turno) VALUES("); Sentencia.Append("'" + this.IDEMpleado + "',"); Sentencia.Append("'" + this.IDEspecialidad + "',"); Sentencia.Append("'" + this.Turno + "');"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO existencias(IDMedicina,Unidad,Cantidad) VALUES("); Sentencia.Append("'" + this.IDMedicina + "', "); Sentencia.Append("'" + this.Unidad + "', "); Sentencia.Append("'" + this.Cantidad + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO permisos(IDGrupo,IDOpcion,FechaCreacion) VALUES("); Sentencia.Append("'" + this.IDGrupo + "', "); Sentencia.Append("'" + this.IDOpcion + "', "); Sentencia.Append("" + "NOW()" + "); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
//ACTUALIZAR public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE recetas_medicas SET"); Sentencia.Append(" IDDoctor = '" + this.IDDoctor + "'"); Sentencia.Append(" IDPaciente = '" + this.IDPaciente + "'"); Sentencia.Append(" IDMedicina= '" + this.IDMedicina + "'"); Sentencia.Append(" Dosis = '" + this.Dosis + "'"); Sentencia.Append("Cantidad = '" + this.Cantidad + "'"); Sentencia.Append("WHERE IDReceta = " + this.IDReceta + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE permisos SET "); Sentencia.Append("IDGrupo = '" + this.IDGrupo + "',"); Sentencia.Append("IDOpcion = '" + this.IDOpcion + "'"); Sentencia.Append("WHERE IDPermiso = " + this.IDPermiso + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO recetas_medicas(IDDoctor,IDPaciente,IDMedicina,Dosis,Cantidad) VALUES("); Sentencia.Append("'" + _IDDoctor + "', "); Sentencia.Append("'" + _IDPaciente + "',"); Sentencia.Append("'" + _IDMedicina + "',"); Sentencia.Append("'" + _Dosis + "',"); Sentencia.Append("'" + _Cantidad + "');"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE doctores SET"); Sentencia.Append(" IDEmpleado = '" + this.IDEMpleado + "',"); Sentencia.Append("IDEspecialidad = '" + this.IDEspecialidad + "',"); Sentencia.Append("Turno = '" + this.Turno + "'"); Sentencia.Append("WHERE IDDoctor = " + this.IDDoctor + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO expedientes_recetas(IDExpediente,IDReceta) VALUES("); Sentencia.Append("'" + this.IDExpediente + "', "); Sentencia.Append("'" + this.IDReceta + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
//ACTUALIZAR public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE responsable_paciente SET"); Sentencia.Append(" Nombres = '" + this.Nombres + "',"); Sentencia.Append("Apellidos = '" + this.Apellidos + "',"); Sentencia.Append("Parentesco = '" + this.Parentesco + "'"); Sentencia.Append("WHERE IDResponsable = " + this.IDResponsable + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public static String GRUPO_MAX_ID() { String Max = "0"; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append(" SELECT MAX(IDGrupo) FROM Grupos;"); OperacionBD oOperacion = new OperacionBD(); try { DataTable Aux = oOperacion.Consultar(Sentencia.ToString()); if (Aux != null) { Max = Aux.Rows[Aux.Rows.Count - 1][0].ToString(); return(Max); } else { return(Max); } } catch { return(Max); } }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE consultas SET "); Sentencia.Append("Tipo = '" + this.Tipo + "',"); Sentencia.Append("Detalles = '" + this.Detalles + "',"); Sentencia.Append("Estado = '" + this.Estado + "'"); Sentencia.Append("WHERE IDConsulta = " + this.IDConsulta + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO responsable_paciente(Nombres,Apellidos,Parentesco) VALUES("); Sentencia.Append("'" + this.Nombres + "', "); Sentencia.Append("'" + this.Apellidos + "', "); Sentencia.Append("'" + this.Parentesco + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDAT ficha_citas SET"); Sentencia.Append("IDPaciente = '" + this.IDPaciente + "',"); Sentencia.Append("IDDoctor = '" + this.IDDoctor + "',"); Sentencia.Append("IDConsulta = '" + this.IDConsulta + "',"); Sentencia.Append("FechaProxima = '" + this._FechaProxima + "',"); Sentencia.Append("WHERE IDCita = " + this.IDConsulta + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO consultas(Tipo,Detalles,Estado) VALUES("); Sentencia.Append("'" + this.Tipo + "', "); Sentencia.Append("'" + this.Detalles + "', "); Sentencia.Append("'" + this.Estado + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append(" UPDATE existencias SET "); Sentencia.Append("IDMedicina = '" + this.IDMedicina + "',"); Sentencia.Append("Unidad = '" + this.Unidad + "',"); Sentencia.Append("Cantidad = '" + this.Cantidad + "'"); Sentencia.Append("WHERE IDExistencia = " + this.IDExistencia + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO ficha_citas(IDPaciente,IDDoctor,IDConsulta,FechaProxima) VALUES("); Sentencia.Append("'" + this.IDPaciente + "', "); Sentencia.Append("'" + this.IDDoctor + "', "); Sentencia.Append("'" + this.IDConsulta + "', "); Sentencia.Append("'" + this.FechaProxima + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
//ACTUALIZAR public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE opciones SET"); Sentencia.Append(" Opcion = '" + this.Opcion + "',"); Sentencia.Append(" Categoria = '" + this.Categoria + "'"); Sentencia.Append("WHERE IDOpcion = " + this.IDOpcion + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDAT expedientes_recetas SET "); Sentencia.Append("IDExpediente = '" + this.IDExpediente + "',"); Sentencia.Append("IDReceta = '" + this.IDReceta + "'"); Sentencia.Append("WHERE ID = " + this.ID + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Actualizar() { Boolean Actualizado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("UPDATE medicinas SET "); Sentencia.Append("Medicamento = '" + this.Medicamento + "',"); Sentencia.Append("Concentrado = '" + this.Concentrado + "',"); Sentencia.Append("Forma = '" + this.Forma + "',"); Sentencia.Append("Via= '" + this.Via + "',"); Sentencia.Append("Estado = '" + this.Estado + "'"); Sentencia.Append("WHERE IDMedicina = " + this.IDMedicina + ";"); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Actualizar(Sentencia.ToString()) > 0) { Actualizado = true; } else { Actualizado = false; } } catch { Actualizado = false; } return(Actualizado); }
public Boolean Guardar() { Boolean Guardado = false; StringBuilder Sentencia = new StringBuilder(); Sentencia.Append("INSERT INTO especialidades(especialidad) VALUES("); Sentencia.Append("'" + this.Especildad + "'); "); OperacionBD oOperacion = new OperacionBD(); try { if (oOperacion.Insertar(Sentencia.ToString()) > 0) { Guardado = true; } else { Guardado = false; } } catch { Guardado = false; } return(Guardado); }
private void btnEjecutar_Click(object sender, EventArgs e) { OperacionBD objOperacion = new OperacionBD(); if (objOperacion.Insertar(txbSentencia.Text) > 0) { MessageBox.Show("Insertardo"); } else { MessageBox.Show("Falló"); } }
/**************************************************************************************************************+*/ public static DataTable Todos_los_Empleados() { DataTable Datos = new DataTable(); String Consulta; Consulta = "SELECT IDempleado,Nombres,Apellidos,Sexo,DUI,NIT,ISSS,NUP,Telefono,Domicilio,Departamento,Municipio,Estado,FechaCreacion FROM empleados ORDER BY Nombres ASC;"; OperacionBD oOperacion = new OperacionBD(); try { Datos = oOperacion.Consultar(Consulta); } catch { Datos = new DataTable(); } return(Datos); }
public static DataTable TODAS_FECHAS_CITAS() { DataTable Datos = new DataTable(); String Consulta; Consulta = "SELECT IDCita,IDPaciente,IDDoctor,IDConsulta,FechaProxima FROM ficha_citas ORDER BY IDCita;"; OperacionBD oOperacion = new OperacionBD(); try { Datos = oOperacion.Consultar(Consulta); } catch { Datos = new DataTable(); } return(Datos); }
/************************************************************************************/ public static DataTable Todos_las_Especialidades() { DataTable Datos = new DataTable(); String Consulta; Consulta = "SELECT IDEspecialidad,especialidad FROM especialidades ORDER BY especialidad ASC;"; OperacionBD oOperacion = new OperacionBD(); try { Datos = oOperacion.Consultar(Consulta); } catch { Datos = new DataTable(); } return(Datos); }
public static DataTable TODO_LOS_GRUPOS() { DataTable Datos = new DataTable(); String Consulta; Consulta = "SELECT IDGrupo, Grupo, FechaCreacion FROM Grupos ORDER BY Grupo ASC;"; OperacionBD oOperacion = new OperacionBD(); try { Datos = oOperacion.Consultar(Consulta); } catch { Datos = new DataTable(); } return(Datos); }