* style.css:

* Web.csproj:
* Web.config:
* Catalog.xml:
* Global.asax.cs:
* TestBinding.cs:
* IProvider.cs:
* yavscModel.csproj:
* WFManager.cs:
* BasketController.cs:
* WorkFlowController.cs:
* ITCPNpgsqlProvider.cs:
* IContentProvider.cs:
* WorkFlowProvider.csproj:
* NpgsqlContentProvider.cs:
* Provider.cs:
* ITContentProvider.csproj:
* FrontOfficeApiController.cs:
* ProviderCollection.cs:
* WorkflowConfiguration.cs:
* BlogProvidersConfigurationSection.cs: 

* IITContent.cs: Estimate creation
This commit is contained in:
Paul Schneider
2014-09-18 13:58:43 +02:00
parent fa93ce7fee
commit bba917dcc0
21 changed files with 381 additions and 91 deletions

View File

@ -6,16 +6,7 @@ namespace ITContent
{ {
public interface IITContent: IContentProvider public interface IITContent: IContentProvider
{ {
int NewProject(string name, string desc, string ownedId);
void AddDevRessource (int prjId, string userName);
int NewTask(int projectId, string name, string desc);
void SetProjectName(int projectId, string name);
void SetProjectDesc(int projectId, string desc);
void SetTaskName(int taskId, string name);
void SetStartDate(int taskId, DateTime d);
void SetEndDate(int taskId, DateTime d);
void SetTaskDesc(int taskId, string desc);
void NewRelease(int projectId, string Version);
} }
} }

View File

@ -4,8 +4,21 @@ using Npgsql;
namespace ITContentProvider namespace ITContentProvider
{ {
public class ITCPNpgsqlProvider :NpgsqlContentProvider public class ITCPNpgsqlProvider : NpgsqlContentProvider
{ {
/* TODO
int NewProject(string name, string desc, string ownedId);
void AddDevRessource (int prjId, string userName);
int NewTask(int projectId, string name, string desc);
void SetProjectName(int projectId, string name);
void SetProjectDesc(int projectId, string desc);
void SetTaskName(int taskId, string name);
void SetStartDate(int taskId, DateTime d);
void SetEndDate(int taskId, DateTime d);
void SetTaskDesc(int taskId, string desc);
void NewRelease(int projectId, string Version);
*/
public ITCPNpgsqlProvider () public ITCPNpgsqlProvider ()
{ {
} }

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9D7D892E-9B77-4713-892D-C26E1E944119}</ProjectGuid> <ProjectGuid>{9D7D892E-9B77-4713-892D-C26E1E944119}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
@ -32,6 +32,7 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="Npgsql" /> <Reference Include="Npgsql" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Configuration" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -6,20 +6,30 @@ namespace Npgsql.Web.Blog.Configuration
{ {
public class BlogProvidersConfigurationSection : ConfigurationSection public class BlogProvidersConfigurationSection : ConfigurationSection
{ {
/// <summary>
/// Gets or sets the default provider.
/// </summary>
/// <value>The default provider.</value>
[ConfigurationProperty("defaultProvider")] [ConfigurationProperty("defaultProvider")]
public string DefaultProvider { public string DefaultProvider {
get { return (string)base ["defaultProvider"]; } get { return (string) this ["defaultProvider"]; }
set { base ["defaultProvider"] = value; } set { this["defaultProvider"] = value; }
} }
[ConfigurationProperty("providers")] [ConfigurationProperty("providers")]
[ConfigurationCollection(typeof(BlogProvidersConfigurationCollection), [ConfigurationCollection(typeof(BlogProvidersConfigurationCollection),
AddItemName = "add", AddItemName = "add",
ClearItemsName = "clear", ClearItemsName = "clear",
RemoveItemName = "remove")] RemoveItemName = "remove")]
/// <summary>
/// Gets or sets the providers.
/// </summary>
/// <value>The providers.</value>
public BlogProvidersConfigurationCollection Providers{ public BlogProvidersConfigurationCollection Providers{
get { return (BlogProvidersConfigurationCollection) base ["providers"]; } get { return (BlogProvidersConfigurationCollection) this["providers"]; }
set { base ["providers"] = value; } set { this["providers"] = value; }
} }
} }

View File

@ -0,0 +1,40 @@
using System;
using System.Configuration;
namespace WorkFlowProvider.Configuration
{
public class WFProvider:ConfigurationElement
{
[ConfigurationProperty("name", IsKey=true, IsRequired=true)]
public string Name {
get {
return (string) base ["name"];
}
set { base ["name"] = value; }
}
[ConfigurationProperty("type")]
public string Type {
get { return (string) this ["type"]; }
set {
this ["type"] = value;
}
}
[ConfigurationProperty("applicationName")]
public string ApplicationName {
get {
return (string)this ["applicationName"];
}
set {
this ["applicationName"] = value;
}
}
[ConfigurationProperty("connectionStringName")]
public string ConnectionStringName {
get { return (string)this ["connectionStringName"]; }
set { this ["connectionStringName"] = value; }
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Configuration;
namespace WorkFlowProvider.Configuration
{
public class WFProviderCollection : ConfigurationElementCollection
{
protected override object GetElementKey (ConfigurationElement element)
{
return ((WFProvider) element).Name;
}
protected override ConfigurationElement CreateNewElement ()
{
return new WFProvider();
}
public WFProvider GetElement (string name)
{
return this.BaseGet (name) as WFProvider;
}
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Configuration;
namespace WorkFlowProvider.Configuration
{
public class WorkflowConfiguration : ConfigurationSection
{
/// <summary>
/// Gets or sets the default provider.
/// </summary>
/// <value>The default provider.</value>
[ConfigurationProperty("defaultProvider")]
public string DefaultProvider {
get { return (string)base ["defaultProvider"]; }
set { base ["defaultProvider"] = value; }
}
/// <summary>
/// Gets or sets the providers.
/// </summary>
/// <value>The providers.</value>
[ConfigurationProperty("providers")]
[ConfigurationCollection(typeof(WFProvider),
AddItemName = "add",
ClearItemsName = "clear",
RemoveItemName = "remove")]
public WFProviderCollection Providers {
get {
return this["providers"] as WFProviderCollection;
}
set {
this["providers"]=value;
}
}
}
}

View File

@ -5,58 +5,73 @@ using System.Configuration;
using System.Collections.Specialized; using System.Collections.Specialized;
using yavscModel.WorkFlow; using yavscModel.WorkFlow;
using System.Web.Mvc; using System.Web.Mvc;
using System.Configuration.Provider;
namespace WorkFlowProvider namespace WorkFlowProvider
{ {
public class NpgsqlContentProvider: IContentProvider public class NpgsqlContentProvider: ProviderBase, IContentProvider
{ {
public IWFOrder CreateOrder () public Estimate GetEstimate (long estimid)
{ {
throw new NotImplementedException (); throw new NotImplementedException ();
} }
public IWFOrder ImapctOrder (string orderid, FormCollection col)
public void SetTitle (long estid, string newTitle)
{ {
throw new NotImplementedException (); using (NpgsqlConnection cnx = CreateConnection ()) {
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText =
"update estimate set title = @tit where _id = @estid";
cmd.Parameters.Add ("@tit", newTitle);
cmd.Parameters.Add ("@estid", estid);
cnx.Open ();
cmd.ExecuteNonQuery ();
cnx.Close ();
}
}
} }
public bool[] IsFinalStatus {
public long Write (long estid, string desc, decimal ucost, int count, long productid)
{
using (NpgsqlConnection cnx = CreateConnection ()) {
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText =
"insert into writtings (description, estimid) VALUES (@dscr,@estid) returning _id";
cmd.Parameters.Add ("@dscr", desc);
// cmd.Parameters.Add ("@prdid", productid);
// cmd.Parameters.Add("@ucost", ucost);
// cmd.Parameters.Add("@mult", count);
cmd.Parameters.Add("@estid", estid);
cnx.Open ();
long res = (long) cmd.ExecuteScalar ();
cnx.Close ();
return res;
}
}
}
public void SetDesc (long writid, string newDesc)
{
using (NpgsqlConnection cnx = CreateConnection ()) {
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText =
"update writtings set description = @dscr where _id = @writid";
cmd.Parameters.Add ("@tit", newDesc);
cmd.Parameters.Add ("@writid", writid);
cnx.Open ();
cmd.ExecuteNonQuery ();
cnx.Close ();
}
}
}
public bool[] FinalStatuses {
get { get {
throw new NotImplementedException (); throw new NotImplementedException ();
} }
} }
string applicationName=null;
public string ApplicationName {
get {
return applicationName;
}
}
string cnxstr = null;
public NpgsqlContentProvider ()
{
Initialize("NpgsqlYavscContentProvider",ConfigurationManager.AppSettings);
}
public void Initialize (string name, NameValueCollection config)
{
cnxstr = ConfigurationManager.ConnectionStrings [config ["connectionStringName"]].ConnectionString;
applicationName = config["applicationName"] ?? "/";
}
protected NpgsqlConnection CreateConnection ()
{
return new NpgsqlConnection (cnxstr);
}
#region IDisposable implementation
public void Dispose ()
{
}
#endregion
public string Order (IWFOrder c) public string Order (IWFOrder c)
{ {
throw new NotImplementedException (); throw new NotImplementedException ();
@ -78,11 +93,57 @@ namespace WorkFlowProvider
} }
} }
#region IITContentProvider implementation #region IDisposable implementation
public void Dispose ()
{
}
#endregion #endregion
public long CreateEstimate (string client, string title)
{
using (NpgsqlConnection cnx = CreateConnection ()) {
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText =
"insert into estimate (title,username,applicationname) " +
"values (@tit,@un,@app) returning _id";
cmd.Parameters.Add ("@tit", title);
cmd.Parameters.Add ("@un", client);
cmd.Parameters.Add("@app", ApplicationName);
cnx.Open ();
long res = (long)cmd.ExecuteScalar ();
cnx.Close ();
return res;
}
}
}
string applicationName=null;
public string ApplicationName {
get {
return applicationName;
}
set {
applicationName = value;
}
}
string cnxstr = null;
public override void Initialize (string name, NameValueCollection config)
{
if ( string.IsNullOrWhiteSpace(config ["connectionStringName"]))
throw new ConfigurationErrorsException ("No name for Npgsql connection string found");
cnxstr = ConfigurationManager.ConnectionStrings [config ["connectionStringName"]].ConnectionString;
applicationName = config["applicationName"] ?? "/";
}
protected NpgsqlConnection CreateConnection ()
{
return new NpgsqlConnection (cnxstr);
}
} }
} }

View File

@ -1,18 +1,73 @@
using System; using System;
using yavscModel.WorkFlow; using yavscModel.WorkFlow;
using System.Configuration;
using WorkFlowProvider.Configuration;
using System.Collections.Specialized;
namespace WorkFlowProvider namespace WorkFlowProvider
{ {
public static class WFManager public static class WFManager
{ {
public static IContentProvider GetContentProviderFWC () static IContentProvider contentProvider;
{
string clsName = System.Configuration.ConfigurationManager.AppSettings ["WorkflowContentProviderClass"]; public static IContentProvider ContentProvider {
if (clsName == null) get {
throw new Exception ("No content provider specified in the configuration file (Application parameter \"WorkflowContentProviderClass\")"); WorkflowConfiguration c = (WorkflowConfiguration) ConfigurationManager.GetSection ("system.web/workflow");
System.Reflection.ConstructorInfo ci = Type.GetType (clsName).GetConstructor (System.Type.EmptyTypes); if (c == null)
return (IContentProvider) ci.Invoke (System.Type.EmptyTypes); throw new Exception ("No system.web/workflow configuration section found");
WFProvider confprov = c.Providers.GetElement (c.DefaultProvider);
if (confprov == null)
throw new Exception ("Default workflow provider not found (system.web/workflow@defaultProvider)");
string clsName = confprov.Type;
if (clsName == null)
throw new Exception ("Provider type not specified (system.web/workflow@type)");
if (contentProvider != null)
{
if (contentProvider.GetType ().Name != clsName)
contentProvider = null;
}
if (contentProvider == null)
{
Type cpt = Type.GetType (clsName);
if (cpt == null)
throw new Exception (string.Format("Type not found : {0} (wrong name, or missing assembly reference?)",clsName));
System.Reflection.ConstructorInfo ci =cpt.GetConstructor (System.Type.EmptyTypes);
contentProvider = (IContentProvider)ci.Invoke (System.Type.EmptyTypes);
}
contentProvider.ApplicationName = confprov.ApplicationName;
NameValueCollection config = new NameValueCollection ();
config.Add ("name", confprov.Name);
config.Add ("connectionStringName", confprov.ConnectionStringName);
config.Add ("applicationName", confprov.ApplicationName);
contentProvider.Initialize (confprov.Name, config);
return contentProvider;
}
} }
/// <summary>
/// Creates the estimate.
/// </summary>
/// <returns>The estimate identifier.</returns>
/// <param name="title">Title.</param>
public static long CreateEstimate(string client, string title)
{
return ContentProvider.CreateEstimate (client, title);
}
public static long Write(long estid, string desc, decimal ucost, int count, long productid)
{
return ContentProvider.Write(estid, desc, ucost, count, productid);
}
} }
} }

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</ProjectGuid> <ProjectGuid>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
@ -33,14 +33,15 @@
<Reference Include="Npgsql" /> <Reference Include="Npgsql" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="NpgsqlContentProvider.cs" /> <Compile Include="NpgsqlContentProvider.cs" />
<Compile Include="WFManager.cs" /> <Compile Include="WFManager.cs" />
<Compile Include="Configuration\WorkflowConfiguration.cs" />
<Compile Include="Configuration\ProviderCollection.cs" />
<Compile Include="Configuration\Provider.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
@ -49,4 +50,7 @@
<Name>yavscModel</Name> <Name>yavscModel</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Configuration\" />
</ItemGroup>
</Project> </Project>

View File

@ -38,17 +38,17 @@
<Id>comment</Id> <Id>comment</Id>
<Value xsi:type="xsd:string">Commentaire</Value> <Value xsi:type="xsd:string">Commentaire</Value>
</FormElement> </FormElement>
<FormElement xsi:type="Text"> <!-- <FormElement xsi:type="Text">
<Val>Choisissez le type d'intervention souhaité: </Val> <Val>Choisissez le type d'intervention souhaité: </Val>
</FormElement> </FormElement>
<FormElement xsi:type="SelectInput"> - <FormElement xsi:type="SelectInput">
<Id>ad</Id> <Id>ad</Id>
<Items> <Items>
<string>à distance</string> <string>à distance</string>
<string>sur site</string> <string>sur site</string>
</Items> </Items>
<SelectedIndex>0</SelectedIndex> <SelectedIndex>0</SelectedIndex>
</FormElement> </FormElement> -->
</Items> </Items>
</DefaultForm> </DefaultForm>
</Brand> </Brand>

View File

@ -7,6 +7,7 @@ using System.Web.Security;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
// TODO should mostly be an API Controller
public class BasketController : Controller public class BasketController : Controller
{ {
public ActionResult Index() public ActionResult Index()
@ -21,11 +22,12 @@ namespace Yavsc.Controllers
public ActionResult Create() public ActionResult Create()
{ {
var user = Membership.GetUser (); throw new NotImplementedException();
var username = (user != null)?user.UserName:Request.AnonymousID; // var user = Membership.GetUser ();
// var username = (user != null)?user.UserName:Request.AnonymousID;
// get an existing basket // get an existing basket
return View (); //return View ();
} }
[HttpPost] [HttpPost]

View File

@ -11,6 +11,8 @@ using System.Web;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
using System.Net; using System.Net;
using WorkFlowProvider;
using System.Web.Security;
namespace Yavsc.ApiControllers namespace Yavsc.ApiControllers
{ {
@ -30,13 +32,12 @@ namespace Yavsc.ApiControllers
; ;
} }
[AcceptVerbs("POST")] [AcceptVerbs("GET","POST")]
public string Command() public string Command()
{ {
return null; throw new NotImplementedException();
} }
public HttpResponseMessage Post() public HttpResponseMessage Post()
{ {
HttpResponseMessage result = null; HttpResponseMessage result = null;
@ -80,6 +81,21 @@ namespace Yavsc.ApiControllers
return "/path/to/image.png"; return "/path/to/image.png";
} }
[HttpGet]
[Authorize]
public long CreateEstimate (string title)
{
return WFManager.CreateEstimate (
Membership.GetUser().UserName,title);
}
[HttpGet]
[Authorize]
public long AddToBasket (string title)
{
//TODO find the basket for Membership.GetUser().UserName
//return WFManager.Write(estid << from the basket, desc, ucost, count, productid);
throw new NotImplementedException ();
}
} }
} }

View File

@ -14,8 +14,10 @@ namespace Yavsc.ApiControllers
public class WorkFlowController : ApiController public class WorkFlowController : ApiController
{ {
[HttpGet] [HttpGet]
[Authorize]
public object Index() public object Index()
{ {
return new { test="Hello World" }; return new { test="Hello World" };
} }
@ -25,6 +27,14 @@ namespace Yavsc.ApiControllers
return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.count}; return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.count};
} }
[HttpGet]
[Authorize]
public long Write (long estid, string desc, decimal ucost, int count, long productid=0) {
// TODO ensure estid owner matches the current one
return WFManager.Write(estid, desc, ucost, count, productid);
}
/* /*
public object Details(int id) public object Details(int id)
{ {

View File

@ -42,8 +42,8 @@ namespace Yavsc
GlobalConfiguration.Configuration.Routes.MapHttpRoute( GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "DefaultApi", name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{*path}", routeTemplate: "api/{controller}/{action}/{*id}",
defaults: new { controller = "WorkFlow", action="Index", path = "" } defaults: new { controller = "WorkFlow", action="Index", id=0 }
); );
RegisterRoutes (RouteTable.Routes); RegisterRoutes (RouteTable.Routes);

View File

@ -23,6 +23,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<section name="blog" type="Npgsql.Web.Blog.Configuration.BlogProvidersConfigurationSection, NpgsqlBlogProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="blog" type="Npgsql.Web.Blog.Configuration.BlogProvidersConfigurationSection, NpgsqlBlogProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="workflow" type="WorkFlowProvider.Configuration.WorkflowConfiguration, WorkFlowProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<!-- <runtime> <!-- <runtime>
@ -88,7 +89,6 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add namespace="Yavsc.Helpers" /> <add namespace="Yavsc.Helpers" />
</namespaces> </namespaces>
</pages> </pages>
<authorization> <authorization>
<allow users="*" /> <allow users="*" />
</authorization> </authorization>
@ -118,6 +118,12 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" /> <add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" />
</providers> </providers>
</roleManager> </roleManager>
<workflow defaultProvider="ITProvider">
<providers>
<clear/>
<add name="ITProvider" type="ITContentProvider.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc"/>
</providers>
</workflow>
<profile defaultProvider="NpgsqlProfileProvider"> <profile defaultProvider="NpgsqlProfileProvider">
<providers> <providers>
<clear /> <clear />

View File

@ -251,5 +251,13 @@
<Project>{59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356}</Project> <Project>{59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356}</Project>
<Name>WebControls</Name> <Name>WebControls</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\ITContentProvider\ITContentProvider.csproj">
<Project>{9D7D892E-9B77-4713-892D-C26E1E944119}</Project>
<Name>ITContentProvider</Name>
</ProjectReference>
<ProjectReference Include="..\ITContent\ITContent.csproj">
<Project>{88D83FC9-4158-4435-98A6-1F8F7F448B8F}</Project>
<Name>ITContent</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -6,7 +6,7 @@ body {
color: #D0FFD0; color: #D0FFD0;
margin:1em; margin:1em;
padding:1em; padding:1em;
font-family: 'Dancing Script', cursive; font-family: 'Arial', cursive;
line-height:135%; line-height:135%;
} }
@ -138,7 +138,7 @@ padding-left: 20px;
@media print { @media print {
body {background-color:white;color:black;} body {background-color:white;color:black;}
.postcomment,#login,.actionlink{ display:none;} .postcomment,#login,.actionlink,.metablog,.thanks{ display:none;}
} }
@media all and (max-width: 15em) { @media all and (max-width: 15em) {

12
yavscModel/IProvider.cs Normal file
View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Specialized;
namespace yavscModel
{
public interface IProvider
{
string ApplicationName { get; set; }
void Initialize (string name, NameValueCollection config);
}
}

View File

@ -4,19 +4,21 @@ using System.Web.Mvc;
namespace yavscModel.WorkFlow namespace yavscModel.WorkFlow
{ {
public interface IContentProvider: IDisposable public interface IContentProvider : IProvider, IDisposable
{ {
IWFOrder CreateOrder (); int GetStatus (string estimId);
IWFOrder ImapctOrder (string orderid, FormCollection col);
IContent GetBlob (string orderId);
int GetStatus (string orderId);
/// <summary> /// <summary>
/// Gets the status labels. /// Gets the status labels.
/// 0 is the starting status /// 0 is the starting status
/// </summary> /// </summary>
/// <value>The status labels.</value> /// <value>The status labels.</value>
bool [] IsFinalStatus { get; }
string [] StatusLabels {get;} string [] StatusLabels {get;}
bool [] FinalStatuses { get; }
long CreateEstimate (string client, string title);
void SetTitle (long estid, string newTitle);
long Write (long estid, string desc, decimal ucost, int count, long productid);
void SetDesc (long writid, string newDesc);
Estimate GetEstimate (long estimid);
} }
} }

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</ProjectGuid> <ProjectGuid>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
@ -33,9 +33,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="nunit.framework" /> <Reference Include="nunit.framework" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
@ -59,6 +57,7 @@
<Compile Include="WorkFlow\IWFModule.cs" /> <Compile Include="WorkFlow\IWFModule.cs" />
<Compile Include="WorkFlow\IWFOrder.cs" /> <Compile Include="WorkFlow\IWFOrder.cs" />
<Compile Include="WorkFlow\OrderStatusChangedEventArgs.cs" /> <Compile Include="WorkFlow\OrderStatusChangedEventArgs.cs" />
<Compile Include="IProvider.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>