コード例 #1
0
ファイル: PanelCalendrier.cs プロジェクト: debatg/Projet_Mars
        public PanelCalendrier(TextBox T)
            : base()
        {
            InitializeComponent();

            TB = T;
            FE = new FormErreur();

            _list_Jour = new List<Jour>();

            _list_Act = new List<Activite>();
        }
コード例 #2
0
ファイル: PanelEdt.cs プロジェクト: debatg/Projet_Mars
        private void buttonCR_Click(object sender, EventArgs e)
        {
            XElement Xcr = null;
            var branches = from a in _docXml.Descendants("Jour")
                           select a;

            foreach (XElement elem in branches)
            {
                int num = int.Parse(elem.FirstAttribute.Value);
                if (num == _jourCourant.Num)
                {
                    Xcr=elem.Element("Compte_rendu");

                }
            }
            if (Xcr != null)
            {
                FormCompteRendu Fcr;
                if (_jourCourant.Num<_jourActu.Num)
                     Fcr= new FormCompteRendu(Xcr, true, this);
                else
                    Fcr = new FormCompteRendu(Xcr, false, this);

                Fcr.ShowDialog();
            }
            else
            {
                FormErreur FE = new FormErreur();
                FE.setMessage("Erreur dans le chargement du compte-rendu");
                FE.ShowDialog();
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: debatg/Projet_Mars
 public static void MessErreur(string texte)
 {
     FormErreur FE = new FormErreur();
     FE.setMessage(texte);
     FE.ShowDialog();
 }
コード例 #4
0
ファイル: PanelEdt.cs プロジェクト: debatg/Projet_Mars
        private void btnDescr_Click(object sender, EventArgs e)
        {
            XElement Xcr = null;
            var branches = from a in _docXml.Descendants("Jour")
                           select a;

            foreach (XElement elem in branches)
            {
                int num = int.Parse(elem.FirstAttribute.Value);
                if (num == _jourCourant.Num)
                {
                    var branchesDescr = from a in elem.Descendants("Activité")
                                   select a;
                    foreach(XElement Xdescript in branchesDescr)
                    {
                        int Hdebut = int.Parse(Xdescript.Element("Heure").Value);
                        int minDebut = int.Parse(Xdescript.Element("Min").Value);
                        if (Hdebut == _actSelect.Heure && minDebut == _actSelect.Min)
                            Xcr = Xdescript.Element("Descript");
                    }

                }
            }
            if (Xcr != null)
            {
                FormCompteRendu Fcr;
                if (_jourCourant.Num < _jourActu.Num)
                    Fcr = new FormCompteRendu(Xcr, true, this);
                else
                    Fcr = new FormCompteRendu(Xcr, false, this);

                Fcr.ShowDialog();
            }
            else
            {
                FormErreur FE = new FormErreur();
                FE.setMessage("Erreur dans le chargement du compte-rendu");
                FE.ShowDialog();
            }
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: debatg/Projet_Mars
        /*===========================================================
         * public void buttonJour_Click
         * Paramètre d'entrée :
         * Role : Attirbue le jour courant, et affiche son emploi du temps
         * ==========================================================*/
        private void buttonJour_Click(object sender, EventArgs e)
        {
            try
            {
                if (int.Parse(textBoxJour.Text) >= 1 && int.Parse(textBoxJour.Text) <= 500)
                    panelCal.setJourCourant(int.Parse(textBoxJour.Text));
                else
                    throw new Exception();

            }
            catch (Exception)
            {
                FormErreur FE = new FormErreur();
                FE.setMessage("Jour entré non valide");
                FE.ShowDialog();
            }
        }