/// <summary> /// Adds the specified new_gallery. /// </summary> /// <param name="new_gallery">The new_gallery.</param> public void Add(Gallery new_gallery) { List.Add(new_gallery); }
/// <summary> /// Initializes a new instance of the <see cref="Galleries"/> class. /// </summary> /// <param name="site">The site.</param> public Galleries(Site site) { using(SqlConnection cn = Site.CreateConnection(true, true)) { cn.Open(); using(SqlCommand cmd = new SqlCommand("dbo.getGalleries", cn)) { Guid currentId = Guid.NewGuid(); using(SqlDataReader gallery_list = cmd.ExecuteReader()) { while(gallery_list.Read()) { if(currentId != gallery_list.GetGuid(28)) { currentId = gallery_list.GetGuid(28); G = new Gallery( gallery_list.GetGuid(28), gallery_list.GetString(29), gallery_list.GetInt32(30), gallery_list.GetInt32(31), gallery_list.GetInt32(32), gallery_list.GetGuid(33), gallery_list.GetGuid(34), gallery_list.GetGuid(35), gallery_list.GetGuid(36), gallery_list.GetGuid(37), gallery_list.GetBoolean(38), gallery_list.GetString(39), gallery_list.GetInt32(40), gallery_list.GetString(41) ); List.Add(G); } G.Add(new GalleryImage( gallery_list.GetGuid(0), gallery_list.GetString(1), gallery_list.GetString(2), gallery_list.GetString(3), gallery_list.GetInt32(4), gallery_list.GetInt32(5), gallery_list.GetInt32(6), gallery_list.GetInt32(7), gallery_list.GetInt32(8), gallery_list.GetInt32(9), gallery_list.GetString(10), gallery_list.GetString(11), gallery_list.GetBoolean(12), gallery_list.GetInt32(13), gallery_list.GetInt32(14), gallery_list.GetInt32(15), gallery_list.GetInt32(16), gallery_list.GetInt32(17), gallery_list.GetInt32(18), gallery_list.GetInt32(19), gallery_list.GetDateTime(20), gallery_list.GetInt32(21), gallery_list.GetInt32(22), gallery_list.GetInt32(23), gallery_list.GetInt32(24), gallery_list.GetString(25), gallery_list.GetString(26), gallery_list.GetString(27), gallery_list.GetInt32(42), gallery_list.GetInt32(43), gallery_list.GetString(29), gallery_list.GetGuid(28) )); } } } } }
/// <summary> /// Initializes a new instance of the <see cref="BlogEntry"/> class. /// </summary> /// <param name="f_id">The f_id.</param> /// <param name="f_subject">The f_subject.</param> /// <param name="f_message">The f_message.</param> /// <param name="f_comments">The f_comments.</param> /// <param name="f_tags">The f_tags.</param> /// <param name="f_editor">The f_editor.</param> /// <param name="f_author">The f_author.</param> /// <param name="f_addDate">The f_add date.</param> /// <param name="f_dateChanged">The f_date changed.</param> /// <param name="f_lastEditor">The f_last editor.</param> /// <param name="f_annotations">The f_annotations.</param> /// <param name="f_enabled">if set to <c>true</c> [f_enabled].</param> /// <param name="f_auditComments">if set to <c>true</c> [f_audit comments].</param> /// <param name="f_allowComments">if set to <c>true</c> [f_allow comments].</param> /// <param name="f_emailUpdates">if set to <c>true</c> [f_email updates].</param> /// <param name="f_blogImage">The f_blog image.</param> /// <param name="f_publicBlog">if set to <c>true</c> [f_public Blog].</param> /// <param name="f_listOrder">The f_list order.</param> /// <param name="f_archive">if set to <c>true</c> [f_archive].</param> /// <param name="f_galleryId">The f_gallery id.</param> /// <param name="_blog">The _blog.</param> /// <param name="site">The site.</param> public BlogEntry(Guid f_id, string f_subject, string f_message, string f_comments, string f_tags, int f_editor, int f_author, DateTime f_addDate, DateTime f_dateChanged, int f_lastEditor, string f_annotations, bool f_enabled, bool f_auditComments, bool f_allowComments, bool f_emailUpdates, string f_blogImage, bool f_publicBlog, int f_listOrder, bool f_archive, Guid f_galleryId, Blog _blog, Site site) { Id = f_id; Subject = f_subject.Trim(); Message = f_message; Comments = f_comments; Tags = f_tags.Trim(); EditorId = f_editor; AuthorId = f_author; AddDate = f_addDate; DateChanged = f_dateChanged; LastEditor = f_lastEditor; Annotations = f_annotations; Enabled = f_enabled; AuditComments = f_auditComments; AllowComments = f_allowComments; EmailUpdates = f_emailUpdates; BlogImage = f_blogImage; PublicBlog = f_publicBlog; ListOrder = f_listOrder; Archive = f_archive; Blog = _blog; GalleryId = f_galleryId; Gallery = BlogPlugin.Galleries.List.Find(delegate(Gallery gal) { return gal.Id == GalleryId; }); Replies = Commerce.Reply.All.FindAll(delegate(Rendition.Commerce.Reply reply) { return (reply.ParentId == f_id) && ((reply.FlaggedInappropriate < site.inappropriateHideThreshold) || reply.FlaggedOk); }); Author = Commerce.User.All.Find(delegate(Commerce.User u) { return u.UserId == f_author; }); Editor = Commerce.User.All.Find(delegate(Commerce.User u) { return u.UserId == f_editor; }); Introduction = Message; if(Message.Contains("<h6")) { HasIntroduction = true; string i = Message.Substring(0, Message.IndexOf("<h6") - 4); i = Regex.Replace(i, "(<h6>)|(</h6>)", "", RegexOptions.IgnoreCase); Introduction = i; Message = Regex.Replace(Message, "(<h6>)|(</h6>)", "", RegexOptions.IgnoreCase); } }