Esempio n. 1
0
        public FicheVisu(int nodeToLoad)
        {
            InitializeComponent();

            idToUpdate = nodeToLoad;

            String desc = "";

            Fiche myfiche = new Fiche();

            myfiche = fctn.fnSelection(nodeToLoad);

            this.lblCassette.Text = myfiche.Cassette;
            this.lblDate.Text     = myfiche.Date;
            this.lblTheme1.Text   = myfiche.Theme1 + " - " + myfiche.Theme2;
            desc = myfiche.Lieu + "\n\n" + myfiche.Personne + "\n\n" + "Description : \n - " + myfiche.Description.Replace(" - ", "\n - ");
            this.lblDescription.Text   = desc;
            this.lblLienVideo.Text     = myfiche.LienVideo;
            this.lblDebutSequence.Text = myfiche.TempsDebutSequence;

            if (File.Exists(gfctn.AppDrive() + myfiche.LienVideo.Replace("\\", "/")))
            {
                this.btnVideo.Enabled = true;
            }
            else
            {
                this.btnVideo.Enabled = false;
            }
        }
Esempio n. 2
0
        /// Selectionner une seule fiche en fonction de son Id
        public Fiche fnSelection(int nodeToLoad)
        {
            Fiche     myFiche = new Fiche();
            String    myDB    = gfctn.selectionDatabase();
            XDocument xmlDoc  = XDocument.Load(gfctn.AppRootPath() + "Reperto/BasesDeDonnees/" + myDB);
            XElement  collec  = xmlDoc.Element("root").Element("fiches");

            var records = from myCollection in collec.Elements("myFiche")
                          where (int)myCollection.Element("id") == nodeToLoad
                          select myCollection;

            foreach (var myData in records)
            {
                myFiche.Id                 = myData.Element("id").Value;
                myFiche.Cassette           = myData.Element("cassette").Value;
                myFiche.Date               = myData.Element("date").Value;
                myFiche.Theme1             = myData.Element("theme1").Value;
                myFiche.Theme2             = myData.Element("theme2").Value;
                myFiche.Personne           = myData.Element("personne").Value;
                myFiche.Lieu               = myData.Element("lieu").Value;
                myFiche.Description        = myData.Element("description").Value;
                myFiche.LienVideo          = myData.Element("lienVideo").Value;
                myFiche.TempsDebutSequence = myData.Element("tempsDebutSequence").Value;
            }

            return(myFiche);
        }
Esempio n. 3
0
        // Bouton dupliquer
        private void btnDupliquer_Click(object sender, EventArgs e)
        {
            if (this.dgvListeFiches.CurrentRow == null)
            {
                MessageBox.Show("Veuillez sélectionner une ligne!");
            }
            else
            {
                Fiche  myFiche    = new Fiche();
                string idToSelect = "";
                myFiche = fctn.fnSelection(Convert.ToInt32(this.dgvListeFiches.CurrentRow.Cells["colId"].Value.ToString()));

                idToSelect = fctn.fnCreationFiche(myFiche.Cassette, myFiche.Date, myFiche.Theme1, myFiche.Theme2, myFiche.Personne, myFiche.Lieu, myFiche.Description, myFiche.LienVideo, myFiche.TempsDebutSequence);
                FillDatagridview(idToSelect, txtRechCassette.Text, cbxMois.Text, txtAnnee.Text, cbxTheme1.Text, cbxTheme2.Text, txtPersonne.Text, txtLieu.Text, txtMotCle.Text);
            }
        }
Esempio n. 4
0
        public FormulaireFiche(int nodeToLoad)
        {
            InitializeComponent();
            InitializeThemeComboBox();

            idToUpdate = nodeToLoad;

            Fiche myfiche = new Fiche();

            myfiche = fctn.fnSelection(nodeToLoad);

            this.txtCassette.Text      = myfiche.Cassette;
            this.mtxDate.Text          = myfiche.Date;
            this.cbxTheme1.Text        = myfiche.Theme1;
            this.cbxTheme2.Text        = myfiche.Theme2;
            this.txtPersonnes.Text     = myfiche.Personne;
            this.txtLieu.Text          = myfiche.Lieu;
            this.txtDescription.Text   = myfiche.Description;
            this.txtLienVideo.Text     = myfiche.LienVideo;
            this.mtxDebutSequence.Text = myfiche.TempsDebutSequence;
        }
Esempio n. 5
0
        public FormulaireFiche(int nodeToLoad, string visu)
        {
            InitializeComponent();
            InitializeThemeComboBox();

            idToUpdate = nodeToLoad;

            Fiche myfiche = new Fiche();

            myfiche = fctn.fnSelection(nodeToLoad);

            this.txtCassette.Text       = myfiche.Cassette;
            this.mtxDate.Text           = myfiche.Date;
            this.cbxTheme1.SelectedItem = myfiche.Theme1;
            this.cbxTheme2.SelectedItem = myfiche.Theme2;
            this.txtPersonnes.Text      = myfiche.Personne;
            this.txtLieu.Text           = myfiche.Lieu;
            this.txtDescription.Text    = myfiche.Description;
            this.txtLienVideo.Text      = myfiche.LienVideo;
            this.mtxDebutSequence.Text  = myfiche.TempsDebutSequence;

            this.txtCassette.Enabled      = false;
            this.mtxDate.Enabled          = false;
            this.cbxTheme1.Enabled        = false;
            this.cbxTheme2.Enabled        = false;
            this.txtPersonnes.Enabled     = false;
            this.txtDescription.Enabled   = false;
            this.txtLienVideo.Enabled     = false;
            this.mtxDebutSequence.Enabled = false;
            if (File.Exists(gfctn.AppRootPath() + this.txtLienVideo.Text.Replace("\\", "/")))
            {
                this.btnEnregistrer.Text = "Video";
            }
            else
            {
                this.btnEnregistrer.Visible = false;
            }
        }