Пример #1
0
        public frmTurno()
        {
            InitializeComponent();
            this.calendar1.TimeUnitsOffset = -16;
            Doctor objDoctor = new Doctor();
            ArrayList colDoctor = new ArrayList();

            colDoctor = objDoctor.coleccion();

            if (Usuario.getFlag())
            {
                // EL USUARIO ES SECRETARIA

                for (int i = 0; i < colDoctor.Count; i++)
                {
                    objDoctor = (Doctor)colDoctor[i];
                    vOutlookItem tab = new vOutlookItem();
                    tab.Text = objDoctor.getMatricula();
                    tab.HeaderText = objDoctor.getApellido();
                    tab.Click += new EventHandler(this.tab_Click);
                    this.vOutlookNavPane1.Items.Add(tab);
                }
            }
            else if (Usuario.getAdmin())
            {
                // EL USUARIO ES ADMINISTRADOR
                for (int i = 0; i < colDoctor.Count; i++)
                {
                    objDoctor = (Doctor)colDoctor[i];
                    vOutlookItem tab = new vOutlookItem();
                    tab.Text = objDoctor.getMatricula();
                    tab.HeaderText = objDoctor.getApellido();
                    tab.Click += new EventHandler(this.tab_Click);
                    this.vOutlookNavPane1.Items.Add(tab);
                }
            }
            else
            {
                // EL USUARIO ES DOCTOR

                for (int i = 0; i < colDoctor.Count; i++)
                {
                    objDoctor = (Doctor)colDoctor[i];
                    if (objDoctor.getMatricula() == Usuario.getMatricula())
                    {
                        vOutlookItem tab = new vOutlookItem();
                        tab.Text = objDoctor.getMatricula();
                        tab.HeaderText = objDoctor.getApellido();
                        tab.Click += new EventHandler(this.tab_Click);
                        this.vOutlookNavPane1.Items.Add(tab);
                        break;
                    }
                }

            }
        }
Пример #2
0
        private void llenarComboDoctor()
        {
            ArrayList colDoctor = new ArrayList();
            Doctor objDoctor = objDoctor = new Doctor();

            colDoctor = objDoctor.coleccion();
            this.comboDoctor.Items.Clear();

            for (int i = 0; i < colDoctor.Count; i++)
            {
                objDoctor = (Doctor)colDoctor[i];
                this.comboDoctor.Items.Add(objDoctor.getApellido());
            }
        }
Пример #3
0
        private string comprobarDoctor()
        {
            Doctor objDoctor = new Doctor();
            ArrayList colDoctor = new ArrayList();
            colDoctor = objDoctor.coleccion();

            for (int i = 0; i < colDoctor.Count; i++)
            {
                if (this.comboDoctor.Text == ((Doctor)colDoctor[i]).getApellido())
                {
                    objDoctor = (Doctor)colDoctor[i];
                    break;
                }
            }
            return objDoctor.getMatricula();
        }