Пример #1
0
        public int AddSlide(string from, string text)
        {
            DataRow dr = SliderTable.NewRow();

            dr["from"]         = from;
            dr["Text"]         = text;
            dr["DateModified"] = DateTime.Now;

            SliderTable.Rows.Add(dr);
            AcceptChanges();

            return((int)dr["Id"]);
        }
Пример #2
0
        public void UpdateSlide(int id, string from, string text)
        {
            DataView dv = GetSlides(string.Format("id={0}", id));

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

            DataRow dr = SliderTable.NewRow();

            dr["from"]         = from;
            dr["Text"]         = text;
            dr["DateModified"] = DateTime.Now;

            SliderTable.Rows.Add(dr);
            AcceptChanges();
        }