public static bool setErreur(TdErreur erreur)
        {
            bdBoutiqueContext db1 = new bdBoutiqueContext();
            bool rep = false;

            try
            {
                db1.tdErreurs.Add(erreur);
                db1.SaveChanges();
                rep = true;
            }catch (Exception ex)
            {
                WriteError(erreur);
            }

            return(rep);
        }
Beispiel #2
0
        /// <summary>
        /// Write Error in the Database
        /// </summary>
        /// <param name="error">The Error created</param>
        /// <returns></returns>
        public static bool GetError(ErrorLog error)
        {
            bool res = false;
            bdBoutiqueContext db1 = new bdBoutiqueContext();

            try
            {
                db1.errorLogs.Add(error);
                db1.SaveChanges();
                res = true;
            }
            catch (Exception ex)
            {
                WriteError(error);
            }
            return(res);
        }