Esempio n. 1
0
        public void Insert()
        {
            if (State == ObjectState.Changed)
            {
                if (Text.Length == 0)
                {
                    throw new MissingFieldException("Text is missing");
                }
                else
                {
                    Text = FilterEngine.FilterStringBadWords(Text, _4screen.CSB.DataAccess.Data.FilterObjectTypes.Comment, ObjectID.Value, udc.UserID);
                }

                if (!ObjectID.HasValue)
                {
                    throw new MissingFieldException("ObjectID is missing");
                }

                Data.Comment objData = new Data.Comment();
                id = objData.Insert(ObjectID.Value, Text, udc.UserID, BenutzeName, Email, Nickname, IpAddress, IsAnonymous);
                if (ID.HasValue)
                {
                    enuState = ObjectState.Saved;
                    Event.ReportEvent(EventIdentifier.Comment, udc.UserID, ObjectID);
                    Business.UserActivities.InsertComment(udc, ObjectID.Value);
                }
            }
        }
Esempio n. 2
0
        public void Insert()
        {
            if (udc.UserID == Constants.ANONYMOUS_USERID.ToGuid())
            {
                throw new Exception("Access rights missing");
            }

            if (State == ObjectState.Changed)
            {
                if (Text.Length == 0)
                {
                    throw new MissingFieldException("Text is missing");
                }
                else
                {
                    Text = FilterEngine.FilterStringBadWords(Text, _4screen.CSB.DataAccess.Data.FilterObjectTypes.Comment, ObjectID.Value, udc.UserID);
                }

                if (!ObjectID.HasValue)
                {
                    throw new MissingFieldException("ObjectID is missing");
                }

                Data.Comment objData = new Data.Comment();
                id = objData.Insert(ObjectID.Value, Text, udc.UserID);
                if (ID.HasValue)
                {
                    enuState = ObjectState.Saved;
                    Event.ReportEvent(EventIdentifier.Comment, udc.UserID, ObjectID);
                    Business.UserActivities.InsertComment(udc, ObjectID.Value);
                }
            }
        }