Exemplo n.º 1
0
 public void save()
 {
     DBConnect proc = new DBConnect();
     if (this.id < 0)
     {
         proc.addPoste(nom, description);
         id = Convert.ToInt32(proc.getLastStuff("Poste").Rows[0]["last_insert_rowid()"].ToString());
     }
     else
     {
         proc.modifyPoste(id, nom, description);
     }
 }
Exemplo n.º 2
0
        public void save()
        {
            DBConnect proc = new DBConnect();
            if (this.id < 0)
            {
                proc.addTeam(nom, description);
                id = Convert.ToInt32(proc.getLastStuff("Team").Rows[0]["last_insert_rowid()"].ToString());
            }
            else
            {
                proc.modifyTeam(id, nom, description);

                proc.deleteTeamProfile(id);
            }

            foreach (Ressource lui in profils)
            {
                proc.addTeamProfile(id, lui.getId(), -1);
            }
        }
Exemplo n.º 3
0
        public void save(Boolean removeP = false)
        {
            DBConnect proc = new DBConnect();
            if (this.id <= 0 || (this.isPreset && removeP))
            {
                proc.addBlock(debut.ToString("yyyy-MM-dd HH:mm:ss"), fin.ToString("yyyy-MM-dd HH:mm:ss"), typeBloc, isPreset);
                id = Convert.ToInt32(proc.getLastStuff("Block").Rows[0]["idBlock"].ToString());
                isPreset = false;

            }
            else
            {
                proc.modifyBlock(debut.ToString("yyyy-MM-dd HH:mm:ss"), fin.ToString("yyyy-MM-dd HH:mm:ss"), id, isPreset);

                proc.deleteRessource(id);

            }
            foreach (RessourceEntree lui in ressourcesVoulus)
            {

                if (lui.voulue is Equipe)
                    proc.addRessource(id, 0, lui.voulue.getId(), lui.nbVoulue);
                else
                    proc.addRessource(id, lui.voulue.getId(), 0, lui.nbVoulue);
            }
        }
Exemplo n.º 4
0
        public void save(bool mod)
        {
            DBConnect proc = new DBConnect();
            if (mod == false)
            {
                proc.ajouterProfil(id, prenom, nom, numTelephone, heuresMax, 0, email, anciennete);
                foreach (Ressource lui in poste)
                {

                    proc.addPosteProfil(lui.getId(), id);
                    mod = true;

                }

            }
            else
                if (mod == true)
                {
                    int i;
                    proc.modifierProfil(id, prenom, nom, numTelephone, heuresMax, 0, email, anciennete);
                    foreach (Ressource lui in poste)
                    {

                        for(i = 0; i <= 3; i++)
                        {
                            proc.deletePosteProfil(id);
                        }
                        proc.addPosteProfil(lui.getId(), id);
                    }
                }
            proc.deleteProfilPreference(id);

            foreach (Bloc pref in preference)
            {
                if (pref.getId() < 0)
                    proc.addPlage(pref.getDebut().ToString("yyyy-MM-dd HH:mm:ss"), pref.getFin().ToString("yyyy-MM-dd HH:mm:ss"), Loader.SemaineToInt(pref.getFin()));
                proc.addProfilPreference(id, Convert.ToInt32(proc.getLastStuff("Plage").Rows[0]["idPlage"].ToString()));
            }
            proc.deleteProfilDispo(id);

            foreach (Bloc dispo in disponibilite)
            {
                proc.addPlage(dispo.getDebut().ToString("yyyy-MM-dd HH:mm:ss"), dispo.getFin().ToString("yyyy-MM-dd HH:mm:ss"), Loader.SemaineToInt(dispo.getFin()));
                proc.addProfilDispo(id, Convert.ToInt32(proc.getLastStuff("Plage").Rows[0]["idPlage"].ToString()));
            }
        }