public DataTable mostrarcitasdoc(Ucitas datos) { Udatatable datatable = new Udatatable(); DateTime thisDay = DateTime.Today; DataTable data = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); var cita = (from c in conect.Citas join p in conect.Usuarios/*tengo que preguntarle al profe no se porque join error*/ on c.PacienteId equals p.IdUsuario where (c.HoraInicio >= thisDay) && (c.HoraFin >= thisDay) && (c.Estado == 1) && (c.DoctorId == int.Parse(datos.Iddoctor)) orderby c.HoraInicio select new { c.HoraInicio, c.HoraFin, p.Nombre, p.Apellido, c.DoctorId, c.IdCita, }).ToList(); data = datatable.ToDataTable(cita); return(data); }
public void guarda_paciente(UUsuario datos) /*carga los datos del paciente en la base de datos*/ { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Usuario user = new Medicapp13Context.Usuario(); user.Username = datos.Username; user.Clave = datos.Clave; user.Nombre = datos.Nombre; user.Apellido = datos.Apellido; user.Edad = datos.Edad; user.TipoDeSangre = datos.Tipo_de_sangre; user.Correo = datos.Correo; user.Documento = datos.Documento; user.FechaDeUltimoExamen = Convert.ToDateTime(datos.Fechaexamen); user.Imagen = datos.Foto; conect.Usuarios.InsertOnSubmit(user); conect.SubmitChanges(); List <Medicapp13Context.Usuario> us = conect.Usuarios.Where(x => x.Username == datos.Username).ToList <Medicapp13Context.Usuario>(); DataTable data = new DataTable(); Udatatable datatable = new Udatatable(); data = datatable.ToDataTable(us); Medicapp13Context.Sessione sesion = new Medicapp13Context.Sessione(); sesion.Iduser = int.Parse(data.Rows[0]["IdUsuario"].ToString()); conect.Sessiones.InsertOnSubmit(sesion); conect.SubmitChanges(); }
public DataTable buscarcitasD(Ucitas datos) { DataTable datatable = new DataTable(); Udatatable data = new Udatatable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); var cita = (from c in conect.Citas join u in conect.Usuarios on c.DoctorId equals u.IdUsuario where (c.HoraInicio.Value.Date == datos.Fechacita.Date) && (c.Estado == 0) && (datos.Fechacita.Date > DateTime.Today) select new { c.IdCita, c.Tipo, u.Nombre, u.Apellido, c.HoraInicio, c.HoraFin }).ToList(); datatable = data.ToDataTable(cita); return(datatable); }
public DataTable mostrarcitasseparadas(Ucitas datos) { Udatatable data = new Udatatable(); DataTable datatable = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); DateTime hoy = DateTime.Today; DateTime masdos = hoy.AddDays(2); var citasseparadas = (from c in conect.Citas join u in conect.Usuarios on c.DoctorId equals u.IdUsuario where (c.PacienteId == datos.Idpaciente) && (c.Estado == 1) && (c.HoraInicio.Value.Date > masdos) select new { c.IdCita, c.Tipo, c.HoraInicio, c.HoraFin, c.Diagnostico, u.Nombre, u.Apellido }).ToList(); datatable = data.ToDataTable(citasseparadas); return(datatable); }
public void insertar_doctor(Udoctor data) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Usuario user = new Medicapp13Context.Usuario(); user.Username = data.Username; user.Clave = data.Clave; user.Nombre = data.Nombre; user.Apellido = data.Apellido; user.Edad = data.Edad; user.Especialidad = data.Especialidad; user.Estudios = data.Estudios; user.Estado = int.Parse(data.Estado); user.Correo = data.Correo; user.Documento = Convert.ToString(data.Documento); user.Imagen = data.Foto; conect.Usuarios.InsertOnSubmit(user); conect.SubmitChanges(); List <Medicapp13Context.Usuario> us = conect.Usuarios.Where(x => x.Username == data.Username).ToList <Medicapp13Context.Usuario>(); DataTable datat = new DataTable(); Udatatable datatable = new Udatatable(); datat = datatable.ToDataTable(us); Medicapp13Context.Sessione sesion = new Medicapp13Context.Sessione(); sesion.Iduser = int.Parse(datat.Rows[0]["IdUsuario"].ToString()); conect.Sessiones.InsertOnSubmit(sesion); conect.SubmitChanges(); }
public void cancelarCitaUsuario(Ucitas datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Cita cita = conect.Citas.Single(x => x.IdCita == int.Parse(datos.Idcita)); cita.PacienteId = 0; cita.Estado = 0; conect.SubmitChanges(); }
public void sacarCita(Ucitas datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Cita cita = conect.Citas.Single(x => x.IdCita == int.Parse(datos.Idcita)); cita.PacienteId = datos.Idpaciente; cita.Estado = 1; conect.SubmitChanges(); }
public void guardarmedicina(Umedicina datos) { Medicapp13Context.Medicapp13DataContext conec = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Medicina medicina = new Medicapp13Context.Medicina(); medicina.NombreMedicina = datos.Medicina; conec.Medicinas.InsertOnSubmit(medicina); conec.SubmitChanges(); }
public void editarhorario(Uhorario datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); conect.FModificarHorario(Convert.ToDateTime(datos.Inicio), Convert.ToDateTime(datos.Fin), datos.Horario, int.Parse(datos.Iddoctor)).ToString(); }
public void editarparametrizacion(Uparametrizacion datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Parametrizacion para = conect.Parametrizacions.Single(x => x.IdParemetrizacion == datos.Idparametriza); para.DuracionCitas = TimeSpan.Parse(datos.Duracion); para.HoraInicio = TimeSpan.Parse(datos.Inicio); para.HoraFin = TimeSpan.Parse(datos.Fin); conect.SubmitChanges(); }
public void guardaralergia(Ualergia datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Alergia alergia = new Medicapp13Context.Alergia(); alergia.NombreAlergia = datos.Alergias; conect.Alergias.InsertOnSubmit(alergia); conect.SubmitChanges(); }
public void guardarcita3(Ucitas datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); conect.FAddCitadoctor4(datos.Diagnostico, int.Parse(datos.Iddoctor), int.Parse(datos.Idcita), int.Parse(datos.Medicinas), int.Parse(datos.Dosis), datos.Fechafinmedicina).ToString(); }
public DataTable obtenerdoc(Udoctor datos) { Udatatable datatable = new Udatatable(); DataTable data = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.Usuario> user = conect.Usuarios.Where(x => x.IdUsuario == datos.Id_usuario).ToList <Medicapp13Context.Usuario>(); data = datatable.ToDataTable(user); return(data); }
public DataTable obtenerDoctores() { Udatatable data = new Udatatable(); DataTable doctores = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.Usuario> doctor = conect.Usuarios.Where(x => x.IdRol == 3 && x.Estado == 1).ToList <Medicapp13Context.Usuario>(); doctores = data.ToDataTable(doctor); return(doctores); }
public void guardarhorariodoc(Uhorario datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); DateTime inicio = Convert.ToDateTime(datos.Inicio); DateTime fin = Convert.ToDateTime(datos.Fin); conect.FGenerarHorario(inicio, fin, datos.Horario, int.Parse(datos.Iddoctor)).ToString(); }
public DataTable mostrarhorario(Uhorario datos) { DataTable data = new DataTable(); Udatatable datatable = new Udatatable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); var horario = conect.FBuscaHorario(int.Parse(datos.Iddoctor)).ToList(); data = datatable.ToDataTable(horario); return(data); }
public DataTable verificarCita(Ucitas datos) { DataTable datatable = new DataTable(); Udatatable data = new Udatatable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.VerificacitaView> cita = conect.FVerificarCita(int.Parse(datos.Idcita), datos.Idpaciente).ToList <Medicapp13Context.VerificacitaView>(); datatable = data.ToDataTable(cita); return(datatable); }
public DataTable verificarusuario(Udoctor datos) { DataTable data = new DataTable(); Udatatable datatable = new Udatatable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.Usuario> doc = conect.Usuarios.Where(x => x.Username == datos.Username).ToList <Medicapp13Context.Usuario>(); data = datatable.ToDataTable(doc); return(data); }
public DataTable mostrarparametrizacion() { DataTable parametriza = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Parametrizacion para = new Medicapp13Context.Parametrizacion(); List <Medicapp13Context.Parametrizacion> paramelis = conect.Parametrizacions.ToList <Medicapp13Context.Parametrizacion>(); Udatatable data = new Udatatable(); parametriza = data.ToDataTable(paramelis); return(parametriza); }
public DataTable allusuarios() { Udatatable data = new Udatatable(); DataTable user = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Usuario usuarios = new Medicapp13Context.Usuario(); List <Medicapp13Context.Usuario> users = conect.Usuarios.ToList <Medicapp13Context.Usuario>(); user = data.ToDataTable(users); return(user); }
public DataTable buscarUsuariosid(UUsuario datos) { Udatatable data = new Udatatable(); DataTable user = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Usuario usuario = new Medicapp13Context.Usuario(); List <Medicapp13Context.Usuario> userid = conect.Usuarios.Where(x => x.IdUsuario == datos.Id_usuario).ToList <Medicapp13Context.Usuario>(); user = data.ToDataTable(userid); return(user); }
public DataTable buscarhojavida(Uhojavida datos) { DataTable hv = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.HojaDeVida hojavida = new Medicapp13Context.HojaDeVida(); List <Medicapp13Context.HojaDeVida> hoja = conect.HojaDeVidas.Where(x => x.IdDoctor == int.Parse(datos.Id_doctor)).ToList <Medicapp13Context.HojaDeVida>(); Udatatable data = new Udatatable(); hv = data.ToDataTable(hoja); return(hv); }
public DataTable mostrarDoctoresPrincipal() //metodo para mostrar doctores en la pagina principal esto es para el datalist { Udatatable data = new Udatatable(); DataTable doctores = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.Usuario> doctor = conect.Usuarios.Where(x => x.IdRol == 3 && x.Estado == 1).ToList <Medicapp13Context.Usuario>(); doctores = data.ToDataTable(doctor); return(doctores); }
public DataTable login(UUsuario datos) { DataTable data = new DataTable(); Udatatable datatable = new Udatatable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); List <Medicapp13Context.UserLogginView> user = conect.FLoggin(datos.Username, datos.Clave, datos.Ip, datos.Mac).ToList <Medicapp13Context.UserLogginView>(); data = datatable.ToDataTable(user); conect.SubmitChanges(); return(data); }
public void modificarhojavida(Uhojavida datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.HojaDeVida hoja = conect.HojaDeVidas.Single(x => x.IdDoctor == int.Parse(datos.Id_doctor)); hoja.PerfilProfesional = datos.Perfil; hoja.Bachiller = datos.Bachiller; hoja.Universidad = datos.Universidad; hoja.OtrosEstudios = datos.Estudios; hoja.Fellows = datos.Fellows; hoja.Idiomas = datos.Idiomas; hoja.Experiencia = datos.Experiencia; conect.SubmitChanges(); }
public DataTable mostraralergiasAdmon() { DataTable alergias = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Alergia alergia = new Medicapp13Context.Alergia(); List <Medicapp13Context.Alergia> aler = conect.Alergias.ToList <Medicapp13Context.Alergia>(); Udatatable data = new Udatatable(); alergias = data.ToDataTable(aler); return(alergias); }
public DataTable mostrarHV(int id_doctor) /*metodo de victor que tengo que saber de que es porque nose y lo tenia en otra clase a la que no pertencia*/ { Udatatable data = new Udatatable(); DataTable hoja = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.HojaDeVida hojavida = new Medicapp13Context.HojaDeVida(); List <Medicapp13Context.HojaDeVida> hv = conect.HojaDeVidas.Where(x => x.IdDoctor == id_doctor).ToList <Medicapp13Context.HojaDeVida>(); hoja = data.ToDataTable(hv); return(hoja); }
public DataTable verificarusuario(UUsuario encap) /* verifica que no exista el nombre de usuario en base de datos para que no s e presenten problemas de usernames duplicadod*/ { Udatatable data = new Udatatable(); DataTable verifica = new DataTable(); Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Usuario user = new Medicapp13Context.Usuario(); List <Medicapp13Context.Usuario> usuario = conect.Usuarios.Where(x => x.Username == encap.Username).ToList <Medicapp13Context.Usuario>(); verifica = data.ToDataTable(usuario); return(verifica); }
public void guardacita(Ucitas datos) { Medicapp13Context.Medicapp13DataContext conect = new Medicapp13Context.Medicapp13DataContext(); conect.FAddCitadoctor3(datos.Diagnostico, int.Parse(datos.Iddoctor), int.Parse(datos.Idcita), datos.Cirugia, datos.Descripcioncirugia, datos.Fechacirugia, int.Parse(datos.Medicinas), int.Parse(datos.Dosis), datos.Fechafinmedicina).ToString(); }
public DataTable mostrarmedicinas() { DataTable medicina = new DataTable(); Medicapp13Context.Medicapp13DataContext conec = new Medicapp13Context.Medicapp13DataContext(); Medicapp13Context.Medicina medicinas = new Medicapp13Context.Medicina(); List <Medicapp13Context.Medicina> med = conec.Medicinas.ToList <Medicapp13Context.Medicina>(); Udatatable data = new Udatatable(); medicina = data.ToDataTable(med); return(medicina); }