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

        public int Insert(CompteChaine pCompteChaine)
        {
            string[] lsCols   = null;
            string[] lsValues = null;
            this.FillArray(ref lsCols, ref lsValues, pCompteChaine, true);
            return(DataBase.Insert("[CompteChaine]", lsCols, lsValues));
        }
Beispiel #2
0
        //---------------------------------------------------------------------
        private void FillArray(ref string[] pCols, ref string[] pValues, CompteChaine pCompteChaine, 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++] = "'" + pCompteChaine.ID.ToString() + "'";
            }
            else
            {
                pCols   = new string[liNombre];
                pValues = new string[liNombre];
            }


            pCols[liCpt]     = "id_compte";
            pValues[liCpt++] = "'" + Util.DoubleQuote(pCompteChaine.Id_compte) + "'";

            pCols[liCpt]     = "id_chaine";
            pValues[liCpt++] = "'" + Util.DoubleQuote(pCompteChaine.Id_chaine) + "'";
        }
Beispiel #3
0
        //---------------------------------------------------------------------
        public int Update(CompteChaine pCompteChaine)
        {
            string[] lsCols   = null;
            string[] lsValues = null;

            this.FillArray(ref lsCols, ref lsValues, pCompteChaine, false);
            return(DataBase.UpdateID("CompteChaine", lsCols, lsValues, pCompteChaine.ID));
        }
Beispiel #4
0
        //--------------------------------------------------------------------
        private CompteChaine FillFields(DataRow pDataRow)
        {
            CompteChaine lCompteChaine = new CompteChaine();


            lCompteChaine.Id_compte = (string)pDataRow["id_compte"];

            lCompteChaine.Id_chaine = (string)pDataRow["id_chaine"];



            lCompteChaine.ID = new Guid(pDataRow["iD"].ToString());
            return(lCompteChaine);
        }
Beispiel #5
0
        //--------------------------------------------------------------------
        public CompteChaine Find(Guid ID)
        {
            CompteChaine lCompteChaine = (CompteChaine)AbstractFind(ID);

            if (Util.isNULL(lCompteChaine))
            {
                DataRow row = DataBase.SelectID(ID, "[CompteChaine]");
                if (Util.isNULL(row))
                {
                    return(null);
                }
                lCompteChaine = this.FillFields(row);
                LoadedMap.Add(lCompteChaine.ID, lCompteChaine);
            }
            return(lCompteChaine);
        }
Beispiel #6
0
 //----------------------------------------------------------------------------------------
 public int Delete(CompteChaine pCompteChaine)
 {
     return(DataBase.DeleteID(pCompteChaine.ID, "[CompteChaine]"));
 }