Beispiel #1
0
        public List <MODELO.HORARIO_MEDICO> Obtener_Horas_Medicos(MODELO.MEDICO MEDICO)
        {
            var lista = from horas in oCATALOGO.HORARIOS_MEDICOS
                        where horas.MEDICO.DNI == MEDICO.DNI
                        select horas;

            return((List <MODELO.HORARIO_MEDICO>)lista.ToList());
        }
        public FrmDIASNOLABORABLESMEDICO(MODELO.DIA_NO_LABORABLE_MEDICO miDIA, string miACCION, MODELO.MEDICO miMEDICO)
        {
            InitializeComponent();
            cMEDICOS = CONTROLADORA.cMEDICOS.Obtener_Instancia();

            ACCION  = miACCION;
            oMEDICO = miMEDICO;
            oDIANOLABORABLEMEDICO = miDIA;
        }
        private void Buscar_Turno()
        {
            List <MODELO.TURNO> oListaTurnos;

            MODELO.MEDICO oMEDICO = (MODELO.MEDICO)cmbMedicos.SelectedItem;
            oListaTurnos = cTURNOS.Buscar_Turnos(mcFecha.SelectionStart, oMEDICO);

            ACTUALIZAR_GRILLA(oListaTurnos);
        }
Beispiel #4
0
        public FrmHORARIOMEDICO(MODELO.HORARIO_MEDICO miHORARIOMEDICO, string miACCION, MODELO.MEDICO miMEDICO)
        {
            InitializeComponent();
            cMEDICOS = CONTROLADORA.cMEDICOS.Obtener_Instancia();

            ACCION         = miACCION;
            oMEDICO        = miMEDICO;
            oHORARIOMEDICO = miHORARIOMEDICO;

            if (ACCION != "A")
            {
                txtDia.Text         = oHORARIOMEDICO.Dia;
                mtxtHoraInicio.Text = oHORARIOMEDICO.Hora_Inicio;
                mtxtHoraFin.Text    = oHORARIOMEDICO.Hora_Fin;
            }
        }
        public FrmCONFIGMEDICO(MODELO.MEDICO miMEDICO)
        {
            InitializeComponent();
            cTURNOS  = CONTROLADORA.cTURNOS.Obtener_Instancia();
            cMEDICOS = CONTROLADORA.cMEDICOS.Obtener_Instancia();
            oMEDICO  = miMEDICO;

            if (cTURNOS.Obtener_Horas_Medicos(oMEDICO).Count() > 0)
            {
                ARMAR_GRILLA();
            }

            if (cTURNOS.Obtener_Dias_No_Labotables_Medico(oMEDICO).Count > 0)
            {
                ARMAR_GRILLA2();
            }
        }
Beispiel #6
0
        public List <MODELO.TURNO> Buscar_Turnos(DateTime Fechaa, MODELO.MEDICO MEDICO)
        {
            oMedico = MEDICO;
            List <MODELO.TURNO>          oListaTurnos   = new List <MODELO.TURNO>();
            List <MODELO.HORARIO_MEDICO> oHorarioMedico = Obtener_Horas_Medicos(oMedico);
            int    TurnosMaximos;
            string DiaSeleccionado = ObtenerDiaDeLaSemana(Fechaa);
            string Hora_Inicio     = Convert.ToString(oHorarioMedico.First(x => x.Dia == DiaSeleccionado).Hora_Inicio);
            string Hora_Fin        = Convert.ToString(oHorarioMedico.First(x => x.Dia == DiaSeleccionado).Hora_Fin);

            Hora_Inicio   = Convert.ToString(Hora_Inicio.ElementAt(0)) + Convert.ToString(Hora_Inicio.ElementAt(1)) + Convert.ToString(Hora_Inicio.ElementAt(3)) + Convert.ToString(Hora_Inicio.ElementAt(4));
            Hora_Fin      = Convert.ToString(Hora_Fin.ElementAt(0)) + Convert.ToString(Hora_Fin.ElementAt(1)) + Convert.ToString(Hora_Fin.ElementAt(3)) + Convert.ToString(Hora_Fin.ElementAt(4));
            TurnosMaximos = Convert.ToInt32(Hora_Fin) - Convert.ToInt32(Hora_Inicio);
            TurnosMaximos = (TurnosMaximos / 100) * 60;
            TurnosMaximos = TurnosMaximos / oMedico.Tiempo_Por_Paciente;
            string Fecha = Fechaa.ToString();

            Fecha = Fecha.Remove(10);
            Fecha = Fecha + " " + oHorarioMedico.First(x => x.Dia == DiaSeleccionado).Hora_Inicio;
            //------Prototype-------//
            MODELO.TURNO oTurno;
            oTurno        = new MODELO.TURNO();
            oTurno.Fecha  = Convert.ToDateTime(Fecha);
            oTurno.Estado = "Libre";
            //----------------------//
            for (int x = 0; x <= TurnosMaximos; x++)
            {
                oTurno.Estado = "Libre";
                List <MODELO.TURNO> oListaTurnosRegistrados = CONTROLADORA.cTURNOS.Obtener_Instancia().Recuperar_Turnos(Convert.ToDateTime(Fecha), oMedico.Nombre);
                if (oListaTurnosRegistrados.Exists(y => y.Fecha == oTurno.Fecha && y.Estado != "Anulado"))
                {
                    oListaTurnos.Add(oListaTurnosRegistrados.First(y => y.Fecha == oTurno.Fecha && y.Estado != "Anulado"));
                }
                else
                {
                    oListaTurnos.Add(oTurno);
                }
                oTurno       = (MODELO.TURNO)oTurno.Clone();                         //ACA LO CLONA
                oTurno.Fecha = oTurno.Fecha.AddMinutes(oMedico.Tiempo_Por_Paciente); //PASA AL HORARIO SIGUIENTE
                Fecha        = oTurno.Fecha.ToString();
            }
            return(oListaTurnos);
        }
Beispiel #7
0
        public List <DateTime> Armar_Calendario(MODELO.MEDICO MEDICO, DateTime Fecha)
        {
            oMedico = MEDICO;
            List <DateTime> Fechas = new List <DateTime>();
            List <MODELO.DIAS_NO_LABORABLES> oDiasNoLaborables = obtener_diasnolaborables();

            oMedico.DIA_NO_LABORABLE_MEDICO = Obtener_Dias_No_Labotables_Medico(oMedico);
            oMedico.HORARIO_MEDICO          = Obtener_Horas_Medicos(oMedico);
            oDatos_Empresa = new MODELO.DATOS_EMPRESA();
            oDatos_Empresa.DIAS_EMPRESA = obtener_diasempresa();
            for (int x = 0; x <= oDiasNoLaborables.Count - 1; x++)
            {
                if (oDiasNoLaborables.ElementAt(x).Fecha.Month == Fecha.Month)
                {
                    Fechas.Add(oDiasNoLaborables.ElementAt(x).Fecha);
                }
            }
            for (int x = 0; x <= oMedico.DIA_NO_LABORABLE_MEDICO.Count - 1; x++)
            {
                if (oMedico.DIA_NO_LABORABLE_MEDICO.ElementAt(x).Fecha.Month == Fecha.Month)
                {
                    Fechas.Add(oMedico.DIA_NO_LABORABLE_MEDICO.ElementAt(x).Fecha);
                }
            }
            for (int i = 1; i <= DateTime.DaysInMonth(Fecha.Year, Fecha.Month); i++)
            {
                DateTime FechaMes = Convert.ToDateTime(i + "/" + Fecha.Month + "/" + Fecha.Year);
                List <MODELO.HORARIO_MEDICO> horariomedico = Obtener_Horas_Medicos(oMedico);
                List <MODELO.DIAS_EMPRESA>   diasempresa   = obtener_diasempresa();
                if (!diasempresa.Exists(x => x.Dia == ObtenerDiaDeLaSemana(FechaMes)))
                {
                    Fechas.Add(FechaMes);
                }
                else
                if (!horariomedico.Exists(x => x.Dia == ObtenerDiaDeLaSemana(FechaMes)))
                {
                    Fechas.Add(FechaMes);
                }
            }
            return(Fechas);
        }
Beispiel #8
0
        public FrmMEDICO(MODELO.MEDICO miMEDICO, string miACCION)
        {
            InitializeComponent();

            cMEDICOS = CONTROLADORA.cMEDICOS.Obtener_Instancia();
            oMEDICO  = miMEDICO;
            ACCION   = miACCION;

            if (ACCION != "A")
            {
                txtNombre_Medico.Text       = oMEDICO.Nombre;
                txtEmail_Medico.Text        = oMEDICO.Email;
                txtEspecialidad_Medico.Text = oMEDICO.Especialidad;
                mtxtDNI_Medico.Text         = oMEDICO.DNI.ToString();
                mtxtTel_Medico.Text         = oMEDICO.Telefono.ToString();
                txtMatricula_Medico.Text    = oMEDICO.Matricula.ToString();
                txtTiempo_Por_Paciente.Text = oMEDICO.Tiempo_Por_Paciente.ToString();
                if (oMEDICO.Estado == true)
                {
                    chkActivo.Checked = true;
                }
                else
                {
                    chkActivo.Checked = false;
                }

                if (ACCION == "C")
                {
                    btnGuardar_Medico.Visible      = false;
                    btnCancelar.Text               = "CERRAR";
                    txtEmail_Medico.Enabled        = false;
                    txtEspecialidad_Medico.Enabled = false;
                    txtMatricula_Medico.Enabled    = false;
                    txtNombre_Medico.Enabled       = false;
                    txtTiempo_Por_Paciente.Enabled = false;
                    mtxtDNI_Medico.Enabled         = false;
                    mtxtTel_Medico.Enabled         = false;
                    chkActivo.Enabled              = false;
                }
            }
        }
        private void ACTUALIZAR_GRILLA(List <MODELO.TURNO> oListaTurnos)
        {
            DGVTurnos.DataSource         = null;
            DGVTurnos.DataSource         = oListaTurnos;
            DGVTurnos.Columns[0].Visible = false;
            DGVTurnos.Columns[3].Visible = false;
            MODELO.MEDICO oMedico = (MODELO.MEDICO)cmbMedicos.SelectedItem;
            for (int x = 0; x <= oListaTurnos.Count - 1; x++)
            {
                DGVTurnos.Rows[x].HeaderCell.Value = oListaTurnos.ElementAt(x).Fecha.ToString().Remove(0, 10);
            }

            DGVTurnos.Columns[5].DisplayIndex = 3;
            DGVTurnos.Columns[4].DisplayIndex = 6;
            DGVTurnos.Columns[2].DisplayIndex = 1;
            DGVTurnos.Columns[1].DisplayIndex = 2;

            DGVTurnos.Columns[2].HeaderText = "FECHA";
            DGVTurnos.Columns[1].HeaderText = "ESTADO";
            DGVTurnos.Columns[4].HeaderText = "CONCURRIÓ";
        }
Beispiel #10
0
        public List <MODELO.DIA_NO_LABORABLE_MEDICO> Obtener_Dias_No_Labotables_Medico(MODELO.MEDICO MEDICO)
        {
            var lista = from dias in oCATALOGO.DIAS_NO_LABORABLES_MEDICOS
                        where dias.MEDICO.DNI == MEDICO.DNI
                        select dias;

            return((List <MODELO.DIA_NO_LABORABLE_MEDICO>)lista.ToList());
        }
Beispiel #11
0
 public void Modificar_Medico(MODELO.MEDICO oMedico)
 {
     oCATALOGO.Entry(oMedico).State = System.Data.Entity.EntityState.Modified;
     oCATALOGO.SaveChanges();
 }
Beispiel #12
0
 public void Agregar_Medico(MODELO.MEDICO oMedico)
 {
     oCATALOGO.MEDICOS.Add(oMedico);
     oCATALOGO.SaveChanges();
 }