* 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
parent 017a6fde23
commit b505ad90e7
100 changed files with 2520 additions and 212 deletions

View File

@ -3,8 +3,15 @@ using System.Configuration;
namespace Yavsc.Model.WorkFlow.Configuration
{
/// <summary>
/// WF provider.
/// </summary>
public class WFProvider:ConfigurationElement
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[ConfigurationProperty("name", IsKey=true, IsRequired=true)]
public string Name {
get {
@ -13,6 +20,10 @@ namespace Yavsc.Model.WorkFlow.Configuration
set { base ["name"] = value; }
}
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[ConfigurationProperty("type")]
public string Type {
get { return (string) this ["type"]; }
@ -20,6 +31,11 @@ namespace Yavsc.Model.WorkFlow.Configuration
this ["type"] = value;
}
}
/// <summary>
/// Gets or sets the name of the application.
/// </summary>
/// <value>The name of the application.</value>
[ConfigurationProperty("applicationName")]
public string ApplicationName {
get {
@ -30,6 +46,10 @@ namespace Yavsc.Model.WorkFlow.Configuration
}
}
/// <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"]; }

View File

@ -3,16 +3,33 @@ using System.Configuration;
namespace Yavsc.Model.WorkFlow.Configuration
{
/// <summary>
/// WF provider collection.
/// </summary>
public class WFProviderCollection : ConfigurationElementCollection
{
/// <summary>
/// Gets the element key.
/// </summary>
/// <returns>The element key.</returns>
/// <param name="element">Element.</param>
protected override object GetElementKey (ConfigurationElement element)
{
return ((WFProvider) element).Name;
}
/// <summary>
/// Creates the new element.
/// </summary>
/// <returns>The new element.</returns>
protected override ConfigurationElement CreateNewElement ()
{
return new WFProvider();
}
/// <summary>
/// Gets the element.
/// </summary>
/// <returns>The element.</returns>
/// <param name="name">Name.</param>
public WFProvider GetElement (string name)
{
return this.BaseGet (name) as WFProvider;

View File

@ -3,6 +3,9 @@ using System.Configuration;
namespace Yavsc.Model.WorkFlow.Configuration
{
/// <summary>
/// Workflow configuration.
/// </summary>
public class WorkflowConfiguration : ConfigurationSection
{
/// <summary>

View File

@ -4,26 +4,62 @@ using System.ComponentModel;
namespace Yavsc.Model.WorkFlow
{
/// <summary>
/// Estimate.
/// </summary>
[Serializable]
public class Estimate
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.WorkFlow.Estimate"/> class.
/// </summary>
public Estimate ()
{
}
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[Required]
[Display(ResourceType = typeof(LocalizedText),Name="Title")]
public string Title { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
[Required]
[DisplayName("Description")]
public string Description { get; set; }
/// <summary>
/// Gets or sets the responsible.
/// </summary>
/// <value>The responsible.</value>
[Required]
[DisplayName("Responsable")]
public string Responsible { get; set; }
/// <summary>
/// Gets or sets the client.
/// </summary>
/// <value>The client.</value>
[Required]
[DisplayName("Client")]
public string Client { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public long Id { get; set; }
/// <summary>
/// Gets the ciffer.
/// </summary>
/// <value>The ciffer.</value>
[Display(ResourceType = typeof(LocalizedText),Name="Ciffer")]
public decimal Ciffer {
get {
@ -36,6 +72,10 @@ namespace Yavsc.Model.WorkFlow
}
}
/// <summary>
/// Gets or sets the lines.
/// </summary>
/// <value>The lines.</value>
public Writting[] Lines { get; set; }
}
}

View File

@ -41,8 +41,10 @@ namespace Yavsc.Model.WorkFlow
/// Creates the estimate.
/// </summary>
/// <returns>The estimate.</returns>
/// <param name="responsible">Responsible.</param>
/// <param name="client">Client.</param>
/// <param name="title">Title.</param>
/// <param name="description">Description.</param>
Estimate CreateEstimate (string responsible, string client, string title, string description);
/// <summary>
/// Add a line to the specified estimate by id,
@ -87,17 +89,16 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <param name="wrid">Wrid.</param>
/// <param name="tag">Tag.</param>
void DropTagWritting (long wrid,string tag);
void DropWrittingTag (long wrid,string tag);
/// <summary>
/// Updates the writting.
/// </summary>
/// <param name="wr">Wr.</param>
void UpdateWritting (Writting wr);
/// <summary>
/// Sets the title for a specified estimate by id.
/// Updates the estimate.
/// </summary>
/// <param name="estid">Estid.</param>
/// <param name="newTitle">New title.</param>
/// <param name="estim">Estim.</param>
void UpdateEstimate (Estimate estim);
/// <summary>
/// Sets the writting status.
@ -119,6 +120,13 @@ namespace Yavsc.Model.WorkFlow
/// <returns>The command id in db.</returns>
/// <param name="com">COM.</param>
long RegisterCommand (Commande com);
/// <summary>
/// Gets the stock status.
/// </summary>
/// <returns>The stock status.</returns>
/// <param name="productReference">Product reference.</param>
StockStatus GetStockStatus (string productReference);
}
}

View File

@ -6,10 +6,23 @@ using System.Collections.Specialized;
namespace Yavsc.Model.WorkFlow
{
/// <summary>
/// New estimate even arguments.
/// </summary>
public class NewEstimateEvenArgs: EventArgs
{
private Estimate data=null;
/// <summary>
/// Gets the data.
/// </summary>
/// <value>The data.</value>
public Estimate Data{ get { return data; } }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.WorkFlow.NewEstimateEvenArgs"/> class.
/// </summary>
/// <param name="created">Created.</param>
public NewEstimateEvenArgs(Estimate created)
{
data = created;

View File

@ -1,24 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace Yavsc.Model.WorkFlow
{
[Obsolete("This should be define in an IT specific module")]
public class NewProjectModel
{
[DisplayName("Nom du projet")]
[Required()]
public string Name { get; set; }
[DisplayName("Manager du projet")]
[Required]
public string Manager { get; set; }
[DisplayName("Description du projet")]
[Required]
public string Description { get; set; }
}
}

View File

@ -2,15 +2,32 @@ using System;
namespace Yavsc.Model.WorkFlow
{
/// <summary>
/// Order status changed event arguments.
/// </summary>
public class OrderStatusChangedEventArgs: EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.WorkFlow.OrderStatusChangedEventArgs"/> class.
/// </summary>
/// <param name="oldstatus">Oldstatus.</param>
/// <param name="newstatus">Newstatus.</param>
/// <param name="reason">Reason.</param>
public OrderStatusChangedEventArgs (int oldstatus, int newstatus, string reason)
{
oldstat = oldstatus;
newstat = newstatus;
}
private int oldstat, newstat;
/// <summary>
/// Gets the old status.
/// </summary>
/// <value>The old status.</value>
public int OldStatus { get { return oldstat; } }
/// <summary>
/// Gets the new status.
/// </summary>
/// <value>The new status.</value>
public int NewStatus { get { return newstat; } }
}
}

View File

@ -4,8 +4,19 @@ using System.Web.Mvc;
namespace Yavsc.Model.WorkFlow
{
/// <summary>
/// Status change.
/// </summary>
public class StatusChange {
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
public int Status { get; set;}
/// <summary>
/// Gets or sets the date.
/// </summary>
/// <value>The date.</value>
public DateTime date { get; set;}
}
}

View File

@ -14,13 +14,26 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
public class WorkFlowManager
{
/// <summary>
/// Gets or sets the catalog.
/// </summary>
/// <value>The catalog.</value>
public static Catalog Catalog { get; set; }
/// <summary>
/// Registers the command.
/// </summary>
/// <returns>The command.</returns>
/// <param name="com">COM.</param>
public long RegisterCommand(Commande com)
{
return ContentProvider.RegisterCommand (com);
}
/// <summary>
/// Updates the estimate.
/// </summary>
/// <param name="estim">Estim.</param>
public void UpdateEstimate (Estimate estim)
{
ContentProvider.UpdateEstimate (estim);
@ -34,27 +47,56 @@ namespace Yavsc.Model.WorkFlow
{
return ContentProvider.GetEstimate (estid);
}
/// <summary>
/// Gets the estimates.
/// </summary>
/// <returns>The estimates.</returns>
/// <param name="client">Client.</param>
public Estimate [] GetEstimates (string client)
{
return ContentProvider.GetEstimates (client);
}
/// <summary>
/// Gets the stock for a given product reference.
/// </summary>
/// <returns>The stock status.</returns>
/// <param name="productReference">Product reference.</param>
public StockStatus GetStock(string productReference)
{
return ContentProvider.GetStockStatus (productReference);
}
/// <summary>
/// Updates the writting.
/// </summary>
/// <param name="wr">Wr.</param>
public void UpdateWritting (Writting wr)
{
ContentProvider.UpdateWritting (wr);
}
/// <summary>
/// Drops the writting.
/// </summary>
/// <param name="wrid">Wrid.</param>
public void DropWritting (long wrid)
{
ContentProvider.DropWritting (wrid);
}
/// <summary>
/// Drops the estimate.
/// </summary>
/// <param name="estid">Estid.</param>
public void DropEstimate (long estid)
{
ContentProvider.DropEstimate(estid);
}
IContentProvider contentProvider;
/// <summary>
/// Gets the content provider.
/// </summary>
/// <value>The content provider.</value>
public IContentProvider ContentProvider {
get {
WorkflowConfiguration c = (WorkflowConfiguration) ConfigurationManager.GetSection ("system.web/workflow");
@ -97,15 +139,25 @@ namespace Yavsc.Model.WorkFlow
/// <summary>
/// Creates the estimate.
/// </summary>
/// <returns>The estimate identifier.</returns>
/// <returns>The estimate.</returns>
/// <param name="responsible">Responsible.</param>
/// <param name="client">Client.</param>
/// <param name="title">Title.</param>
/// <param name="description">Description.</param>
public Estimate CreateEstimate(string responsible, string client, string title, string description)
{
Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
return created;
}
/// <summary>
/// Write the specified estid, desc, ucost, count and productid.
/// </summary>
/// <param name="estid">Estid.</param>
/// <param name="desc">Desc.</param>
/// <param name="ucost">Ucost.</param>
/// <param name="count">Count.</param>
/// <param name="productid">Productid.</param>
public long Write(long estid, string desc, decimal ucost, int count, string productid)
{
if (!string.IsNullOrWhiteSpace(productid)) {
@ -121,6 +173,12 @@ namespace Yavsc.Model.WorkFlow
return ContentProvider.Write(estid, desc, ucost, count, productid);
}
/// <summary>
/// Sets the estimate status.
/// </summary>
/// <param name="estid">Estid.</param>
/// <param name="status">Status.</param>
/// <param name="username">Username.</param>
public void SetEstimateStatus(long estid, int status, string username)
{
ContentProvider.SetEstimateStatus (estid, status, username);

View File

@ -47,7 +47,10 @@ namespace Yavsc.Model.WorkFlow
[StringLength (2048)]
[Display(ResourceType = typeof(LocalizedText),Name="Description")]
public string Description { get; set; }
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.WorkFlow.Writting"/>.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.WorkFlow.Writting"/>.</returns>
public override string ToString ()
{
return string.Format ("[Writting: Id={0}, UnitaryCost={1}, Count={2}, ProductReference={3}, Description={4}]", Id, UnitaryCost, Count, ProductReference, Description);