예제 #1
0
        public Quotes.QuotesRow GetQuote(int Id)
        {
            DataView dv = GetQuotes(string.Format("{0}", Id));

            Quotes.QuotesRow row = (Quotes.QuotesRow)dv[0].Row;
            return(row);
        }
예제 #2
0
        /* 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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }