* YavscModel.csproj:

* NewProjectModel.cs:
* ITContentProvider.csproj: refactoring

* WebApiConfig.cs: Web Api Config

* IModule.cs:
* RssFeeds.cs:
* IRenderer.cs:
* Blog.cs:
* ITagHandler.cs:
* ViewRenderer.cs:
* Comment.cs:
* IViewRenderer.cs:
* People.cs:
* SignIn.cs:
* BlogEntry.cs:
* AuthToken.cs:
* BlogHelper.cs:
* DataAccess.cs:
* Estimate.cs:
* BlogManager.cs:
* Writting.cs:
* AskForADate.cs:
* RestoreQuery.cs:
* Basket.cs:
* BlogProvider.cs:
* CalendarList.cs:
* Commande.cs:
* StatusChange.cs:
* WebFileInfo.cs:
* WorkFlowManager.cs:
* Euro.cs:
* Unit.cs:
* Text.cs:
* Profile.cs:
* Note.cs:
* Link.cs:
* BlogEditEntryModel.cs:
* FindBlogEntryFlags.cs:
* NewProjectModel.cs:
* CalendarListEntry.cs:
* CalendarEntryList.cs:
* IContentProvider.cs:
* CommandStatus.cs:
* Label.cs:
* Price.cs:
* BlogEntryCollection.cs:
* Period.cs:
* Scalar.cs:
* BlogEditCommentModel.cs:
* Option.cs:
* NpgsqlContentProvider.cs:
* Product.cs:
* LoginModel.cs:
* Service.cs:
* Catalog.cs:
* Currency.cs:
* NewEstimateEvenArgs.cs:
* CheckBox.cs:
* SaleForm.cs:
* FileSystemManager.cs:
* FormInput.cs:
* TextInput.cs:
* NewRoleModel.cs:
* FileInfoCollection.cs:
* FilesInput.cs:
* NewAdminModel.cs:
* SelectItem.cs:
* SelectInput.cs:
* RadioButton.cs:
* StockStatus.cs:
* Provider.cs:
* DirNotFoundException.cs:
* FormElement.cs:
* ProductImage.cs:
* WebFileInfoCollection.cs:
* CatalogHelper.cs:
* CatalogManager.cs:
* RegisterViewModel.cs:
* InvalidDirNameException.cs:
* PhysicalProduct.cs:
* CatalogProvider.cs:
* ProductCategory.cs:
* OrderStatusChangedEventArgs.cs:
* ProviderCollection.cs:
* WorkflowConfiguration.cs:
* BlogProviderConfigurationElement.cs:
* BlogProvidersConfigurationSection.cs:
* BlogProvidersConfigurationCollection.cs:
* CatalogProviderConfigurationElement.cs:
* CatalogProvidersConfigurationSection.cs:
* CatalogProvidersConfigurationCollection.cs: 
xml doc

* SalesCatalog.csproj:
* XmlCatalogProvider.cs: Maps the catalog using System.Web

* BasketController.cs:
* FrontOfficeController.cs: a Basket controller

* Global.asax.cs: Session in Web Api

* App.master: WebApi bas url as Javascript var 'apiBaseUrl'

* Index.aspx: !!not sure of this change.

* Web.csproj: compiles now includes WebApiConfig.cs

* style.css: link background color

* FileSystemController.cs: a file system controller
This commit is contained in:
Paul Schneider 2015-02-17 13:57:39 +01:00
commit b505ad90e7
100 changed files with 2520 additions and 212 deletions

View file

@ -5,10 +5,17 @@ using System.ComponentModel;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog.
/// </summary>
public class Blog
{
string title;
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[StringLength(512)]
[Required]
[DisplayName("Titre")]

View file

@ -4,22 +4,19 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog edit comment model.
/// </summary>
public class BlogEditCommentModel:Comment
{
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.BlogEditCommentModel"/> is preview.
/// </summary>
/// <value><c>true</c> if preview; otherwise, <c>false</c>.</value>
[DisplayName("Prévisualiser")]
[Required]
public bool Preview { get; set; }
/* TODO Clean
public BlogEditCommentModel(Comment be) {
this.Preview = true;
this.Content = be.Content;
this.Posted = be.Posted;
this.Modified = be.Modified;
this.Visible = be.Visible;
this.From = be.From;
this.PostId = be.PostId;
this.Id = be.Id;
} */
}
}

View file

@ -4,15 +4,30 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog edit entry model.
/// </summary>
public class BlogEditEntryModel:BlogEntry
{
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.BlogEditEntryModel"/> is preview.
/// </summary>
/// <value><c>true</c> if preview; otherwise, <c>false</c>.</value>
[DisplayName("Prévisualiser")]
[Required]
public bool Preview { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.BlogEditEntryModel"/> class.
/// </summary>
public BlogEditEntryModel ()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.BlogEditEntryModel"/> class.
/// </summary>
/// <param name="be">Be.</param>
public BlogEditEntryModel(BlogEntry be) {
this.Preview = true;
this.Content = be.Content;

View file

@ -5,8 +5,17 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog entry.
/// </summary>
public class BlogEntry {
long id;
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
[DisplayName("Identifiant numérique de billet")]
public long Id {
get {
@ -19,6 +28,10 @@ namespace Yavsc.Model.Blogs
string title;
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[DisplayName("Titre du billet")]
[StringLength(512)]
[RegularExpression("^[^:%&?]*$",ErrorMessage = "Les caratères suivants sont invalides pour un titre: :%&?")]
@ -34,6 +47,10 @@ namespace Yavsc.Model.Blogs
string content;
/// <summary>
/// Gets or sets the content.
/// </summary>
/// <value>The content.</value>
[DisplayName("Corps du billet")]
[Required(ErrorMessage = "S'il vous plait, saisissez un texte.")]
public string Content {
@ -47,6 +64,10 @@ namespace Yavsc.Model.Blogs
string userName;
/// <summary>
/// Gets or sets the name of the user.
/// </summary>
/// <value>The name of the user.</value>
[StringLength(255)]
[DisplayName("Nom de l'auteur")]
public string UserName {
@ -57,9 +78,15 @@ namespace Yavsc.Model.Blogs
userName = value;
}
}
/// <summary>
/// The posted.
/// </summary>
public DateTime posted;
/// <summary>
/// Gets or sets the posted.
/// </summary>
/// <value>The posted.</value>
[DisplayName("Date de creation")]
public DateTime Posted {
get {
@ -69,9 +96,15 @@ namespace Yavsc.Model.Blogs
posted = value;
}
}
/// <summary>
/// The modified.
/// </summary>
public DateTime modified;
/// <summary>
/// Gets or sets the modified.
/// </summary>
/// <value>The modified.</value>
[DisplayName("Date de modification")]
public DateTime Modified {
get {
@ -81,7 +114,17 @@ namespace Yavsc.Model.Blogs
modified = value;
}
}
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.BlogEntry"/> is visible.
/// </summary>
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
public bool Visible { get; set ; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public string [] Tags { get; set ; }
}

View file

@ -5,6 +5,9 @@ using Yavsc.Model.Blogs;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog entry collection.
/// </summary>
public class BlogEntryCollection : List<BlogEntry>
{
}

View file

@ -6,8 +6,15 @@ using Yavsc.Model.Blogs.Configuration;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog helper.
/// </summary>
public static class BlogHelper
{
/// <summary>
/// Gets the provider.
/// </summary>
/// <returns>The provider.</returns>
public static BlogProvider GetProvider ()
{
BlogProvidersConfigurationSection config = ConfigurationManager.GetSection ("system.web/blog") as BlogProvidersConfigurationSection;

View file

@ -7,13 +7,27 @@ using System.Web.Security;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog manager.
/// </summary>
public static class BlogManager
{
/// <summary>
/// Removes the comment.
/// </summary>
/// <returns>The comment.</returns>
/// <param name="cmtid">Cmtid.</param>
public static long RemoveComment(long cmtid)
{
return Provider.RemoveComment (cmtid);
}
/// <summary>
/// Comment the specified from, postid, content and visible.
/// </summary>
/// <param name="from">From.</param>
/// <param name="postid">Postid.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public static void Comment (string from, long postid, string content, bool visible)
{
provider.Comment (from, postid, content);
@ -21,6 +35,10 @@ namespace Yavsc.Model.Blogs
static BlogProvider provider;
/// <summary>
/// Gets the provider.
/// </summary>
/// <value>The provider.</value>
public static BlogProvider Provider {
get {
if (provider == null)
@ -28,26 +46,70 @@ namespace Yavsc.Model.Blogs
return provider;
}
}
/// <summary>
/// Gets the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
public static BlogEntry GetPost (string username, string title)
{
return Provider.GetPost (username, title );
}
/// <summary>
/// Gets the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="postid">Postid.</param>
public static BlogEntry GetPost(long postid)
{
return Provider.GetPost (postid);
}
/// <summary>
/// Post the specified username, title, content and visible.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public static void Post(string username, string title, string content, bool visible)
{
Provider.Post(username, title, content, visible );
}
/// <summary>
/// Updates the post.
/// </summary>
/// <param name="postid">Postid.</param>
/// <param name="title">Title.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public static void UpdatePost(long postid, string title, string content, bool visible)
{
Provider.UpdatePost(postid, title, content, visible);
}
/// <summary>
/// Finds the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="pattern">Pattern.</param>
/// <param name="searchflags">Searchflags.</param>
/// <param name="pageIndex">Page index.</param>
/// <param name="pageSize">Page size.</param>
/// <param name="totalRecords">Total records.</param>
public static BlogEntryCollection FindPost (string pattern, FindBlogEntryFlags searchflags, int pageIndex, int pageSize, out int totalRecords)
{
return Provider.FindPost (pattern, searchflags, pageIndex, pageSize, out totalRecords);
}
/// <summary>
/// Removes the post.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
public static void RemovePost (string username, string title)
{
if (!Roles.IsUserInRole ("Admin")) {
@ -61,10 +123,25 @@ namespace Yavsc.Model.Blogs
}
Provider.RemovePost (username, title);
}
/// <summary>
/// Lasts the posts.
/// </summary>
/// <returns>The posts.</returns>
/// <param name="pageIndex">Page index.</param>
/// <param name="pageSize">Page size.</param>
/// <param name="totalRecords">Total records.</param>
public static BlogEntryCollection LastPosts (int pageIndex, int pageSize, out int totalRecords)
{
return Provider.LastPosts (pageIndex, pageSize, out totalRecords);
}
/// <summary>
/// Gets the comments.
/// </summary>
/// <returns>The comments.</returns>
/// <param name="postid">Postid.</param>
/// <param name="getHidden">If set to <c>true</c> get hidden.</param>
public static Comment[] GetComments(long postid, bool getHidden=true)
{
return Provider.GetComments (postid,getHidden);
@ -73,6 +150,7 @@ namespace Yavsc.Model.Blogs
/// Tag the specified post by postid.
/// </summary>
/// <param name="postid">Postid.</param>
/// <param name="tag">Tag.</param>
/// <returns>The tag identifier</returns>
public static long Tag(long postid, string tag) {
return Provider.Tag (postid, tag);

View file

@ -5,27 +5,147 @@ using System.Collections.Generic;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Blog provider.
/// </summary>
public abstract class BlogProvider: ProviderBase
{
/// <summary>
/// Gets the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="postid">Postid.</param>
public abstract BlogEntry GetPost (long postid);
/// <summary>
/// Gets the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
public abstract BlogEntry GetPost (string username, string title);
/// <summary>
/// Gets the post identifier.
/// </summary>
/// <returns>The post identifier.</returns>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
public abstract long GetPostId (string username, string title);
/// <summary>
/// Post the specified username, title, content and visible.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public abstract long Post (string username, string title, string content, bool visible);
/// <summary>
/// Updates the post.
/// </summary>
/// <param name="postid">Postid.</param>
/// <param name="title">Title.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public abstract void UpdatePost (long postid, string title, string content, bool visible);
/// <summary>
/// Finds the post.
/// </summary>
/// <returns>The post.</returns>
/// <param name="pattern">Pattern.</param>
/// <param name="searchflags">Searchflags.</param>
/// <param name="pageIndex">Page index.</param>
/// <param name="pageSize">Page size.</param>
/// <param name="totalRecords">Total records.</param>
public abstract BlogEntryCollection FindPost (string pattern, FindBlogEntryFlags searchflags,
int pageIndex, int pageSize, out int totalRecords);
/// <summary>
/// Removes the post.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="title">Title.</param>
public abstract void RemovePost (string username, string title);
/// <summary>
/// Removes the post.
/// </summary>
/// <param name="postid">Postid.</param>
public abstract void RemovePost (long postid);
/// <summary>
/// Removes the comment.
/// </summary>
/// <returns>The comment.</returns>
/// <param name="cmtid">Cmtid.</param>
public abstract long RemoveComment (long cmtid);
/// <summary>
/// Lasts the posts.
/// </summary>
/// <returns>The posts.</returns>
/// <param name="pageIndex">Page index.</param>
/// <param name="pageSize">Page size.</param>
/// <param name="totalRecords">Total records.</param>
public abstract BlogEntryCollection LastPosts(int pageIndex, int pageSize, out int totalRecords);
/// <summary>
/// Blogs the title.
/// </summary>
/// <returns>The title.</returns>
/// <param name="username">Username.</param>
public abstract string BlogTitle (string username);
/// <summary>
/// Comment the specified from, postid and content.
/// </summary>
/// <param name="from">From.</param>
/// <param name="postid">Postid.</param>
/// <param name="content">Content.</param>
public abstract long Comment (string from, long postid, string content);
/// <summary>
/// Gets the comments.
/// </summary>
/// <returns>The comments.</returns>
/// <param name="postid">Postid.</param>
/// <param name="getHidden">If set to <c>true</c> get hidden.</param>
public abstract Comment[] GetComments (long postid, bool getHidden) ;
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.BlogProvider"/> auto validate comment.
/// </summary>
/// <value><c>true</c> if auto validate comment; otherwise, <c>false</c>.</value>
public abstract bool AutoValidateComment { get; set; }
/// <summary>
/// Validates the comment.
/// </summary>
/// <param name="cmtid">Cmtid.</param>
public abstract void ValidateComment (long cmtid);
/// <summary>
/// Updates the comment.
/// </summary>
/// <param name="cmtid">Cmtid.</param>
/// <param name="content">Content.</param>
/// <param name="visible">If set to <c>true</c> visible.</param>
public abstract void UpdateComment (long cmtid, string content, bool visible);
/// <summary>
/// Tag the specified postid and tag.
/// </summary>
/// <param name="postid">Postid.</param>
/// <param name="tag">Tag.</param>
public abstract long Tag (long postid,string tag);
/// <summary>
/// Removes the tag.
/// </summary>
/// <param name="tagid">Tagid.</param>
public abstract void RemoveTag (long tagid);
}

View file

@ -5,9 +5,17 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Comment.
/// </summary>
public class Comment
{
long id;
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
[DisplayName("Identifiant numérique de commentaire")]
public long Id {
get {
@ -18,6 +26,11 @@ namespace Yavsc.Model.Blogs
}
}
long postid;
/// <summary>
/// Gets or sets the post identifier.
/// </summary>
/// <value>The post identifier.</value>
[DisplayName("Identifiant numérique du billet commenté")]
public long PostId {
get {
@ -27,13 +40,19 @@ namespace Yavsc.Model.Blogs
postid = value;
}
}
/// <summary>
/// Gets or sets the author of this comment.
/// </summary>
/// <value>From.</value>
public string From { get; set; }
string content;
/// <summary>
/// Gets or sets the comment text.
/// </summary>
/// <value>The comment text.</value>
[DisplayName("Contenu")]
[Required(ErrorMessage = "S'il vous plait, saisissez un contenu")]
public string CommentText {
@ -45,8 +64,12 @@ namespace Yavsc.Model.Blogs
}
}
public DateTime posted;
private DateTime posted;
/// <summary>
/// Gets or sets the posted.
/// </summary>
/// <value>The posted.</value>
[DisplayName("Date de creation")]
public DateTime Posted {
get {
@ -57,8 +80,12 @@ namespace Yavsc.Model.Blogs
}
}
public DateTime modified;
private DateTime modified;
/// <summary>
/// Gets or sets the modified.
/// </summary>
/// <value>The modified.</value>
[DisplayName("Date de modification")]
public DateTime Modified {
get {
@ -69,6 +96,10 @@ namespace Yavsc.Model.Blogs
}
}
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.Comment"/> is visible.
/// </summary>
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
public bool Visible { get; set ; }
}

View file

@ -4,33 +4,55 @@ using System.ComponentModel;
namespace Yavsc.Model.Blogs.Configuration
{
/// <summary>
/// Blog provider configuration element.
/// </summary>
public class BlogProviderConfigurationElement : ConfigurationElement
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ConfigurationProperty("name", IsRequired = true, IsKey=true)]
public string Name {
get { return (string)this ["name"]; }
set { this ["name"] = value; }
}
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ConfigurationProperty("type", IsRequired = true, IsKey=false)]
public string Type {
get { return (string)this ["type"]; }
set { this ["type"] = value; }
}
/// <summary>
/// Gets or sets the name of the connection string.
/// </summary>
/// <value>The name of the connection string.</value>
[ConfigurationProperty("connectionStringName")]
public string ConnectionStringName {
get { return (string)this ["connectionStringName"]; }
set { this ["connectionStringName"] = value; }
}
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[ConfigurationProperty("description")]
public string Description {
get { return (string)this ["description"]; }
set { this ["description"] = value; }
}
/// <summary>
/// Gets or sets the name of the application.
/// </summary>
/// <value>The name of the application.</value>
[ConfigurationProperty("applicationName")]
public string ApplicationName {
get { return (string)this ["applicationName"]; }

View file

@ -4,18 +4,35 @@ using System.ComponentModel;
namespace Yavsc.Model.Blogs.Configuration
{
/// <summary>
/// Blog providers configuration collection.
/// </summary>
public class BlogProvidersConfigurationCollection : ConfigurationElementCollection
{
/// <summary>
/// Creates the new element.
/// </summary>
/// <returns>The new element.</returns>
protected override ConfigurationElement CreateNewElement ()
{
return new BlogProviderConfigurationElement();
}
/// <summary>
/// Gets the element key.
/// </summary>
/// <returns>The element key.</returns>
/// <param name="element">Element.</param>
protected override object GetElementKey (ConfigurationElement element)
{
return ((BlogProviderConfigurationElement) element).Name;
}
/// <summary>
/// Gets the element.
/// </summary>
/// <returns>The element.</returns>
/// <param name="name">Name.</param>
public BlogProviderConfigurationElement GetElement (string name)
{
return this.BaseGet(name) as BlogProviderConfigurationElement;

View file

@ -4,6 +4,9 @@ using System.ComponentModel;
namespace Yavsc.Model.Blogs.Configuration
{
/// <summary>
/// Blog providers configuration section.
/// </summary>
public class BlogProvidersConfigurationSection : ConfigurationSection
{
/// <summary>
@ -16,16 +19,15 @@ namespace Yavsc.Model.Blogs.Configuration
set { this["defaultProvider"] = value; }
}
/// <summary>
/// Gets or sets the providers.
/// </summary>
/// <value>The providers.</value>
[ConfigurationProperty("providers")]
[ConfigurationCollection(typeof(BlogProvidersConfigurationCollection),
AddItemName = "add",
ClearItemsName = "clear",
RemoveItemName = "remove")]
/// <summary>
/// Gets or sets the providers.
/// </summary>
/// <value>The providers.</value>
public BlogProvidersConfigurationCollection Providers{
get { return (BlogProvidersConfigurationCollection) this["providers"]; }
set { this["providers"] = value; }

View file

@ -4,11 +4,25 @@ using System.Collections.Generic;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Find blog entry flags.
/// </summary>
public enum FindBlogEntryFlags : byte {
/// <summary>
/// The match title.
/// </summary>
MatchTitle = 1,
/// <summary>
/// The content of the match.
/// </summary>
MatchContent = 2,
/// <summary>
/// The name of the match user.
/// </summary>
MatchUserName = 4,
/// <summary>
/// The match invisible.
/// </summary>
MatchInvisible = 8
}