⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eventutility.cs

📁 一个ASP.NET下的中文内容管理和社区系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
            string eventLink,
            string eventBriefDescription, 
            string eventFullDescription, 
            string eventLocation,
            string eventSpeaker,
            string eventSpeakerBiography,
            DateTime eventDate,
            DateTime eventDateVisible,
            int topicID
        ){
            // Update Database with new Event
            SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
            SqlCommand cmdAdd = new SqlCommand("Community_EventsEditEvent", conPortal);
            cmdAdd.CommandType = CommandType.StoredProcedure;
            
            cmdAdd.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
            cmdAdd.Parameters.Add("@contentPageID", contentPageID);
            cmdAdd.Parameters.Add("@username", username);
            cmdAdd.Parameters.Add("@eventTitle", eventTitle);
            cmdAdd.Parameters.Add("@eventLink", eventLink);
            cmdAdd.Parameters.Add("@eventBriefDescription", eventBriefDescription);
			cmdAdd.Parameters.Add("@eventFullDescription", SqlDbType.NText);
			cmdAdd.Parameters["@eventFullDescription"].Value = eventFullDescription;
            cmdAdd.Parameters.Add("@eventLocation", eventLocation);
            cmdAdd.Parameters.Add("@eventSpeaker", eventSpeaker);
            cmdAdd.Parameters.Add("@eventSpeakerBiography", eventSpeakerBiography);
			cmdAdd.Parameters.Add("@eventMetaDescription", ContentPageUtility.CalculateMetaDescription(eventBriefDescription));
            cmdAdd.Parameters.Add("@eventMetaKeys", ContentPageUtility.CalculateMetaKeys(eventBriefDescription));
            cmdAdd.Parameters.Add("@eventDate", eventDate);
            cmdAdd.Parameters.Add("@eventDateVisible", eventDateVisible);
            cmdAdd.Parameters.Add("@topicID", topicID);

            conPortal.Open();
            cmdAdd.ExecuteNonQuery();
            

            // Edit Search Keys
            SearchUtility.EditSearchKeys(conPortal, sectionID, contentPageID, eventTitle, eventBriefDescription);

            
            conPortal.Close();
        }



        //*********************************************************************
        //
        // GetVisibleEvents Method
        //
        // Gets a list of visible future events for this section from the database. 
        //
        //*********************************************************************

        public static ArrayList GetVisibleEvents(string username, int sectionID, int pageSize,int pageIndex, string sortOrder) {
            return GetEvents(false, username, sectionID, pageSize, pageIndex, sortOrder);    
        }


        //*********************************************************************
        //
        // GetInvisibleEvents Method
        //
        // Gets a list of visible and invisible future events for this section 
        // from the database. 
        //
        //*********************************************************************

        public static ArrayList GetInvisibleEvents(string username, int sectionID, int pageSize,int pageIndex, string sortOrder) {
            return GetEvents(true, username, sectionID, pageSize, pageIndex, sortOrder);    
        }
        

        //*********************************************************************
        //
        // GetEvents Method
        //
        // Gets a list of future events for this section from the database. 
        //
        //*********************************************************************

        public static ArrayList GetEvents(bool showInvisible, string username, int sectionID, int pageSize, int pageIndex, string sortOrder) {
            ArrayList colEvents = new ArrayList();
            
            SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
            SqlCommand cmdGet = new SqlCommand( "Community_EventsGetEvents", conPortal);
            cmdGet.CommandType = CommandType.StoredProcedure;
            cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
            cmdGet.Parameters.Add("@username", username);
            cmdGet.Parameters.Add("@sectionID", sectionID);
            cmdGet.Parameters.Add("@pageSize", pageSize);
            cmdGet.Parameters.Add("@pageIndex", pageIndex);
            cmdGet.Parameters.Add("@sortOrder", sortOrder);
            cmdGet.Parameters.Add("@showInvisible", showInvisible);

            conPortal.Open();
            SqlDataReader dr = cmdGet.ExecuteReader();
            while (dr.Read())
                colEvents.Add(new EventInfo(dr));
            conPortal.Close();

            return colEvents;    
        }


        //*********************************************************************
        //
        // GetVisiblePastEvents Method
        //
        // Gets a list of visible future events for this section from the database. 
        //
        //*********************************************************************

        public static ArrayList GetVisiblePastEvents(string username, int sectionID, int pageSize,int pageIndex, string sortOrder) {
            return GetPastEvents(false, username, sectionID, pageSize, pageIndex, sortOrder);    
        }


        //*********************************************************************
        //
        // GetInvisiblePastEvents Method
        //
        // Gets a list of visible and invisible future events for this section 
        // from the database. 
        //
        //*********************************************************************

        public static ArrayList GetInvisiblePastEvents(string username, int sectionID, int pageSize,int pageIndex, string sortOrder) {
            return GetPastEvents(true, username, sectionID, pageSize, pageIndex, sortOrder);    
        }



        //*********************************************************************
        //
        // GetPastEvents Method
        //
        // Gets a list of past events for this section from the database. 
        //
        //*********************************************************************

        public static ArrayList GetPastEvents(bool showInvisible, string username, int sectionID, int pageSize,int pageIndex, string sortOrder) {
            ArrayList colEvents = new ArrayList();
            
            SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
            SqlCommand cmdGet = new SqlCommand( "Community_EventsGetPastEvents", conPortal);
            cmdGet.CommandType = CommandType.StoredProcedure;
            cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
            cmdGet.Parameters.Add("@username", username);
            cmdGet.Parameters.Add("@sectionID", sectionID);
            cmdGet.Parameters.Add("@pageSize", pageSize);
            cmdGet.Parameters.Add("@pageIndex", pageIndex);
            cmdGet.Parameters.Add("@sortOrder", sortOrder);
            cmdGet.Parameters.Add("@showInvisible", showInvisible);

            conPortal.Open();
            SqlDataReader dr = cmdGet.ExecuteReader();
            while (dr.Read())
                colEvents.Add(new EventInfo(dr));
            conPortal.Close();
            return colEvents;    
        }


        //*********************************************************************
        //
        // GetEventInfo Method
        //
        // Gets a particular event from the database. 
        //
        //*********************************************************************

        public static ContentInfo GetEventInfo(string username, int contentPageID) {
            EventInfo _eventInfo = null;
                     
            SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
            SqlCommand cmdGet = new SqlCommand( "Community_EventsGetEvent", conPortal);

            // Add Parameters
            cmdGet.CommandType = CommandType.StoredProcedure;
            cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
            cmdGet.Parameters.Add("@username", username);
            cmdGet.Parameters.Add("@contentPageID", contentPageID);

            conPortal.Open();
              SqlDataReader dr = cmdGet.ExecuteReader();
              if (dr.Read())
                _eventInfo = new EventInfo(dr);
            conPortal.Close();
            return (ContentInfo) _eventInfo;
        }

        
        
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -