Example #1
0
        /// <summary>
        /// Adds the specified site tag.
        /// </summary>
        /// <param name="siteTag">The site tag.</param>
        /// <returns></returns>
        public tbl_SiteTags Add(tbl_SiteTags siteTag)
        {
            if (siteTag.ID == Guid.Empty)
            {
                siteTag.ID = Guid.NewGuid();
            }
            _dataContext.tbl_SiteTags.AddObject(siteTag);
            _dataContext.SaveChanges();

            return(siteTag);
        }
Example #2
0
        /// <summary>
        /// Handles the OnClick event of the lbtnAdd control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void lbtnAdd_OnClick(object sender, EventArgs e)
        {
            var segment = new tbl_SiteTags
            {
                SiteID = CurrentUser.Instance.SiteID,
                Name   = txtSegment.Text,
                //Description = txtDescription.Text,
                ObjectTypeID = 1,
                UserID       = CurrentUser.Instance.ID
            };

            _dataManager.SiteTags.Add(segment);

            txtSegment.Text = string.Empty;
            //txtDescription.Text = string.Empty;

            gridSegments.Rebind();
        }
Example #3
0
 /// <summary>
 /// Updates the specified segment.
 /// </summary>
 /// <param name="segment">The segment.</param>
 public void Update(tbl_SiteTags segment)
 {
     _dataContext.SaveChanges();
 }