* Makefile:

* CatalogManager.cs: Let the catalog manager ensure all command form
  are instancied

* PhysicalProduct.cs: A better ToString method

* SaleForm.cs: doc

* NpgsqlContentProvider.cs: registers a command

* FrontOfficeApiController.cs: Set the catalog referer uri in each
  command form found in the catalog

* FrontOfficeController.cs: creates the catalog with referer uri

* instdbws.sql: the command has got a client, as registered user

* Commande.cs: The command has an id and a product reference

* IContentProvider.cs: new RegisterCommand method

* WorkFlowManager.cs: yavscModel/WorkFlow/IContentProvider.cs
This commit is contained in:
Paul Schneider 2015-01-26 16:44:41 +01:00
commit b835053e5f
11 changed files with 122 additions and 19 deletions

View file

@ -10,11 +10,20 @@ namespace Yavsc.Model.WorkFlow
public class Commande
{
public DateTime CreationDate { get; set; }
long Id { get; set; }
public Commande(long catid, long pref, NameValueCollection collection)
public long Id { get; set; }
public string ProdRef { get; set; }
public Commande() {
}
public static Commande Create(NameValueCollection collection)
{
CreationDate = DateTime.Now;
//TODO save it and get the id
Commande cmd = new Commande ();
// string catref=collection["catref"]; // Catalog Url from which formdata has been built
cmd.ProdRef=collection["prodref"]; // Required product reference
cmd.CreationDate = DateTime.Now;
WorkFlowManager wm = new WorkFlowManager ();
wm.RegisterCommand (cmd); // sets cmd.Id
return cmd;
}
}
}

View file

@ -112,6 +112,12 @@ namespace Yavsc.Model.WorkFlow
/// <param name="status">Status.</param>
/// <param name="username">Username.</param>
void SetEstimateStatus (long estid,int status,string username);
/// <summary>
/// Registers the command.
/// </summary>
/// <returns>The command id in db.</returns>
/// <param name="com">COM.</param>
long RegisterCommand (Commande com);
}
}

View file

@ -16,6 +16,11 @@ namespace Yavsc.Model.WorkFlow
{
public static Catalog Catalog { get; set; }
public long RegisterCommand(Commande com)
{
return ContentProvider.RegisterCommand (com);
}
public void UpdateEstimate (Estimate estim)
{
ContentProvider.UpdateEstimate (estim);
@ -105,7 +110,7 @@ namespace Yavsc.Model.WorkFlow
{
if (!string.IsNullOrWhiteSpace(productid)) {
if (Catalog == null)
Catalog = SalesCatalog.CatalogManager.GetCatalog ();
Catalog = SalesCatalog.CatalogManager.GetCatalog ("/WorkFlowApi");
if (Catalog == null)
throw new Exception ("No catalog");
Product p = Catalog.FindProduct (productid);