Exemplo n.º 1
0
        public void computePos()
        {
            y = (Convert.ToInt32(debut.ToString("HH")) * 20 + Convert.ToInt32(debut.ToString("mm")) / 3) + 40;

            x = ((Loader.SemaineToInt(debut) - 1) * 100) + 40;


            haut = ((Convert.ToInt32(fin.ToString("HH")) * 20 + Convert.ToInt32(fin.ToString("mm")) / 3) - y) + 40;
            return;
        }
Exemplo n.º 2
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()));
            }
        }