Esempio n. 1
0
File: CSEvents.cs Progetto: pcstx/OA
 /// <summary>
 /// Raises all BeforeSection events. These events are raised before a section is commited to the datastore
 /// </summary>
 public static void BeforeSection(Section section, ObjectState state, ApplicationType appType)
 {
     CSApplication.Instance().ExecutePreSectionUpdate(section,state,appType);
 }
Esempio n. 2
0
        /// <summary>
        /// Builds and returns an instance of the Forum class based on the current row of an
        /// aptly populated IDataReader object.
        /// </summary>
        /// <param name="dr">The IDataReader object that contains, at minimum, the following
        /// columns: ForumID, DateCreated, Description, Name, Moderated, and DaysToView.</param>
        /// <returns>An instance of the Forum class that represents the current row of the passed 
        /// in SqlDataReader, dr.</returns>
        public static void PopulateSectionFromIDataReader(IDataReader dr, Section s)
        {
            s.SectionID =                 (int) dr["SectionID"];
            s.ParentID =                (int) dr["ParentID"];
            s.SettingsID =                  (int) dr["SettingsID"];
            s.GroupID =            (int) dr["GroupID"];
            s.DateCreated =             (DateTime) dr["DateCreated"];
            s.Description =             (string) dr["Description"];
            s.Name =                    (string) dr["Name"];
            s.NewsgroupName =           (string) dr["NewsgroupName"];
            s.IsModerated =             Convert.ToBoolean(dr["IsModerated"]);
            s.DefaultThreadDateFilter = (ThreadDateFilterMode) dr["DaysToView"];
            s.IsActive =                Convert.ToBoolean(dr["IsActive"]);
            s.IsSearchable =		    Convert.ToBoolean(dr["IsSearchable"]);
            s.SortOrder =               (int) dr["SortOrder"];
            s.DisplayMask =             (byte[]) dr["DisplayMask"];
            s.TotalPosts =              (int) dr["TotalPosts"];
            s.TotalThreads =            (int) dr["TotalThreads"];
            s.GroupID =            (int) dr["GroupID"];
            s.MostRecentPostAuthor =     dr["MostRecentPostAuthor"] as string;
            s.MostRecentPostSubject =    dr["MostRecentPostSubject"] as string;
            s.MostRecentPostAuthorID =  (int) dr["MostRecentPostAuthorID"];
            s.MostRecentPostID =        (int) dr["MostRecentPostId"];
            s.MostRecentThreadID =      (int) dr["MostRecentThreadId"];
            s.MostRecentThreadReplies = (int) dr["MostRecentThreadReplies"];
            s.MostRecentPostDate =      (DateTime) dr["MostRecentPostDate"];
            s.EnableAutoDelete =        Convert.ToBoolean(dr["EnableAutoDelete"]);
            s.EnablePostStatistics =    Convert.ToBoolean(dr["EnablePostStatistics"]);
            s.AutoDeleteThreshold =     (int) dr["AutoDeleteThreshold"];
            s.EnableAnonymousPosting =  Convert.ToBoolean(dr["EnableAnonymousPosting"]);
            s.ForumType =				(ForumType) dr["ForumType"];
            s.NavigateUrl =				(string) dr["Url"];

            s.ApplicationKey = dr["ApplicationKey"] as string;
            //s.DeserializeExtendedAttributes(dr["StringNameValues"] as byte[]);

            s.SetSerializerData(PopulateSerializerDataIDataReader(dr, SerializationType.Section));

            s.ApplicationType = (ApplicationType) (Int16)dr["ApplicationType"];

            try {
                s.PostsToModerate =         (int) dr["PostsToModerate"];
            } catch {}

            //return forum;
        }
Esempio n. 3
0
 public abstract int CreateUpdateDeleteSection(Section section, DataProviderAction action);
Esempio n. 4
0
 internal void ExecutePreSectionUpdate(Section section, ObjectState state, ApplicationType appType)
 {
     CSSectionEventHandler handler = Events[EventPreSectionUpdate] as CSSectionEventHandler;
     if (handler != null)
     {
         handler(section, new CSEventArgs(state,appType));
     }
 }