* 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

@ -41,14 +41,14 @@ namespace Yavsc.ApiControllers
[AcceptVerbs("GET")]
public Catalog Catalog ()
{
Catalog c = CatalogManager.GetCatalog ();
Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath);
return c;
}
[AcceptVerbs("GET")]
public ProductCategory GetProductCategorie (string brandName, string prodCategorie)
{
return CatalogManager.GetCatalog ().GetBrand (brandName).GetProductCategory (prodCategorie)
return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie)
;
}
/*

View file

@ -91,7 +91,7 @@ namespace Yavsc.Controllers
public ActionResult Catalog ()
{
return View (
CatalogManager.GetCatalog ()
CatalogManager.GetCatalog (Request.Url.AbsolutePath)
);
}
@ -101,7 +101,7 @@ namespace Yavsc.Controllers
[AcceptVerbs("GET")]
public ActionResult Brand (string id)
{
Catalog c = CatalogManager.GetCatalog ();
Catalog c = CatalogManager.GetCatalog (Request.Url.AbsolutePath);
ViewData ["BrandName"] = id;
return View ( c.GetBrand (id) );
}
@ -117,7 +117,7 @@ namespace Yavsc.Controllers
{
ViewData ["BrandName"] = id;
return View (
CatalogManager.GetCatalog ().GetBrand (id).GetProductCategory (pc)
CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (id).GetProductCategory (pc)
);
}
@ -128,7 +128,7 @@ namespace Yavsc.Controllers
ViewData ["BrandName"] = id;
ViewData ["ProdCatRef"] = pc;
ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog ();
Catalog cat = CatalogManager.GetCatalog (Request.Url.AbsolutePath);
if (cat == null) {
ViewData ["Message"] = "Catalog introuvable";
ViewData ["RefType"] = "Catalog";
@ -189,7 +189,7 @@ namespace Yavsc.Controllers
Session["Basket"]=new List<Commande>();
List<Commande> basket = Session["Basket"] as List<Commande>;
// Add specified product command to the basket,
basket.Add(new Commande(0,0,collection));
basket.Add(Commande.Create(collection));
return View (collection);
} catch (Exception e)
{

View file

@ -202,17 +202,40 @@ COMMENT ON COLUMN blfiles.blid IS 'Blog entry identifier (foreign key)';
CREATE TABLE commandes
(
id bigint NOT NULL, -- Identifiant unique de commande e, cours
id bigserial NOT NULL, -- Identifiant unique de commande e, cours
validation date, -- Date de validation
prdref character varying(255) NOT NULL, -- Product reference from the unique valid catalog at the validation date
CONSTRAINT commandes_pkey PRIMARY KEY (id)
creation timestamp with time zone, -- creation date
clientname character varying(255), -- user who created the command, client of this command
applicationname character varying(255), -- application concerned by this command
CONSTRAINT commandes_pkey PRIMARY KEY (id),
CONSTRAINT commforeignuser FOREIGN KEY (clientname, applicationname)
REFERENCES users (username, applicationname) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
ALTER TABLE commandes
OWNER TO yavsc;
COMMENT ON COLUMN commandes.id IS 'Identifiant unique de commande e, cours';
COMMENT ON COLUMN commandes.validation IS 'Date de validation';
COMMENT ON COLUMN commandes.prdref IS 'Product reference from the unique valid catalog at the validation date';
COMMENT ON COLUMN commandes.creation IS 'creation date';
COMMENT ON COLUMN commandes.clientname IS 'user who created the command, client of this command';
COMMENT ON COLUMN commandes.applicationname IS 'application concerned by this command';
-- Index: fki_commforeignuser
-- DROP INDEX fki_commforeignuser;
CREATE INDEX fki_commforeignuser
ON commandes
USING btree
(clientname COLLATE pg_catalog."default", applicationname COLLATE pg_catalog."default");
-- Table: comment