コード例 #1
0
 private void AddLigneForm_Load(object sender, EventArgs e)
 {
     if (ligne.Id == 0)
     {
         txtNumero.Text = LigneDao.generateKey();
     }
 }
コード例 #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Form2Model();
     LigneDao.save(ligne);
     Vider();
     txtNumero.Text = LigneDao.generateKey();
 }
コード例 #3
0
 public void Form2Model()
 {
     point.Numero      = txtNumero.Text;
     point.coordonnee  = txtCoord.Text;
     point.Description = txtDescrip.Text;
     point.Etat        = cbEtat.Text;
     point.ligne       = LigneDao.findByNumero(cbLigne.Text);
 }
コード例 #4
0
 public void Form2Model()
 {
     affecter.Numero    = txtNumero.Text;
     affecter.DateDebut = cbDateD.Value;
     affecter.DateFin   = cbDateF.Value;
     affecter.bus       = BusDao.findByNumero(cbBus.Text);
     affecter.ligne     = LigneDao.findByNumero(cbLigne.Text);
 }
コード例 #5
0
        public void DataLigneload()
        {
            List <Ligne> Buss = LigneDao.findAll();

            foreach (Ligne ligne in Buss)
            {
                cbLigne.Items.Add(ligne.Numero);
            }
        }
コード例 #6
0
ファイル: LigneForm.cs プロジェクト: phantom1999/busbaf
        private void dgLigne_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            for (int i = 0; i < dgLigne.RowCount; i++)
            {
                if ((bool)dgLigne.Rows[i].Selected)
                {
                    AddLigneForm alf   = new AddLigneForm();
                    Ligne        ligne = LigneDao.findByNumero(dgLigne.Rows[i].Cells[0].Value.ToString());
                    alf.Model2Form(ligne);

                    alf.ShowDialog();
                }
            }
        }
コード例 #7
0
ファイル: LigneForm.cs プロジェクト: phantom1999/busbaf
        public void DataLignesload()
        {
            List <Ligne> Buss = LigneDao.findAll();
            int          i    = 0;

            dgLigne.Rows.Clear();
            foreach (Ligne ligne in Buss)
            {
                dgLigne.Rows.Add();
                dgLigne.Rows[i].Cells[0].Value = ligne.Numero;
                dgLigne.Rows[i].Cells[1].Value = ligne.Description;
                dgLigne.Rows[i].Cells[2].Value = ligne.Etat;
                dgLigne.Rows[i].Cells[3].Value = ligne.Distance;
                dgLigne.Rows[i].Cells[4].Value = ligne.PointD;
                dgLigne.Rows[i].Cells[5].Value = ligne.PointF;
                i++;
            }
        }
コード例 #8
0
ファイル: LigneForm.cs プロジェクト: phantom1999/busbaf
        private void txtRech_TextChanged(object sender, EventArgs e)
        {
            List <Ligne> Buss = LigneDao.findby(cbTab.Text, txtRech.Text);
            int          i    = 0;

            dgLigne.Rows.Clear();
            foreach (Ligne ligne in Buss)
            {
                dgLigne.Rows.Add();
                dgLigne.Rows[i].Cells[0].Value = ligne.Numero;
                dgLigne.Rows[i].Cells[1].Value = ligne.Description;
                dgLigne.Rows[i].Cells[2].Value = ligne.Etat;
                dgLigne.Rows[i].Cells[3].Value = ligne.Distance;
                dgLigne.Rows[i].Cells[4].Value = ligne.PointD;
                dgLigne.Rows[i].Cells[5].Value = ligne.PointF;
                i++;
            }
        }
コード例 #9
0
        public void loadCombo()
        {
            List <Bus> buss = BusDao.findAll();

            cbBus.Items.Clear();
            foreach (Bus bus in buss)
            {
                cbBus.Items.Add(bus.Numero);
            }

            List <Ligne> chaus = LigneDao.findAll();

            cbLigne.Items.Clear();
            foreach (Ligne chau in chaus)
            {
                cbLigne.Items.Add(chau.Numero);
            }
        }
コード例 #10
0
ファイル: LigneForm.cs プロジェクト: phantom1999/busbaf
        private void btnChance_Click(object sender, EventArgs e)
        {
            if (DroitDao.findDroit(administrateur.Numero, "Ligne", "Modifier"))
            {
                for (int i = 0; i < dgLigne.RowCount; i++)
                {
                    if ((bool)dgLigne.Rows[i].Selected)
                    {
                        AddLigneForm alf   = new AddLigneForm();
                        Ligne        ligne = LigneDao.findByNumero(dgLigne.Rows[i].Cells[0].Value.ToString());
                        alf.Model2Form(ligne);

                        alf.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show("Vous n\'avez pas ce droit");
            }
        }