///////////////////////////////////////////////////////////////
        public override CResultAErreur VerifieDonnees(CObjetDonnee objet)
        {
            CResultAErreur result = CResultAErreur.True;

            try
            {
                CConsultationAlarmesEnCoursInDb consultAl = objet as CConsultationAlarmesEnCoursInDb;

                if (consultAl.Libelle.Length == 0)
                {
                    result.EmpileErreur(I.T("Consultation name should be defined|60007"));
                }

                if (!CObjetDonneeAIdNumerique.IsUnique(consultAl, CConsultationAlarmesEnCoursInDb.c_champLibelle, consultAl.Libelle))
                {
                    result.EmpileErreur(I.T("The consultation '@1' already exist|60007", consultAl.Libelle));
                }

                if (consultAl.Parametres.ListeColonnes.Length <= 0)
                {
                    result.EmpileErreur(I.T("Select data to display|60010"));
                }
            }
            catch (Exception e)
            {
                result.EmpileErreur(new CErreurException(e));
            }
            return(result);
        }
示例#2
0
        public CFormListeAlarmeEnCours(CConsultationAlarmesEnCoursInDb consultation, CFormNavigateur navigateur)
        {
            c_nBaseControleRetombee = 15000 / c_nTimeClignote;

            List <string> strNomColonnes;
            string        st;
            TimeSpan      duree;
            DateTime      start, stop;

            m_consultationEnCours = consultation;

            m_navigateur = navigateur;

            start = DateTime.Now;

            InitializeComponent();

            this.Text             = consultation.Libelle;
            m_timerVoyant.Enabled = true;

            stop  = DateTime.Now;
            duree = stop - start; //test duree = 8 sec !!!!!!!

            m_recepteurNotifications = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmes));
            m_recepteurNotifications.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAlarmEnCours);

            /*   m_recepteurNotificationsStop = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesStop));
             * m_recepteurNotificationsStop.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationStop);
             *
             * m_recepteurNotificationsMask = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesMask));
             * m_recepteurNotificationsMask.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationMask);
             *
             * m_recepteurNotificationsAcknowledge = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesAcknowledge));
             * m_recepteurNotificationsAcknowledge.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAcknowledge);*/


            List <CInfoAlarmeAffichee> lstEnCours = new List <CInfoAlarmeAffichee>();
            List <CInfoAlarmeAffichee> lstRetombe = new List <CInfoAlarmeAffichee>();

            m_lstViewEnCours.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetEnCours);
            m_lstViewRetombe.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetRetombe);

            m_lstViewEnCours.DoubleClick += new EventHandler(OnLstViewEnCoursDoubleClick);
            m_lstViewRetombe.DoubleClick += new EventHandler(OnLstViewRetombeDoubleClick);

            lstEnCours = GetAlarmsInfoFromDB();

            strNomColonnes = m_consultationEnCours.Parametres.GetColumnNames();

            m_lstViewEnCours.Init(strNomColonnes.ToArray(), lstEnCours.ToArray());

            st = I.T("End date|60023");
            strNomColonnes.Add(st);
            st = I.T("Duration|60022");
            strNomColonnes.Add(st);
            m_lstViewRetombe.Init((string[])strNomColonnes.ToArray(), lstRetombe.ToArray());

            m_strMaskAdminButtonText = I.T("Alarms masked by Administrator|60016") + " : ";
            m_strMaskBrigButtonText  = I.T("Alarms masked by Operating agent|60017") + " : ";
            m_strFrequentButtonText  = I.T("Current frequent alarms|60018") + " : ";

            InitButtonsInfo();

            MAJFrequentButtonText();
            MAJAdminButtonText();
            MAJBrigButtonText();

            m_btnMaskedOnCreation.Text = I.T("Alarms masked on creation|60047") + " : " + m_NbMasqCreat.ToString();

            label1.Text = I.T("Current alarms|60014");
            label2.Text = I.T("Cleared alarms|60015");

            CDocumentGED docSonnerie = consultation.DocumentGEDSoundFile;

            if (docSonnerie != null && docSonnerie.ReferenceDoc != null)
            {
                m_proxySonnerie = new CProxyGED(consultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc);
                if (!m_proxySonnerie.CopieFichierEnLocal())
                {
                    m_proxySonnerie.Dispose();
                    m_proxySonnerie = null;
                }
            }

            //SetVoyantAlarme();
            Type tpVar = GetType();

            Type tpGeneric = typeof(List <>);

            tpGeneric = tpGeneric.MakeGenericType(tpVar);

            object liste = Activator.CreateInstance(tpGeneric);
        }
 //-------------------------------------------------------------------------
 public CFormEditionConsultationAlarmesEnCours2(CConsultationAlarmesEnCoursInDb param, CListeObjetsDonnees liste)
     : base(param, liste)
 {
     // Cet appel est requis par le Concepteur Windows Form.
     InitializeComponent();
 }
 //-------------------------------------------------------------------------
 public CFormEditionConsultationAlarmesEnCours2(CConsultationAlarmesEnCoursInDb param)
     : base(param)
 {
     // Cet appel est requis par le Concepteur Windows Form.
     InitializeComponent();
 }