Beispiel #1
0
        //--------------------------------------------------------------------

        public int Insert(MembreADesPréférencesCatégorie pMembreADesPréférencesCatégorie)
        {
            string[] lsCols   = null;
            string[] lsValues = null;
            this.FillArray(ref lsCols, ref lsValues, pMembreADesPréférencesCatégorie, true);
            return(DataBase.Insert("[tblMembreADesPréférencesCatégorie]", lsCols, lsValues));
        }
Beispiel #2
0
        //---------------------------------------------------------------------
        public int Update(MembreADesPréférencesCatégorie pMembreADesPréférencesCatégorie)
        {
            string[] lsCols   = null;
            string[] lsValues = null;

            this.FillArray(ref lsCols, ref lsValues, pMembreADesPréférencesCatégorie, false);
            return(DataBase.UpdateID("tblMembreADesPréférencesCatégorie", lsCols, lsValues, pMembreADesPréférencesCatégorie.ID));
        }
Beispiel #3
0
        //--------------------------------------------------------------------
        private MembreADesPréférencesCatégorie FillFields(DataRow pDataRow)
        {
            MembreADesPréférencesCatégorie lMembreADesPréférencesCatégorie = new MembreADesPréférencesCatégorie();

            lMembreADesPréférencesCatégorie.ID          = new Guid(pDataRow["ID"].ToString());
            lMembreADesPréférencesCatégorie.IDMembre    = new Guid(pDataRow["IDMembre"].ToString());
            lMembreADesPréférencesCatégorie.IDCatégorie = new Guid(pDataRow["IDCatégorie"].ToString());
            return(lMembreADesPréférencesCatégorie);
        }
Beispiel #4
0
        //--------------------------------------------------------------------
        public MembreADesPréférencesCatégorie Find(Guid ID)
        {
            MembreADesPréférencesCatégorie lMembreADesPréférencesCatégorie = (MembreADesPréférencesCatégorie)AbstractFind(ID);

            if (Util.isNULL(lMembreADesPréférencesCatégorie))
            {
                DataRow row = DataBase.SelectID(ID, "[tblMembreADesPréférencesCatégorie]");
                if (Util.isNULL(row))
                {
                    return(null);
                }
                lMembreADesPréférencesCatégorie = this.FillFields(row);
                LoadedMap.Add(lMembreADesPréférencesCatégorie.ID, lMembreADesPréférencesCatégorie);
            }
            return(lMembreADesPréférencesCatégorie);
        }
Beispiel #5
0
        //----------------------------------------------------------------------------------------
        public int Delete(MembreADesPréférencesCatégorie pMembreADesPréférencesCatégorie)
        {
            int liErreur = int.MinValue;
            int liTemp;
            int liI = 0;

            liTemp = DataBase.DeleteID(pMembreADesPréférencesCatégorie.ID, "[tblMembreADesPréférencesCatégorie]");
            if (liTemp == liErreur)
            {
                liI = liErreur;
            }
            if (liI != liErreur)
            {
                liI += liTemp;
            }

            return(liI);
        }
Beispiel #6
0
        //---------------------------------------------------------------------
        private void FillArray(ref string[] pCols, ref string[] pValues, MembreADesPréférencesCatégorie pMembreADesPréférencesCatégorie, bool pIsInsertID)
        {
            int liCpt    = 0;
            int liNombre = 2;

            if (pIsInsertID)
            {
                pCols            = new string[liNombre + 1];
                pValues          = new string[liNombre + 1];
                pCols[liCpt]     = "ID";
                pValues[liCpt++] = "'" + pMembreADesPréférencesCatégorie.ID.ToString() + "'";
            }
            else
            {
                pCols   = new string[liNombre];
                pValues = new string[liNombre];
            }


            pCols[liCpt]     = "IDMembre";
            pValues[liCpt++] = "'" + pMembreADesPréférencesCatégorie.IDMembre.ToString() + "'";
            pCols[liCpt]     = "IDCatégorie";
            pValues[liCpt++] = "'" + pMembreADesPréférencesCatégorie.IDCatégorie.ToString() + "'";
        }