コード例 #1
0
ファイル: frmTurno.cs プロジェクト: gaboblanch/sistema_taller
        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
ファイル: frmTurno.cs プロジェクト: gaboblanch/sistema_taller
        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();
        }