Ejemplo n.º 1
0
        //// Removed and Replaced by the above one that returns the row since it is needed //////

        //public bool AddTestimonial(string Text, string From, DateTime? Date, int Approved, int Display, int GroupId)
        //{
        //	TestimonialsDS.TestimonialsRow row = DS.Testimonials.NewTestimonialsRow();

        //	row.Text = Text;
        //	row.From = From;
        //	if(Date != null)
        //		row.Date = Date.Value;

        //	row.Approved = Approved;
        //	row.Display = Display;
        //	row.GroupId = GroupId;
        //	row.DateModified = DateTime.Now;

        //	ds.Testimonials.Rows.Add(row);

        //	AcceptChanges();

        //	return true;
        //}

        public bool UpdateTestimonial(int Id, string Text, string From, DateTime?Date, int Approved, int Display, int GroupId)
        {
            DataView dv = this.GetTestimonials(string.Format("Id = {0}", Id));

            if (dv.Count <= 0)
            {
                return(false);
            }

            TestimonialsDS.TestimonialsRow row = (TestimonialsDS.TestimonialsRow)dv[0].Row;

            row.Text = Text;
            row.From = From;
            if (Date != null)
            {
                row.Date = Date.Value;
            }

            row.Approved = Approved;
            row.Display  = Display;
            row.GroupId  = GroupId;

            row.Table.AcceptChanges();
            AcceptChanges();

            return(true);
        }
Ejemplo n.º 2
0
        public TestimonialsDS.TestimonialsRow GetTestimonial(int Id)
        {
            DataView dv = GetTestimonials(string.Format("Id = {0}", Id));

            TestimonialsDS.TestimonialsRow row = (TestimonialsDS.TestimonialsRow)dv[0].Row;
            return(row);
        }
Ejemplo n.º 3
0
        public bool DeleteTestimonial(int Id)
        {
            DataView dv = this.GetTestimonials(string.Format("Id = {0}", Id));

            if (dv.Count <= 0)
            {
                return(false);
            }

            TestimonialsDS.TestimonialsRow row = (TestimonialsDS.TestimonialsRow)dv[0].Row;

            row.Delete();
            AcceptChanges();

            return(true);
        }
Ejemplo n.º 4
0
        /* Start Testimonials */

        public DataRow AddTestimonial(string Text, string From, DateTime?Date, int Approved, int Display, int GroupId)
        {
            TestimonialsDS.TestimonialsRow row = DS.Testimonials.NewTestimonialsRow();

            row.Text = Text;
            row.From = From;
            if (Date != null)
            {
                row.Date = Date.Value;
            }

            row.Approved     = Approved;
            row.Display      = Display;
            row.GroupId      = GroupId;
            row.DateModified = DateTime.Now;

            ds.Testimonials.Rows.Add(row);

            AcceptChanges();

            return(row);
        }