public Quotes.QuotesRow GetQuote(int Id) { DataView dv = GetQuotes(string.Format("{0}", Id)); Quotes.QuotesRow row = (Quotes.QuotesRow)dv[0].Row; return(row); }
/* Start Testimonials */ public bool AddQuote(string quote, string author, DateTime date) { Quotes.QuotesRow row = DS._Quotes.NewQuotesRow(); row.Quote = quote; row.Author = author; row.Date = date; ds._Quotes.Rows.Add(row); AcceptChanges(); return(true); }
public bool DeleteQuote(int Id) { DataView dv = this.GetQuotes(string.Format("Id = {0}", Id)); if (dv.Count <= 0) { return(false); } Quotes.QuotesRow row = (Quotes.QuotesRow)dv[0].Row; row.Delete(); AcceptChanges(); return(true); }
public bool UpdateQuote(int Id, string quote, string author, DateTime date) { DataView dv = this.GetQuotes(string.Format("Id = {0}", Id)); if (dv.Count <= 0) { return(false); } Quotes.QuotesRow row = (Quotes.QuotesRow)dv[0].Row; row.Quote = quote; row.Author = author; row.Date = date; row.Table.AcceptChanges(); AcceptChanges(); return(true); }