Exemple #1
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);
            }
        }