コード例 #1
0
        //------------------------------------------------------------------------------------
        public void ExecuteNotification(IDonneeNotification donnee)
        {
            CDonneeNotificationBesoinIntervention db = donnee as CDonneeNotificationBesoinIntervention;

            if (db != null)
            {
                int nId = db.IdBesoinUtilisateur;
                ExecuteBesoinInterventionProcess(nId);
            }
        }
コード例 #2
0
 /// ///////////////////////////////////////
 private void OnNotification(IDonneeNotification donneeNotification)
 {
     if (donneeNotification is CDonneeNotificationBesoinIntervention)
     {
         CDonneeNotificationBesoinIntervention dnbi = (CDonneeNotificationBesoinIntervention)donneeNotification;
         if (dnbi.KeyUtilisateurConcerne == CTimosApp.SessionClient.GetInfoUtilisateur().KeyUtilisateur)
         {
             BeginInvoke((MethodInvoker) delegate
             {
                 UpdateInterventions();
             });
             //CAppeleurFonctionAvecDelai.CallFonctionAvecDelai(this, "UpdateInterventions", 5000);
             //UpdateInterventions();
         }
     }
 }
コード例 #3
0
        /// //////////////////////////////////////////////////
        public override CResultAErreur SaveAll(CContexteSauvegardeObjetsDonnees contexteSauvegarde, System.Data.DataRowState etatsAPrendreEnCompte)
        {
            DataTable      table     = contexteSauvegarde.ContexteDonnee.Tables[GetNomTable()];
            List <DataRow> rowsAdded = new List <DataRow>();

            if (table != null)
            {
                foreach (DataRow row in new ArrayList(table.Rows))
                {
                    if (row.RowState == DataRowState.Added || (row.RowState == DataRowState.Modified && !row[CSc2iDataConst.c_champIsDeleted].Equals(true)))
                    {
                        rowsAdded.Add(row);
                    }
                    if (row.RowState == DataRowState.Deleted || (row.RowState == DataRowState.Modified && row[CSc2iDataConst.c_champIsDeleted].Equals(true)))
                    {
                        //TESTDBKEYTODO
                        CDonneeNotificationBesoinIntervention notif = new CDonneeNotificationBesoinIntervention(
                            IdSession,
                            CDbKey.CreateFromStringValue((string)row[CBesoinInterventionProcess.c_champKeyUtilisateur,
                                                                     DataRowVersion.Original]),
                            (int)row[CBesoinInterventionProcess.c_champId,
                                     DataRowVersion.Original],
                            (string)row[CBesoinInterventionProcess.c_champLibelle,
                                        DataRowVersion.Original],
                            true);
                        CEnvoyeurNotification.EnvoieNotifications(new IDonneeNotification[] { notif });
                    }
                }
            }
            CResultAErreur result = base.SaveAll(contexteSauvegarde, etatsAPrendreEnCompte);

            if (result)
            {
                foreach (DataRow row in rowsAdded)
                {
                    //TESTDBKEYTODO
                    CDonneeNotificationBesoinIntervention notif = new CDonneeNotificationBesoinIntervention(
                        IdSession,
                        CDbKey.CreateFromStringValue((string)row[CBesoinInterventionProcess.c_champKeyUtilisateur]),
                        (int)row[CBesoinInterventionProcess.c_champId],
                        (string)row[CBesoinInterventionProcess.c_champLibelle],
                        false);
                    CEnvoyeurNotification.EnvoieNotifications(new IDonneeNotification[] { notif });
                }
            }
            return(result);
        }
コード例 #4
0
        //------------------------------------------------------------------------------------
        public void GetInfosPopup(IDonneeNotification donnee, ref bool bShouldDisplay, ref string strLibelle, ref Image image)
        {
            bShouldDisplay = false;
            CDonneeNotificationBesoinIntervention db = donnee as CDonneeNotificationBesoinIntervention;

            if (db == null)
            {
                return;
            }
            if (!db.IsDelete)
            {
                //TESTDBKEYOK
                IInfoUtilisateur info = CTimosApp.SessionClient.GetInfoUtilisateur();
                if (info != null && info.KeyUtilisateur == db.KeyUtilisateurConcerne)
                {
                    strLibelle     = db.Libelle;
                    image          = Resources.alerte;
                    bShouldDisplay = true;
                }
            }
        }