* 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:
parent
85346d0e00
commit
b835053e5f
11 changed files with 122 additions and 19 deletions
|
|
@ -12,6 +12,22 @@ namespace WorkFlowProvider
|
|||
{
|
||||
public class NpgsqlContentProvider: ProviderBase, IContentProvider
|
||||
{
|
||||
public long RegisterCommand (Commande com)
|
||||
{
|
||||
long id;
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
"insert into commandes (pref,creation) values (@pref,@creat) returning _id";
|
||||
cmd.Parameters.Add ("@pref", com.ProdRef);
|
||||
cmd.Parameters.Add ("@creat", com.CreationDate);
|
||||
cnx.Open ();
|
||||
com.Id = id = (long)cmd.ExecuteScalar ();
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
public StatusChange[] GetWrittingStatuses (long wrid)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue