示例#1
0
        public void DeleteGroup(int GroupId)
        {
            NewsDs       _ds = new NewsDs();
            IDataAdapter adp = base.GetAdapter(cte.NewsletterGroupsAdp);

            NewsDs.NewsletterGroupsRow row = _ds.NewsletterGroups.NewNewsletterGroupsRow();

            row.GroupId = GroupId;
            _ds.NewsletterGroups.AddNewsletterGroupsRow(row);
            row.AcceptChanges();

            row.Delete();

            base.UpdateData(adp, _ds);
        }
示例#2
0
        public int AddGroup(string GroupName)
        {
            System.Data.DataView dv = GetGroups(string.Format("GroupName='{0}'", StringUtils.SQLEncode(GroupName)));
            if (dv.Count > 0)
            {
                return((int)dv[0]["GroupId"]);
            }
            NewsDs       _ds = new NewsDs();
            IDataAdapter adp = base.GetAdapter(cte.NewsletterGroupsAdp);

            NewsDs.NewsletterGroupsRow row = _ds.NewsletterGroups.NewNewsletterGroupsRow();
            row.GroupName = GroupName;

            _ds.NewsletterGroups.AddNewsletterGroupsRow(row);
            base.UpdateData(adp, _ds);
            return(row.GroupId);
        }