public string Prayed(int id)
        {
            Prayer p = new PrayerRepository().GetById(id);
            p.Prayed = p.Prayed + 1;

            PrayerRepository db = new PrayerRepository();
            string returnValue = db.UpdateOnSubmit(p);
            return returnValue;
        }
        public string AnsweredPrayer(int id)
        {
            //to do sanitized parameters

            Prayer p = new PrayerRepository().GetById(id);
            p.Answered = true;


            PrayerRepository db = new PrayerRepository();
            string returnValue = db.UpdateOnSubmit(p);
            return returnValue;
        }
 public string AddPrayer(string name, string email, string phone, string confidential, string request)
 {
     Prayer p = new Prayer
     {
         Name = name,
         Email = email,
         Phone = phone,
         Confidentiality = confidential,
         PrayerRequest = request,
         Received = DateTime.Now,
         Prayed = 0
     };
     PrayerRepository db = new PrayerRepository();
     string returnValue = db.InsertOnSubmit(p);
     return returnValue;
 }
        /// <summary>
        /// Loads the entities in memory.
        /// </summary>
        public void LoadContent()
        {
            string itemPath   = Path.Combine(ApplicationPaths.EntitiesDirectory, "items.xml");
            string mobPath    = Path.Combine(ApplicationPaths.EntitiesDirectory, "mobs.xml");
            string prayerPath = Path.Combine(ApplicationPaths.EntitiesDirectory, "prayers.xml");
            string spellPath  = Path.Combine(ApplicationPaths.EntitiesDirectory, "spells.xml");

            ItemRepository   itemRepository   = new ItemRepository(itemPath);
            MobRepository    mobRepository    = new MobRepository(mobPath);
            PrayerRepository prayerRepository = new PrayerRepository(prayerPath);
            SpellRepository  spellRepository  = new SpellRepository(spellPath);

            items   = itemRepository.GetAll().ToDomainModels().ToList();
            mobs    = mobRepository.GetAll().ToDomainModels().ToList();
            prayers = prayerRepository.GetAll().ToDomainModels().ToList();
            spells  = spellRepository.GetAll().ToDomainModels().ToList();
        }
        public string UpdatePrayer(int id, string name, string email, string phone, string confidential, string request, int prayed, bool answered)
        {
            //to do sanitized parameters

            Prayer p = new PrayerRepository().GetById(id);
            p.Name = name;
            p.Email = email;
            p.Phone = phone;
            p.Confidentiality = confidential;
            p.PrayerRequest = request;
            p.Prayed = prayed;
            p.Answered = answered;

            PrayerRepository db = new PrayerRepository();
            string returnValue = db.UpdateOnSubmit(p);
            return returnValue;
        }
        public string RemovePrayer(int id)
        {
            //to do sanitized parameters

            PrayerRepository db = new PrayerRepository();
            string returnValue = db.RemoveOnSubmit(id);
            return returnValue;
        }
 public List<Prayer> GetPrayers()
 {
     PrayerRepository db = new PrayerRepository();
     return db.GetAll().ToList();
 }