コード例 #1
0
        /// <summary>
        /// Update calendar cateogory
        /// </summary>
        /// <param name="CategoryId">Category Id</param>
        /// <param name="CategoryName">New Name</param>
        /// <returns>true for success, false for fail</returns>
        public bool UpdateCalendarCategory(int CategoryId, string CategoryName)
        {
            CalendarDs.CalendarCategoriesRow row = GetCategoryDetails(CategoryId);
            CalendarAdp adp = new CalendarAdp();

            row.CategoryName = CategoryName;

            adp.Update(row);

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Updates an event to the calendar
        /// </summary>
        /// <param name="Id">ID of the edited event</param>
        /// <param name="DateFrom">DateFrom Field</param>
        /// <param name="DateTo">DateTo Field</param>
        /// <param name="Time">Time of the Event (just a string could be from 1:00 pm to 2:00 pm or simply 3:00 pm)</param>
        /// <param name="Title">Title of the event</param>
        /// <param name="Location">Location</param>
        /// <param name="Status">Status 1: enabled 0: disabled</param>
        /// <param name="Description">Description of the event</param>
        /// <param name="CategoryId">Category Id for the event</param>
        /// <param name="UserId">the User or Member Id that added this event</param>
        /// <param name="lan">Event Language <seealso cref="Languages"/></param>
        /// <returns>true if saved false if not</returns>
        ///
        public bool UpdateEvent(int Id, DateTime DateFrom, DateTime?DateTo,
                                string Time, string Title, string Location,
                                byte Status, string Description,
                                int CategoryId, int UserId, Languages lan)
        {
            CalendarAdp adp = new CalendarAdp();

            adp.UpdateEvent(DateFrom, DateTo, Time, Title, Location, (int)Status, Description, CategoryId,
                            UserId, (short)lan, DateTime.Now, Id);

            return(true);
        }
コード例 #3
0
        /// <summary>
        /// Fetches and returns calendar events on the desired language + condition
        /// </summary>
        /// <param name="lan">Language</param>
        /// <param name="cond">Query condition ex: dateFrom = '1/1/2011' </param>
        /// <returns>CalendarDs.CalendarDataTable CalendarEvents</returns>
        public DataTable GetEvents(Languages lan, string cond)
        {
            CalendarAdp adp = new CalendarAdp();

            if (string.IsNullOrWhiteSpace(cond))
            {
                cond += string.Format(" and Language={0}", (int)lan);
            }
            else
            {
                cond = string.Format("Language={0}", (int)lan);
            }


            return(GetEvents(cond));
        }
コード例 #4
0
        /// <summary>
        /// Deletes an event from the database
        /// </summary>
        /// <param name="Id">ID of the event</param>
        public void DeleteEvent(int Id)
        {
            CalendarAdp adp = new CalendarAdp();

            adp.DeleteEvent(Id);
        }
コード例 #5
0
        /// <summary>
        /// Fetches and returns calendar events depending on the condition
        /// </summary>
        /// <param name="cond">Query condition ex: dateFrom = '1/1/2011' </param>
        /// <returns>CalendarDs.CalendarDataTable CalendarEvents</returns>
        public DataTable GetEvents(string cond)
        {
            CalendarAdp adp = new CalendarAdp();

            return(adp.GetEvents(cond));
        }