private Quote SelectQuote() { Quote quote = GetDefaultQuote(); string fileName = Server.MapPath("App_Data") + "\\Quotes.xml"; QuoteXml xml = new QuoteXml(); if (xml.LoadXml(fileName) && xml.QuoteCount > 0) { switch (selection) { case SelectionType.Random: quote = xml.GetRandomQuote(); break; case SelectionType.Hourly: quote = xml.GetHourlyQuote(); break; case SelectionType.Daily: quote = xml.GetDailyQuote(); break; } } return(quote); }
private void AddQuote(Quote quote) { QuoteXml xml = new QuoteXml(); xml.LoadXml(fileName); xml.AddQuote(quote); }
private void DeleteQuote(int quoteID) { QuoteXml xml = new QuoteXml(); xml.LoadXml(fileName); xml.DeleteQuote(quoteID); }
private void UpdateQuote(Quote quote) { QuoteXml xml = new QuoteXml(); xml.LoadXml(fileName); xml.UpdateQuote(quote); }