@ -13,7 +13,7 @@ namespace Yavsc.Model.WorkFlow
/// It takes orders store them and raise some events for modules
/// It takes orders store them and raise some events for modules
/// It publishes estimates and invoices
/// It publishes estimates and invoices
/// </summary>
/// </summary>
public class WorkFlowManager
public static class WorkFlowManager
{
{
/// <summary>
/// <summary>
/// Gets or sets the catalog.
/// Gets or sets the catalog.
@ -26,7 +26,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The command.</returns>
/// <returns>The command.</returns>
/// <param name="com">COM.</param>
/// <param name="com">COM.</param>
public long RegisterCommand ( Command com )
public static long RegisterCommand ( Command com )
{
{
return ContentProvider . RegisterCommand ( com ) ;
return ContentProvider . RegisterCommand ( com ) ;
}
}
@ -35,7 +35,7 @@ namespace Yavsc.Model.WorkFlow
/// Updates the estimate.
/// Updates the estimate.
/// </summary>
/// </summary>
/// <param name="estim">Estim.</param>
/// <param name="estim">Estim.</param>
public void UpdateEstimate ( Estimate estim )
public static void UpdateEstimate ( Estimate estim )
{
{
ContentProvider . Update ( estim ) ;
ContentProvider . Update ( estim ) ;
}
}
@ -44,7 +44,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The estimate.</returns>
/// <returns>The estimate.</returns>
/// <param name="estid">Estid.</param>
/// <param name="estid">Estid.</param>
public Estimate GetEstimate ( long estid )
public static Estimate GetEstimate ( long estid )
{
{
return ContentProvider . Get ( estid ) ;
return ContentProvider . Get ( estid ) ;
}
}
@ -54,7 +54,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The estimates.</returns>
/// <returns>The estimates.</returns>
/// <param name="responsible">Responsible.</param>
/// <param name="responsible">Responsible.</param>
public Estimate [ ] GetResponsibleEstimates ( string responsible )
public static Estimate [ ] GetResponsibleEstimates ( string responsible )
{
{
return ContentProvider . GetEstimates ( null , responsible ) ;
return ContentProvider . GetEstimates ( null , responsible ) ;
}
}
@ -64,7 +64,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The client estimates.</returns>
/// <returns>The client estimates.</returns>
/// <param name="client">Client.</param>
/// <param name="client">Client.</param>
public Estimate [ ] GetClientEstimates ( string client )
public static Estimate [ ] GetClientEstimates ( string client )
{
{
return ContentProvider . GetEstimates ( client , null ) ;
return ContentProvider . GetEstimates ( client , null ) ;
}
}
@ -74,7 +74,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The user estimates.</returns>
/// <returns>The user estimates.</returns>
/// <param name="username">Username.</param>
/// <param name="username">Username.</param>
public Estimate [ ] GetUserEstimates ( string username )
public static Estimate [ ] GetUserEstimates ( string username )
{
{
return ContentProvider . GetEstimates ( username ) ;
return ContentProvider . GetEstimates ( username ) ;
}
}
@ -84,7 +84,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The stock status.</returns>
/// <returns>The stock status.</returns>
/// <param name="productReference">Product reference.</param>
/// <param name="productReference">Product reference.</param>
public StockStatus GetStock ( string productReference )
public static StockStatus GetStock ( string productReference )
{
{
return ContentProvider . GetStockStatus ( productReference ) ;
return ContentProvider . GetStockStatus ( productReference ) ;
}
}
@ -93,7 +93,7 @@ namespace Yavsc.Model.WorkFlow
/// Updates the writting.
/// Updates the writting.
/// </summary>
/// </summary>
/// <param name="wr">Wr.</param>
/// <param name="wr">Wr.</param>
public void UpdateWritting ( Writting wr )
public static void UpdateWritting ( Writting wr )
{
{
ContentProvider . UpdateWritting ( wr ) ;
ContentProvider . UpdateWritting ( wr ) ;
}
}
@ -102,7 +102,7 @@ namespace Yavsc.Model.WorkFlow
/// Drops the writting.
/// Drops the writting.
/// </summary>
/// </summary>
/// <param name="wrid">Wrid.</param>
/// <param name="wrid">Wrid.</param>
public void DropWritting ( long wrid )
public static void DropWritting ( long wrid )
{
{
ContentProvider . DropWritting ( wrid ) ;
ContentProvider . DropWritting ( wrid ) ;
}
}
@ -110,19 +110,19 @@ namespace Yavsc.Model.WorkFlow
/// Drops the estimate.
/// Drops the estimate.
/// </summary>
/// </summary>
/// <param name="estid">Estid.</param>
/// <param name="estid">Estid.</param>
public void DropEstimate ( long estid )
public static void DropEstimate ( long estid )
{
{
ContentProvider . DropEstimate ( estid ) ;
ContentProvider . DropEstimate ( estid ) ;
}
}
IContentProvider contentProvider ;
static IContentProvider contentProvider ;
/// <summary>
/// <summary>
/// Gets the content provider.
/// Gets the content provider.
/// </summary>
/// </summary>
/// <value>The content provider.</value>
/// <value>The content provider.</value>
public IContentProvider ContentProvider {
public static IContentProvider ContentProvider {
get {
get {
DataProviderConfigurationSection c = ( DataProviderConfigurationSection ) ConfigurationManager . GetSection ( "system.web/workflow" ) ;
DataProviderConfigurationSection c = ( DataProviderConfigurationSection ) ConfigurationManager . GetSection ( "system.web/workflow" ) ;
if ( c = = null )
if ( c = = null )
@ -162,7 +162,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="client">Client.</param>
/// <param name="client">Client.</param>
/// <param name="title">Title.</param>
/// <param name="title">Title.</param>
/// <param name="description">Description.</param>
/// <param name="description">Description.</param>
public Estimate CreateEstimate ( string responsible , string client , string title , string description )
public static Estimate CreateEstimate ( string responsible , string client , string title , string description )
{
{
Estimate created = ContentProvider . CreateEstimate ( responsible , client , title , description ) ;
Estimate created = ContentProvider . CreateEstimate ( responsible , client , title , description ) ;
return created ;
return created ;
@ -176,7 +176,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="ucost">Ucost.</param>
/// <param name="ucost">Ucost.</param>
/// <param name="count">Count.</param>
/// <param name="count">Count.</param>
/// <param name="productid">Productid.</param>
/// <param name="productid">Productid.</param>
public long Write ( long estid , string desc , decimal ucost , int count , string productid )
public static long Write ( long estid , string desc , decimal ucost , int count , string productid )
{
{
if ( ! string . IsNullOrWhiteSpace ( productid ) ) {
if ( ! string . IsNullOrWhiteSpace ( productid ) ) {
if ( Catalog = = null )
if ( Catalog = = null )
@ -197,7 +197,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="estid">Estid.</param>
/// <param name="estid">Estid.</param>
/// <param name="status">Status.</param>
/// <param name="status">Status.</param>
/// <param name="username">Username.</param>
/// <param name="username">Username.</param>
public void SetEstimateStatus ( long estid , int status , string username )
public static void SetEstimateStatus ( long estid , int status , string username )
{
{
ContentProvider . SetEstimateStatus ( estid , status , username ) ;
ContentProvider . SetEstimateStatus ( estid , status , username ) ;
}
}
@ -206,10 +206,17 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// </summary>
/// <returns>The commands.</returns>
/// <returns>The commands.</returns>
/// <param name="username">Username.</param>
/// <param name="username">Username.</param>
public CommandSet GetCommands ( string username )
public static CommandSet GetCommands ( string username )
{
{
return ContentProvider . GetCommands ( username ) ;
return ContentProvider . GetCommands ( username ) ;
}
}
public static string [ ] APEDisponibles
{
get {
return new string [ ] { "Chanteur" , "DJ" , "Musicien" , "Clown" } ;
}
}
}
}
}
}