Beispiel #1
0
        private void CargarHorarios()
        {
            DataTable TurnosOcupados    = new DataTable();
            DataTable TurnosDisponibles = new DataTable();



            if (Cod_Afiliado == -1)
            {
                Cod_Afiliado = elAfiliado.Cod_Afiliado;
            }

            this.comboBox_hora.Items.Clear();

            TurnosDisponibles = SQL_Methods.Profesional_ListarTurnosDisponibles(Matricula, this.Combo_fecha.Value);

            foreach (DataRow Row in TurnosDisponibles.Rows)
            {
                this.comboBox_hora.Items.Add(Row[0].ToString().Substring(0, 5));
            }

            TurnosOcupados = SQL_Methods.Afiliado_ListarTurnosOcupados(Cod_Afiliado, this.Combo_fecha.Value);

            foreach (DataRow Row in TurnosOcupados.Rows)
            {
                this.comboBox_hora.Items.Remove(Row[0].ToString().Substring(0, 5));
            }

            TurnosOcupados.Rows.Clear();

            TurnosOcupados = SQL_Methods.Profesional_ListarTurnosOcupados(Matricula, this.Combo_fecha.Value);

            foreach (DataRow Row in TurnosOcupados.Rows)
            {
                this.comboBox_hora.Items.Remove(Row[0].ToString().Substring(0, 5));
            }

            if (this.comboBox_hora.Items.Count == 0)
            {
                MessageBox.Show("No hay turnos disponibles");
                this.box_medico.Text = "";

                this.comboBox_hora.Visible = false;
                this.button_Clean.Visible  = false;
                this.button_save.Visible   = false;
            }
        }